Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jun 14, 2024
1 parent 3752bde commit 7679454
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/arithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,8 @@ function unsafe_push!(a::SparseArrays.SparseVector, k, v)
a[k] = MA.add!!(a[k], v)
return a
end

function unsafe_push!(a::Vector, k, v)
a[k] = MA.add!!(a[k], v)
return a
end
4 changes: 4 additions & 0 deletions test/test_example_acoeffs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ end
# the default arithmetic implementation uses this access
Base.getindex(ac::ACoeffs, idx) = ac.vals[idx]
Base.setindex!(ac::ACoeffs, val, idx) = ac.vals[idx] = val
function SA.unsafe_push!(ac::ACoeffs, idx, val)
ac.vals[idx] = val
return ac
end

0 comments on commit 7679454

Please sign in to comment.