Skip to content

Commit 3c3fe1a

Browse files
committed
Update index reduction
1 parent 63c084d commit 3c3fe1a

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

test/structural_transformation/index_reduction.jl

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pendulum = ODESystem(eqs, t, [x, y, w, z, T], [L, g], name=:pendulum)
3434
pendulum = initialize_system_structure(pendulum)
3535
sss = structure(pendulum)
3636
@unpack graph, fullvars, varassoc = sss
37-
@test StructuralTransformations.matching(sss, varassoc .== 0) == map(x -> x == 0 ? StructuralTransformations.UNASSIGNED : x, [0, 0, 0, 0, 1, 2, 3, 4, 0])
37+
@test StructuralTransformations.matching(sss, varassoc .== 0) == map(x -> x == 0 ? StructuralTransformations.UNASSIGNED : x, [1, 0, 2, 0, 3, 4, 0, 0, 0])
3838

3939
sys, assign, eqassoc = StructuralTransformations.pantelides!(pendulum)
4040
sss = structure(sys)
@@ -49,19 +49,17 @@ scc = StructuralTransformations.find_scc(graph, assign)
4949
]
5050

5151
@test graph.fadjlist == sort.([
52-
[5, 3], # 1
53-
[6, 4], # 2
54-
[7, 9, 1], # 3
55-
[8, 9, 2], # 4
56-
[2, 1], # 5
57-
[2, 1, 6, 5], # 6
58-
[5, 3, 10, 7], # 7
59-
[6, 4, 11, 8], # 8
60-
[2, 1, 6, 5, 11, 10], # 9
52+
[1, 2],
53+
[3, 4],
54+
[5, 6, 7],
55+
[6, 8, 9],
56+
[7, 9],
57+
[1, 3, 7, 9],
58+
[1, 2, 5, 10],
59+
[3, 4, 8, 11],
60+
[1, 3, 7, 9, 10, 11],
6161
])
62-
# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
63-
# [x, y, w, z, xˍt, yˍt, w', z', T, xˍt', yˍt']
64-
@test varassoc == [5, 6, 7, 8, 10, 11, 0, 0, 0, 0, 0]
62+
@test varassoc == [10, 5, 11, 8, 0, 0, 1, 0, 3, 0, 0]
6563
#1: D(x) ~ w
6664
#2: D(y) ~ z
6765
#3: D(w) ~ T*x

0 commit comments

Comments
 (0)