Skip to content

Commit 1b9e40f

Browse files
committed
define funny overload
1 parent 02718a6 commit 1b9e40f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/factorization.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
function _ldiv!(x, A, b)
2+
# work around https://github.com/JuliaLang/julia/issues/43507
3+
if @which(ldiv!(x,A,b)) == which(ldiv!,Tuple{LU{Float64, Matrix{Float64}},Vector{Float64}})
4+
copyto!(x, b)
5+
ldiv!(A, x)
6+
else
7+
ldiv!(x, A, b)
8+
end
9+
end
10+
11+
112
function SciMLBase.solve(cache::LinearCache, alg::AbstractFactorization; kwargs...)
213
if cache.isfresh
314
fact = do_factorization(alg, cache.A, cache.b, cache.u)
415
cache = set_cacheval(cache, fact)
516
end
6-
7-
copyto!(cache.u,cache.b)
8-
y = ldiv!(cache.u, cache.cacheval, cache.b)
17+
y = _ldiv!(cache.u, cache.cacheval, cache.b)
918
SciMLBase.build_linear_solution(alg,y,nothing,cache)
1019
end
1120

0 commit comments

Comments
 (0)