Skip to content

Standarize w/ separate package all eliminationOrdering methods #980

Open
@dehann

Description

@dehann

see new package https://github.com/JuliaRobotics/VariableEliminationOrderings.jl

Background

Existing Usage in IncrementalInference

# Get the sparse adjacency matrix, variable, and factor labels
adjMat, permuteds, permutedsf = DFG.getBiadjacencyMatrix(dfg, solvable=solvable)
# adjMat, permuteds, permutedsf = DFG.getAdjacencyMatrixSparse(dfg, solvable=solvable)
# Create dense adjacency matrix
p = Int[]
if ordering==:chol
# hack for dense matrix....
A = adjMat
p = cholesky(Matrix(A'A),Val(true)).piv
@warn "check that cholesky ordering is not reversed -- basically how much fill in (separator size) are you seeing??? Long skinny chains in tree is bad."
elseif ordering==:qr
# hack for dense matrix....
A = Array(adjMat)
# this is the default
q,r,p = qr(A, Val(true))
p .= p |> reverse
elseif ordering==:ccolamd
cons = zeros(SuiteSparse_long, length(adjMat.colptr) - 1)
cons[findall(x->x in constraints, permuteds)] .= 1
p = Ccolamd.ccolamd(adjMat, cons)
@warn "Ccolamd is experimental in IIF at this point in time."
else
prtslperr("getEliminationOrder -- cannot do the requested ordering $(ordering)")
end
# Return the variable ordering that we should use for the Bayes map
# reverse order checked in #475 and #499
return permuteds[p]

And the new RCS package to be included:
https://discourse.julialang.org/t/implementing-cuthill-mckee/9268/31


Also see discussion at (pending license):

One solution might be to have JuliaRobotics/VariableEliminationOrderings.jl provides a mechanism to include more methods depending on the desired license restrictions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions