Skip to content

Commit e2833ce

Browse files
committed
tests for converting QR eltype
1 parent b5f3a99 commit e2833ce

File tree

1 file changed

+11
-0
lines changed
  • stdlib/LinearAlgebra/test

1 file changed

+11
-0
lines changed

stdlib/LinearAlgebra/test/qr.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,4 +415,15 @@ end
415415
@test A.Q' * B A.Q
416416
end
417417

418+
@testset "convert between eltypes" begin
419+
a = rand(Float64, 10, 5)
420+
qra = qr(a)
421+
@test Array(LinearAlgebra.QRCompactWY{Float32}(qra.factors, qra.T)) Array(qr(Float32.(a)))
422+
qra = qr(a, ColumnNorm())
423+
@test Array(QRPivoted{Float32}(qra.factors, qra.τ, qra.jpvt)) Array(qr(Float32.(a), ColumnNorm()))
424+
a = rand(Float16, 10, 5)
425+
qra = qr(a)
426+
@test Array(QR{ComplexF16}(qra.factors, qra.τ)) Array(qr(ComplexF16.(a)))
427+
end
428+
418429
end # module TestQR

0 commit comments

Comments
 (0)