Skip to content

Commit ce86b9d

Browse files
committed
add test for Quaternions
1 parent f57b936 commit ce86b9d

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
@@ -529,22 +529,6 @@ end
529529
@test_throws DimensionMismatch LinearAlgebra.herk_wrapper!(A5x5, 'N', A6x5)
530530
end
531531

532-
@testset "generic syrk & herk" begin
533-
for T (BigFloat, Complex{BigFloat})
534-
a = randn(T, 3, 4)
535-
csmall = similar(a, 3, 3)
536-
cbig = similar(a, 4, 4)
537-
LinearAlgebra._generic_matmatmul!(csmall, a, a', true, false)
538-
@test csmall a * a'
539-
LinearAlgebra._generic_matmatmul!(csmall, a, transpose(a), true, false)
540-
@test csmall a * transpose(a)
541-
LinearAlgebra._generic_matmatmul!(cbig, a', a, true, false)
542-
@test cbig a' * a
543-
LinearAlgebra._generic_matmatmul!(cbig, transpose(a), a, true, false)
544-
@test cbig transpose(a) * a
545-
end
546-
end
547-
548532
@testset "matmul for types w/o sizeof (issue #1282)" begin
549533
AA = fill(complex(1, 1), 10, 10)
550534
for A in (copy(AA), view(AA, 1:10, 1:10))

0 commit comments

Comments
 (0)