Skip to content

Commit

Permalink
Merge pull request #81 from simonbyrne/patch-1
Browse files Browse the repository at this point in the history
Use 3-arg `ldiv!`
  • Loading branch information
ChrisRackauckas authored Dec 22, 2021
2 parents 3e6cfee + c61b014 commit f3e62ee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/factorization.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
_ldiv!(x, A, b) = ldiv!(x, A, b)
function _ldiv!(x::Vector, A::Factorization, b::Vector)
# workaround https://github.com/JuliaLang/julia/issues/43507
copyto!(x, b)
ldiv!(A, x)
end


function SciMLBase.solve(cache::LinearCache, alg::AbstractFactorization; kwargs...)
if cache.isfresh
fact = do_factorization(alg, cache.A, cache.b, cache.u)
cache = set_cacheval(cache, fact)
end

copyto!(cache.u,cache.b)
y = ldiv!(cache.cacheval, cache.u)
y = _ldiv!(cache.u, cache.cacheval, cache.b)
SciMLBase.build_linear_solution(alg,y,nothing,cache)
end

Expand Down

0 comments on commit f3e62ee

Please sign in to comment.