Skip to content

Commit

Permalink
use sparse for lu_instance
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Nov 27, 2024
1 parent 0acbe41 commit 07e9ffd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using DiffEqBase
import LinearAlgebra
import LinearAlgebra: Diagonal, I, UniformScaling, diagind, mul!, lmul!, axpby!, opnorm, lu
import LinearAlgebra: LowerTriangular, UpperTriangular
import SparseArrays: SparseMatrixCSC, AbstractSparseMatrix, nonzeros
import SparseArrays: SparseMatrixCSC, AbstractSparseMatrix, nonzeros, sparse
import ArrayInterface

import StaticArrayInterface
Expand Down
6 changes: 5 additions & 1 deletion lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,11 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, ::Type{uEltypeNoUnits},
elseif J isa StaticMatrix
StaticWOperator(J, false)
else
ArrayInterface.lu_instance(J)
if alg.autodiff isa AutoSparse
ArrayInterface.lu_instance(sparse(J))
else
ArrayInterface.lu_instance(J)
end
end
end
return J, W
Expand Down

0 comments on commit 07e9ffd

Please sign in to comment.