From 0348d870bdd209b81cdc127cc5a6fc741b03adbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Thu, 2 May 2024 17:17:12 +0200 Subject: [PATCH] Implement map_coefficients for term --- src/default_term.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/default_term.jl b/src/default_term.jl index 7a91d5ad..0a8b3203 100644 --- a/src/default_term.jl +++ b/src/default_term.jl @@ -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},