Skip to content

Commit ee0ef71

Browse files
committed
Added tests for non-square SMatrix instances
1 parent b88705a commit ee0ef71

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

test/runtests.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Aqua.test_all(NormalForms)
6464
@test Fr.U * M == Fr.H
6565
@test S.U * M * S.V == S.S
6666
end
67-
@testset "SMatrix" begin
67+
@testset "Square SMatrix" begin
6868
M = SMatrix{3,3,Int}([-2 1 1; 2 -1 1; 2 1 -1])
6969
Fr = hnfr(M)
7070
Fc = hnfc(M)
@@ -74,6 +74,18 @@ Aqua.test_all(NormalForms)
7474
@test Fr.U * M == Fr.H
7575
@test S.U * M * S.V == S.S
7676
end
77+
@testset "Non-square SMatrix" begin
78+
M = SMatrix{2,3,Int}([1 -2 3; -4 5 -6])
79+
Fr = hnfr(M)
80+
Fc = hnfc(M)
81+
S = snf(M)
82+
@test hnfr!(collect(M)) == Fr
83+
@test hnfc!(collect(M)) == Fc
84+
@test snf!(collect(M)) == S
85+
@test M * Fc.U == Fc.H
86+
@test Fr.U * M == Fr.H
87+
@test S.U * M * S.V == S.S
88+
end
7789
@testset "Transposes" begin
7890
M = [-2 1 1; 2 -1 1; 2 1 -1]
7991
Hrt = hnfr(transpose(M))

0 commit comments

Comments
 (0)