Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for issue #28869. #44291

Merged
merged 1 commit into from
Feb 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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