Skip to content

Commit 40e97cb

Browse files
araujomsKristofferC
authored andcommitted
add test for Quaternions
1 parent 47e0a03 commit 40e97cb

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

test/generic.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,31 @@ end
123123
@test_throws DimensionMismatch axpy!(α, x, Vector(1:3), y, Vector(1:5))
124124
end
125125

126+
@testset "generic syrk & herk" begin
127+
for T (BigFloat, Complex{BigFloat}, Quaternion{Float64})
128+
α = randn(T)
129+
a = randn(T, 3, 4)
130+
csmall = similar(a, 3, 3)
131+
csmall_fallback = similar(a, 3, 3)
132+
cbig = similar(a, 4, 4)
133+
cbig_fallback = similar(a, 4, 4)
134+
mul!(csmall, a, a', real(α), false)
135+
LinearAlgebra._generic_matmatmul!(csmall_fallback, a, a', real(α), false)
136+
@test ishermitian(csmall)
137+
@test csmall csmall_fallback
138+
mul!(cbig, a', a, real(α), false)
139+
LinearAlgebra._generic_matmatmul!(cbig_fallback, a', a, real(α), false)
140+
@test ishermitian(cbig)
141+
@test cbig cbig_fallback
142+
mul!(csmall, a, transpose(a), α, false)
143+
LinearAlgebra._generic_matmatmul!(csmall_fallback, a, transpose(a), α, false)
144+
@test csmall csmall_fallback
145+
mul!(cbig, transpose(a), a, α, false)
146+
LinearAlgebra._generic_matmatmul!(cbig_fallback, transpose(a), a, α, false)
147+
@test cbig cbig_fallback
148+
end
149+
end
150+
126151
@test !issymmetric(fill(1,5,3))
127152
@test !ishermitian(fill(1,5,3))
128153
@test (x = fill(1,3); cross(x,x) == zeros(3))

test/matmul.jl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -537,22 +537,6 @@ end
537537
@test_throws DimensionMismatch LinearAlgebra.herk_wrapper!(A5x5, 'N', A6x5)
538538
end
539539

540-
@testset "generic syrk & herk" begin
541-
for T (BigFloat, Complex{BigFloat})
542-
a = randn(T, 3, 4)
543-
csmall = similar(a, 3, 3)
544-
cbig = similar(a, 4, 4)
545-
LinearAlgebra._generic_matmatmul!(csmall, a, a', true, false)
546-
@test csmall a * a'
547-
LinearAlgebra._generic_matmatmul!(csmall, a, transpose(a), true, false)
548-
@test csmall a * transpose(a)
549-
LinearAlgebra._generic_matmatmul!(cbig, a', a, true, false)
550-
@test cbig a' * a
551-
LinearAlgebra._generic_matmatmul!(cbig, transpose(a), a, true, false)
552-
@test cbig transpose(a) * a
553-
end
554-
end
555-
556540
@testset "matmul for types w/o sizeof (issue #1282)" begin
557541
AA = fill(complex(1, 1), 10, 10)
558542
for A in (copy(AA), view(AA, 1:10, 1:10))

0 commit comments

Comments
 (0)