Skip to content

Commit f3e62ee

Browse files
Merge pull request #81 from simonbyrne/patch-1
Use 3-arg `ldiv!`
2 parents 3e6cfee + c61b014 commit f3e62ee

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/factorization.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
_ldiv!(x, A, b) = ldiv!(x, A, b)
2+
function _ldiv!(x::Vector, A::Factorization, b::Vector)
3+
# workaround https://github.com/JuliaLang/julia/issues/43507
4+
copyto!(x, b)
5+
ldiv!(A, x)
6+
end
7+
8+
19
function SciMLBase.solve(cache::LinearCache, alg::AbstractFactorization; kwargs...)
210
if cache.isfresh
311
fact = do_factorization(alg, cache.A, cache.b, cache.u)
412
cache = set_cacheval(cache, fact)
513
end
6-
7-
copyto!(cache.u,cache.b)
8-
y = ldiv!(cache.cacheval, cache.u)
14+
y = _ldiv!(cache.u, cache.cacheval, cache.b)
915
SciMLBase.build_linear_solution(alg,y,nothing,cache)
1016
end
1117

0 commit comments

Comments
 (0)