Skip to content

Commit f2e5d5a

Browse files
Fix BigFloat QR instance and test better
Found in https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/4527032588/jobs/8065045759#step:6:517 that there's a special case to consider here. Now it's better tested.
1 parent ba02e0c commit f2e5d5a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/ArrayInterface.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,10 @@ function qr_instance(A::Matrix{T}) where {T}
576576
LinearAlgebra.QRCompactWYQ(zeros(T,0,0),zeros(T,0,0))
577577
end
578578

579+
function qr_instance(A::Matrix{BigFloat})
580+
LinearAlgebra.QR(zeros(BigFloat,0,0),zeros(BigFloat,0))
581+
end
582+
579583
# Could be optimized but this should work for any real case.
580584
function qr_instance(jac_prototype::SparseMatrixCSC)
581585
qr(sparse(rand(1,1)))

test/core.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,13 @@ end
259259
@test !ArrayInterface.ensures_sorted([])
260260
@test ArrayInterface.ensures_sorted(1:10)
261261
end
262+
263+
@testset "linearalgebra instances" being
264+
for A in [rand(2,2), rand(Float32,2,2), rand(BigFloat,2,2)]
265+
@test ArrayInterface.bunchkaufman_instance(A) isa typeof(bunchkaufman(A' * A))
266+
@test ArrayInterface.cholesky_instance(A) isa typeof(cholesky(A' * A))
267+
@test ArrayInterface.ldlt_instance(A) isa typeof(ldlt(SymTridiagonal(A' * A)))
268+
@test ArrayInterface.lu_instance(A) isa typeof(lu(A))
269+
@test ArrayInterface.qr_instance(A) isa typeof(qr(A))
270+
end
271+
end

0 commit comments

Comments
 (0)