Skip to content

Commit b6db6b1

Browse files
committed
small unit test fixes
1 parent 2984203 commit b6db6b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/unit_tests/matrix_helpers.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ m = 5
1414
# commutation matrix multiplication
1515
K = CommutationMatrix(n)
1616
B = rand(n, n)
17+
@test_throws DimensionMismatch K * rand(n, m)
1718
@test K * vec(B) == vec(B')
1819
C = sprand(n, n, 0.5)
1920
@test K * vec(C) == vec(C')
@@ -27,10 +28,12 @@ end
2728
@testset "Duplication / elimination matrix" begin
2829
A = rand(m, m)
2930
A = A * A'
31+
3032
# dupication
3133
D = duplication_matrix(m)
3234
@test D * A[tril(trues(size(A)))] == vec(A)
35+
3336
# elimination
34-
D = elimination_matrix(m)
35-
@test D * vec(A) == A[tril(trues(size(A)))]
37+
E = elimination_matrix(m)
38+
@test E * vec(A) == A[tril(trues(size(A)))]
3639
end

0 commit comments

Comments
 (0)