Skip to content

Commit 21faed2

Browse files
feat: lexicographically sort equations in structural_simplify
1 parent d5f3dc1 commit 21faed2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/systems/systemstructure.jl

+4
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ function TearingState(sys; quick_cancel = false, check = true)
352352
end
353353
end
354354

355+
# sort equations lexicographically to reduce simplification issues
356+
# depending on order due to NP-completeness of tearing.
357+
sort!(eqs, by = string)
358+
355359
### Handle discrete variables
356360
lowest_shift = Dict()
357361
for var in fullvars

0 commit comments

Comments
 (0)