How do you filter to only return solvable == 0
As per #201:
Using solvable in this way means that it's a lower bound when filtering - filtering on solvable=0 means that you'll get both solvable=1 and solvable=0. That is correct? DF correct
At present there isn't a way to query unsolved nodes.
Ok, I missed the reasoning behind it. What about a compromise.
- use an
Array{Int} = []or - use an
UnitRange{Int64}
eg.
function _isSolvable(dfg::LightDFG, label::Symbol, ready::Array{Int})::Bool
haskey(dfg.g.variables, label) && (return dfg.g.variables[label].solvable in ready)
haskey(dfg.g.factors, label) && (return dfg.g.factors[label].solvable in ready)
...
Thinking about this - if filtering solvable==0 is needed, I'd suggest we don't use the lower limit then. Rather we switch it to an equality check than introduce the array?
I came across another case here #331. Maybe == will work better as you said. However, I don't understand the reason behind > so hesitant to change.
Think we resolved this in a previous discussion? The main idea is/was that there are levels of solvable. The way I find solvable == 0 is to use setdiff(ls(fg,solvable=0), ls(fg, solvable=1)). Its working well enough for the time being that we can close this issue?
understand the reason behind > so hesitant to change.
We need a way to search for multiple values of solvable at once, and rather than doing a ton of x in list it seemed more sensible to work with an Int and < or >. So ls(fg, solvable=0) will include all 0 <= val -- i.e. ==0, ==1, ==2, etc.
The easiest way then is to use setdiff for only getting ==0 but excluding ==1 or ==0 cases. However, this way is easier to get just solvables and skip unsolvables.