Skip to content

Commit

Permalink
Update LinearAlgebra QR tests so that MKL.jl tests pass on the Linear…
Browse files Browse the repository at this point in the history
…Algebra test suite. (JuliaLang#43585)
  • Loading branch information
ViralBShah committed Dec 30, 2021
1 parent ab4e036 commit 27eb721
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions stdlib/LinearAlgebra/test/qr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,21 +432,22 @@ end
@test eltype(qrnonblas.factors) == eltype(qrnonblas.τ) == ComplexF16
end

# We use approximate equals to get MKL.jl tests to pass.
@testset "optimized getindex for an AbstractQ" begin
for T in [Float64, ComplexF64]
Q = qr(rand(T, 4, 4))
Q2 = Q.Q
M = Matrix(Q2)
for j in axes(M, 2)
@test Q2[:, j] == M[:, j]
@test Q2[:, j] M[:, j]
for i in axes(M, 1)
@test Q2[i, :] == M[i, :]
@test Q2[i, j] == M[i, j]
@test Q2[i, :] M[i, :]
@test Q2[i, j] M[i, j]
end
end
@test Q2[:] == M[:]
@test Q2[:, :] == M[:, :]
@test Q2[:, :, :] == M[:, :, :]
@test Q2[:] M[:]
@test Q2[:, :] M[:, :]
@test Q2[:, :, :] M[:, :, :]
end
end

Expand Down

0 comments on commit 27eb721

Please sign in to comment.