Skip to content

Commit 0c2ff4a

Browse files
Split SPQR
1 parent 5b1fe9e commit 0c2ff4a

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

ext/LinearSolveSparseArraysExt.jl

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,13 @@ const PREALLOCATED_UMFPACK = SparseArrays.UMFPACK.UmfpackLU(SparseMatrixCSC(0, 0
7272
Int[], Float64[]))
7373

7474
function LinearSolve.init_cacheval(
75-
alg::Union{LUFactorization, QRFactorization, GenericLUFactorization}, A::AbstractSparseArray{<:Number, <:Integer}, b, u,
75+
alg::Union{LUFactorization, GenericLUFactorization}, A::AbstractSparseArray{<:Number, <:Integer}, b, u,
7676
Pl, Pr,
7777
maxiters::Int, abstol, reltol,
7878
verbose::Bool, assumptions::OperatorAssumptions)
7979
nothing
8080
end
8181

82-
function init_cacheval(alg::QRFactorization, A::SparseMatrixCSC{Float64, Int}, b, u, Pl, Pr,
83-
maxiters::Int, abstol, reltol, verbose::Bool,
84-
assumptions::OperatorAssumptions)
85-
ArrayInterface.qr_instance(convert(AbstractMatrix, A), alg.pivot)
86-
end
87-
8882
function LinearSolve.init_cacheval(
8983
alg::UMFPACKFactorization, A::AbstractArray, b, u,
9084
Pl, Pr,
@@ -259,6 +253,21 @@ function LinearSolve.defaultalg(
259253
end
260254
end
261255

256+
# SPQR Handling
257+
function LinearSolve.init_cacheval(
258+
alg::Union{QRFactorization}, A::AbstractSparseArray{<:Number, <:Integer}, b, u,
259+
Pl, Pr,
260+
maxiters::Int, abstol, reltol,
261+
verbose::Bool, assumptions::OperatorAssumptions)
262+
nothing
263+
end
264+
265+
function init_cacheval(alg::QRFactorization, A::SparseMatrixCSC{Float64, Int}, b, u, Pl, Pr,
266+
maxiters::Int, abstol, reltol, verbose::Bool,
267+
assumptions::OperatorAssumptions)
268+
ArrayInterface.qr_instance(convert(AbstractMatrix, A), alg.pivot)
269+
end
270+
262271
LinearSolve.PrecompileTools.@compile_workload begin
263272
A = sprand(4, 4, 0.3) + I
264273
b = rand(4)

0 commit comments

Comments
 (0)