Skip to content

Commit

Permalink
Tests for multiplications of Hermitian matrices (JuliaLang#38380)
Browse files Browse the repository at this point in the history
  • Loading branch information
achuchmala committed Nov 14, 2020
1 parent e32ae87 commit f3252bf
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions stdlib/LinearAlgebra/test/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -697,4 +697,34 @@ end
end
end

@testset "Dsiambiguation multiplication with transposed AbstractMatrix methods in linalg/matmul.jl for $T and $S" for T in
(Float16, Float32, Float64, BigFloat), S in (ComplexF16, ComplexF32, ComplexF64)
let Ahrs = Transpose(Hermitian(Symmetric(rand(T, 3, 3)))),
Acs = Transpose(Symmetric(rand(S, 3, 3))),
Ahcs = Transpose(Hermitian(Symmetric(rand(S, 3, 3))))

@test Ahrs * Ahrs Ahrs * parent(Ahrs)
@test Ahrs * Acs Ahrs * parent(Acs)
@test Acs * Acs parent(Acs) * parent(Acs)
@test Acs * Ahrs parent(Acs) * Ahrs
@test Ahrs * Ahcs parent(Ahrs) * Ahcs
@test Ahcs * Ahrs Ahcs * parent(Ahrs)
end
end

@testset "Dsiambiguation multiplication with adjointed AbstractMatrix methods in linalg/matmul.jl for $T and $S" for T in
(Float16, Float32, Float64, BigFloat), S in (ComplexF16, ComplexF32, ComplexF64)
let Ahrs = Adjoint(Hermitian(Symmetric(rand(T, 3, 3)))),
Acs = Adjoint(Symmetric(rand(S, 3, 3))),
Ahcs = Adjoint(Hermitian(Symmetric(rand(S, 3, 3))))

@test Ahrs * Ahrs Ahrs * parent(Ahrs)
@test Ahcs * Ahcs parent(Ahcs) * parent(Ahcs)
@test Ahrs * Ahcs Ahrs * parent(Ahcs)
@test Acs * Ahcs Acs * parent(Ahcs)
@test Ahcs * Ahrs parent(Ahcs) * Ahrs
@test Ahcs * Acs parent(Ahcs) * Acs
end
end

end # module TestSymmetric

0 comments on commit f3252bf

Please sign in to comment.