Skip to content

Commit 4a4a059

Browse files
YingboMaKeno
andcommitted
Add update_graph_neighbors!
Co-authored-by: Keno Fischer <[email protected]>
1 parent f0ec298 commit 4a4a059

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/systems/alias_elimination.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,16 @@ function alias_eliminate_graph!(graph, var_to_diff, mm_orig::SparseMatrixCLIL)
888888
return ag, mm, updated_diff_vars
889889
end
890890

891+
function update_graph_neighbors!(graph, ag)
892+
for eq in 1:nsrcs(graph)
893+
set_neighbors!(graph, eq,
894+
[get(ag, n, (1, n))[2]
895+
for n in 𝑠neighbors(graph, eq)
896+
if !haskey(ag, n) || ag[n][2] != 0])
897+
end
898+
return graph
899+
end
900+
891901
function exactdiv(a::Integer, b)
892902
d, r = divrem(a, b)
893903
@assert r == 0

0 commit comments

Comments
 (0)