Skip to content

Commit 21494ba

Browse files
committed
is_linear_variables/is_linear_equations should be be computed recursively
1 parent f7da821 commit 21494ba

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/systems/alias_elimination.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,22 @@ function aag_bareiss!(graph, var_to_diff, mm_orig::SparseMatrixCLIL, irreducible
508508
is_linear_variables[v] = false
509509
is_reducible[v] = false
510510
end
511+
# TODO/FIXME: This needs a proper recursion to compute the transitive
512+
# closure.
513+
@label restart
511514
for i in 𝑠vertices(graph)
512515
is_linear_equations[i] && continue
516+
# This needs recursion
513517
for j in 𝑠neighbors(graph, i)
514-
is_linear_variables[j] = false
518+
if is_linear_variables[j]
519+
is_linear_variables[j] = false
520+
for k in 𝑑neighbors(graph, j)
521+
if is_linear_equations[k]
522+
is_linear_equations[k] = false
523+
@goto restart
524+
end
525+
end
526+
end
515527
end
516528
end
517529
solvable_variables = findall(is_linear_variables)

0 commit comments

Comments
 (0)