Skip to content

Commit 0c3656b

Browse files
committed
add test
1 parent c923c39 commit 0c3656b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/linalg.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,15 @@ N = ModelingToolkit.nullspace(A)
1818
@test size(N, 2) == 3
1919
@test rank(N) == 3
2020
@test iszero(A * N)
21+
22+
A = [0 1 2 0 1 0;
23+
0 0 0 0 0 1;
24+
0 0 0 0 0 1;
25+
1 0 1 2 0 1;
26+
0 0 0 2 1 0]
27+
col_order = Int[]
28+
N = ModelingToolkit.nullspace(A; col_order)
29+
colspan = A[:,col_order[1:4]] # rank is 4
30+
@test iszero(ModelingToolkit.nullspace(colspan))
31+
@test !iszero(ModelingToolkit.nullspace(A[:,col_order[1:5]]))
32+
@test !iszero(ModelingToolkit.nullspace(A[:,[col_order[1:4]...,col_order[6]]]))

0 commit comments

Comments
 (0)