Skip to content

Commit

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

function unsafe_push!(a::AlgebraElement, k, v)
unsafe_push!(coeffs(a), basis(a)[k], v)
return a
end
6 changes: 6 additions & 0 deletions test/monoid_algebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@

@test @allocated(MA.operate_to!(d, *, a, 2)) == 0
@test d == 2a

MA.operate!(zero, d)
MA.operate!(SA.UnsafeAddMul(*), d, a, b, b)
MA.operate!(SA.canonical, SA.coeffs(d))
@test a * b^2 == *(a, b, b)
@test d == *(a, b, b)
end
end
end

0 comments on commit 5952d72

Please sign in to comment.