Skip to content

Commit 8259a1d

Browse files
Merge pull request #336 from SciML/qrpivot
Fix QR initializations with pivoting
2 parents 19cfb42 + acdc581 commit 8259a1d

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
2727
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
2828

2929
[compat]
30-
ArrayInterface = "7.4.7"
30+
ArrayInterface = "7.4.11"
3131
DocStringExtensions = "0.8, 0.9"
3232
EnumX = "1"
3333
FastLapackInterface = "1"

src/factorization.jl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,24 @@ end
171171
function init_cacheval(alg::QRFactorization, A, b, u, Pl, Pr,
172172
maxiters::Int, abstol, reltol, verbose::Bool,
173173
assumptions::OperatorAssumptions)
174-
ArrayInterface.qr_instance(convert(AbstractMatrix, A))
174+
ArrayInterface.qr_instance(convert(AbstractMatrix, A), alg.pivot)
175175
end
176176

177177
const PREALLOCATED_QR = ArrayInterface.qr_instance(rand(1, 1))
178178

179-
function init_cacheval(alg::QRFactorization, A::Matrix{Float64}, b, u, Pl, Pr,
180-
maxiters::Int, abstol, reltol, verbose::Bool,
181-
assumptions::OperatorAssumptions)
182-
PREALLOCATED_QR
179+
@static if VERSION < v"1.7beta"
180+
function init_cacheval(alg::QRFactorization{Val{false}}, A::Matrix{Float64}, b, u, Pl,
181+
Pr,
182+
maxiters::Int, abstol, reltol, verbose::Bool,
183+
assumptions::OperatorAssumptions)
184+
PREALLOCATED_QR
185+
end
186+
else
187+
function init_cacheval(alg::QRFactorization{NoPivot}, A::Matrix{Float64}, b, u, Pl, Pr,
188+
maxiters::Int, abstol, reltol, verbose::Bool,
189+
assumptions::OperatorAssumptions)
190+
PREALLOCATED_QR
191+
end
183192
end
184193

185194
function init_cacheval(alg::QRFactorization, A::AbstractSciMLOperator, b, u, Pl, Pr,

0 commit comments

Comments
 (0)