Skip to content

Commit c17f15f

Browse files
committed
add setSolvable!
1 parent 728d0fb commit c17f15f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Common.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export getFactorType, getfnctype
88
export lsTypes, lsfTypes
99
export lsWho, lsfWho
1010
export *
11+
export setSolvable!
1112

1213
*(a::Symbol, b::AbstractString)::Symbol = Symbol(string(a,b))
1314

@@ -320,3 +321,16 @@ function lsfWho(dfg::AbstractDFG, type::Symbol)::Vector{Symbol}
320321
end
321322
return labels
322323
end
324+
325+
326+
"""
327+
$SIGNATURESSet the `solvable` parameter for either a variable or factor.
328+
"""
329+
function setSolvable!(dfg::AbstractDFG, sym::Symbol, solvable::Int)
330+
if isVariable(dfg, sym)
331+
getVariable(dfg, sym).solvable = solvable
332+
elseif isFactor(dfg, sym)
333+
getFactor(dfg, sym).solvable = solvable
334+
end
335+
return solvable
336+
end

0 commit comments

Comments
 (0)