File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
stdlib/LinearAlgebra/test Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 415415 @test A. Q' * B ≈ A. Q
416416end
417417
418+ @testset " convert between eltypes" begin
419+ a = rand (Float64, 10 , 5 )
420+ qra = qr (a)
421+ qrwy = LinearAlgebra. QRCompactWY {Float32} (qra. factors, qra. T)
422+ @test Array (qrwy) ≈ Array (qr (Float32 .(a)))
423+ @test eltype (qrwy. factors) == eltype (qrwy. T) == Float32
424+ qra = qr (a, ColumnNorm ())
425+ qrp = QRPivoted {Float32} (qra. factors, qra. τ, qra. jpvt)
426+ @test Array (qrp) ≈ Array (qr (Float32 .(a), ColumnNorm ()))
427+ @test eltype (qrp. factors) == eltype (qrp. τ) == Float32
428+ a = rand (Float16, 10 , 5 )
429+ qra = qr (a)
430+ qrnonblas = QR {ComplexF16} (qra. factors, qra. τ)
431+ @test Array (qrnonblas) ≈ Array (qr (ComplexF16 .(a)))
432+ @test eltype (qrnonblas. factors) == eltype (qrnonblas. τ) == ComplexF16
433+ end
434+
418435end # module TestQR
You can’t perform that action at this time.
0 commit comments