Skip to content

Commit

Permalink
Implement map_coefficients for term
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed May 2, 2024
1 parent b6da6a1 commit 0348d87
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/default_term.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ function convert_constant(::Type{Term{C,M} where C}, α) where {M}
return convert(Term{typeof(α),M}, α)
end

function map_coefficients!(f::F, t::Term; nonzero = false) where {F<:Function}
t.coefficient = f(t.coefficient)
return t
end

function Base.promote_rule(
::Type{Term{C,M1} where {C}},
M2::Type{<:AbstractMonomialLike},
Expand Down

0 comments on commit 0348d87

Please sign in to comment.