Skip to content

Commit ca43b2e

Browse files
Fix cholesky_instance for symmetric sparse
1 parent 93d728f commit ca43b2e

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ArrayInterface"
22
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
3-
version = "7.4.6"
3+
version = "7.4.7"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/ArrayInterface.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ cheaply.
476476
function cholesky_instance(A::Matrix{T}, pivot = LinearAlgebra.RowMaximum()) where {T}
477477
return cholesky(similar(A, 0, 0), pivot, check = false)
478478
end
479-
function cholesky_instance(A::SparseMatrixCSC, pivot = LinearAlgebra.RowMaximum())
479+
function cholesky_instance(A::Union{SparseMatrixCSC,Symmetric{<:Number,<:SparseMatrixCSC}}, pivot = LinearAlgebra.RowMaximum())
480480
cholesky(sparse(similar(A, 1, 1)), check = false)
481481
end
482482

test/core.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,17 @@ end
267267
@test ArrayInterface.qr_instance(A) isa typeof(qr(A))
268268

269269
if !(eltype(A) <: BigFloat)
270-
@test ArrayInterface.bunchkaufman_instance(A) isa typeof(bunchkaufman(A' * A))
271-
@test ArrayInterface.cholesky_instance(A) isa typeof(cholesky(A' * A))
272-
@test ArrayInterface.ldlt_instance(A) isa typeof(ldlt(SymTridiagonal(A' * A)))
270+
@test ArrayInterface.bunchkaufman_instance(A' * A) isa typeof(bunchkaufman(A' * A))
271+
@test ArrayInterface.cholesky_instance(A' * A) isa typeof(cholesky(A' * A))
272+
@test ArrayInterface.ldlt_instance(SymTridiagonal(A' * A)) isa typeof(ldlt(SymTridiagonal(A' * A)))
273273
@test ArrayInterface.svd_instance(A) isa typeof(svd(A))
274274
end
275275
end
276+
277+
for A in [sparse([1.0 2.0; 3.0 4.0])]
278+
@test ArrayInterface.lu_instance(A) isa typeof(lu(A))
279+
@test ArrayInterface.qr_instance(A) isa typeof(qr(A))
280+
@test ArrayInterface.cholesky_instance(A' * A) isa typeof(cholesky(A' * A))
281+
@test ArrayInterface.ldlt_instance(SymTridiagonal(A' * A)) isa typeof(ldlt(SymTridiagonal(A' * A)))
282+
end
276283
end

0 commit comments

Comments
 (0)