-
-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Description
mutable struct LUFactorize{T}
A::LU{T,Matrix{T}}
end
LUFactorize() = LUFactorize(lu(rand(1,1)))
function (p::LUFactorize)(x,A,b,update_matrix=false;kwargs...)
if ArrayInterface.can_setindex(x) && (size(A,1) <= 100 || ((blasvendor === :openblas || blasvendor === :openblas64) && size(A,1) <= 500))
p.A = RecursiveFactorization.lu!(A)
else
p.A = lu!(A)
end
ldiv!(x,p.A,b)
end
function (p::LUFactorize)(::Type{Val{:init}},f,u0_prototype)
LUFactorize(lu(rand(eltype(u0_prototype),1,1)))
end
Base.resize!(p::LUFactorize,i) = p.A = nothing
@btime solve(prob,Rodas5(linsolve=LUFactorize()),reltol=1.0e-8,abstol=1.0e-8, saveat = 1000)
Metadata
Metadata
Assignees
Labels
No labels