File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -635,6 +635,7 @@ function trivial_tearing!(ts::TearingState)
635
635
matched_vars = BitSet ()
636
636
# variable to index in fullvars
637
637
var_to_idx = Dict {Any, Int} (ts. fullvars .=> eachindex (ts. fullvars))
638
+ sys_eqs = equations (ts)
638
639
639
640
complete! (ts. structure)
640
641
var_to_diff = ts. structure. var_to_diff
@@ -654,6 +655,14 @@ function trivial_tearing!(ts::TearingState)
654
655
push! (blacklist, i)
655
656
continue
656
657
end
658
+ # Edge case for `var ~ var` equations. They don't show up in the incidence
659
+ # graph because `TearingState` makes them `0 ~ 0`, but they do cause `var`
660
+ # to show up twice in `original_eqs` which fails the assertion.
661
+ sys_eq = sys_eqs[i]
662
+ if isequal (sys_eq. lhs, 0 ) && isequal (sys_eq. rhs, 0 )
663
+ continue
664
+ end
665
+
657
666
# if a variable was the LHS of two trivial observed equations, we wouldn't have
658
667
# included it in the list. Error if somehow it made it through.
659
668
@assert ! (vari in matched_vars)
You can’t perform that action at this time.
0 commit comments