Skip to content

Commit

Permalink
Add tests for issue #28869. (#44291)
Browse files Browse the repository at this point in the history
for the issue (and a trivial typo fix).
  • Loading branch information
tpapp committed Feb 21, 2022
1 parent 0b48b91 commit d75eea1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion stdlib/LinearAlgebra/test/triangular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ for elty1 in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFlo
@test A1 + A2 == Matrix(A1) + Matrix(A2)
@test A1 - A2 == Matrix(A1) - Matrix(A2)

# Triangular-Triangualar multiplication and division
# Triangular-Triangular multiplication and division
@test A1*A2 Matrix(A1)*Matrix(A2)
@test transpose(A1)*A2 transpose(Matrix(A1))*Matrix(A2)
@test transpose(A1)*adjoint(A2) transpose(Matrix(A1))*adjoint(Matrix(A2))
Expand Down Expand Up @@ -825,4 +825,15 @@ end
test_one_oneunit_triangular(c)
end

@testset "LowerTriangular(Diagonal(...)) and friends (issue #28869)" begin
for elty in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat}, Int)
V = elty Int ? rand(1:10, 5) : elty.(randn(5))
D = Diagonal(V)
for dty in (UpperTriangular, LowerTriangular)
A = dty(D)
@test A * A' == D * D'
end
end
end

end # module TestTriangular

0 comments on commit d75eea1

Please sign in to comment.