Skip to content

Commit 4e0a46d

Browse files
extra robustness in fallbacks
1 parent a84c420 commit 4e0a46d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LinearSolve"
22
uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
33
authors = ["SciML"]
4-
version = "1.8.1"
4+
version = "1.8.2"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/factorization.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,24 @@ function init_cacheval(alg::Union{QRFactorization,SVDFactorization,GenericFactor
223223
end
224224

225225
# Ambiguity handling dispatch
226-
function init_cacheval(alg::Union{QRFactorization,SVDFactorization,GenericFactorization}, A::StridedMatrix{<:LinearAlgebra.BlasFloat}, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
226+
function init_cacheval(alg::Union{QRFactorization,SVDFactorization}, A::StridedMatrix{<:LinearAlgebra.BlasFloat}, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
227227
newA = copy(convert(AbstractMatrix,A))
228228
fill!(newA,true)
229229
do_factorization(alg, newA, b, u)
230230
end
231231

232+
# Cholesky needs the posdef matrix, for GenericFactorization assume structure is needed
233+
function init_cacheval(alg::Union{GenericFactorization,GenericFactorization{typeof(cholesky)},GenericFactorization{typeof(cholesky!)}}, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
234+
newA = copy(convert(AbstractMatrix,A))
235+
do_factorization(alg, newA, b, u)
236+
end
237+
238+
# Ambiguity handling dispatch
239+
function init_cacheval(alg::Union{GenericFactorization,GenericFactorization{typeof(cholesky)},GenericFactorization{typeof(cholesky!)}}, A::StridedMatrix{<:LinearAlgebra.BlasFloat}, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
240+
newA = copy(convert(AbstractMatrix,A))
241+
do_factorization(alg, newA, b, u)
242+
end
243+
232244
## RFLUFactorization
233245

234246
struct RFWrapper{P,T}

0 commit comments

Comments
 (0)