Skip to content

Commit

Permalink
default alg SparseMatrix CSC issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Nov 27, 2024
1 parent 1ca6628 commit 0acbe41
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/OrdinaryDiffEqDifferentiation/src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ function DiffEqBase.prepare_alg(
sparsity = prob.f.sparsity

if sparsity isa SparseMatrixCSC
if f.mass_matrix isa UniformScaling
if prob.f.mass_matrix isa UniformScaling
idxs = diagind(sparsity)
@. @view(sparsity[idxs]) = 1
else
idxs = findall(!iszero, f.mass_matrix)
@. @view(sparsity[idxs]) = @view(f.mass_matrix[idxs])
idxs = findall(!iszero, prob.f.mass_matrix)
@. @view(sparsity[idxs]) = @view(prob.f.mass_matrix[idxs])
end
end

Expand Down

0 comments on commit 0acbe41

Please sign in to comment.