Skip to content

Commit

Permalink
tests for converting QR eltype
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Sep 24, 2021
1 parent b5f3a99 commit e2833ce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions stdlib/LinearAlgebra/test/qr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,15 @@ end
@test A.Q' * B A.Q
end

@testset "convert between eltypes" begin
a = rand(Float64, 10, 5)
qra = qr(a)
@test Array(LinearAlgebra.QRCompactWY{Float32}(qra.factors, qra.T)) Array(qr(Float32.(a)))
qra = qr(a, ColumnNorm())
@test Array(QRPivoted{Float32}(qra.factors, qra.τ, qra.jpvt)) Array(qr(Float32.(a), ColumnNorm()))
a = rand(Float16, 10, 5)
qra = qr(a)
@test Array(QR{ComplexF16}(qra.factors, qra.τ)) Array(qr(ComplexF16.(a)))
end

end # module TestQR

0 comments on commit e2833ce

Please sign in to comment.