Skip to content

Commit 12707da

Browse files
odowamontoison
andauthored
Update src/Nonlinear/ReverseAD/Coloring/Coloring.jl
Co-authored-by: Alexis Montoison <[email protected]>
1 parent 334b1b2 commit 12707da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Nonlinear/ReverseAD/Coloring/Coloring.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ function _grow_star(v, w, e_idx, firstNeighbor, color, S)
171171
@inbounds if p != v
172172
firstNeighbor[color[w]] = _Edge(e_idx, v, w)
173173
else
174-
_union!(S, e_idx, e.index)
174+
root1 = _find_root!(S, e_idx)
175+
root2 = _find_root!(S, e.index)
176+
_root_union!(S, root1, root2)
175177
end
176178
return
177179
end

0 commit comments

Comments
 (0)