Skip to content

Commit 0dce997

Browse files
committed
Define term(coef, mono)
1 parent 31f0511 commit 0dce997

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/mult.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ end
2828
include("cmult.jl")
2929
include("ncmult.jl")
3030

31-
MP.multconstant(α, x::Monomial) = Term(α, MA.mutable_copy(x))
31+
MP.multconstant(α, x::Monomial) = MP.term(α, MA.mutable_copy(x))
3232
MP.mapcoefficientsnz(f::Function, p::Polynomial) = Polynomial(map(f, p.a), MA.mutable_copy(p.x))
3333
function MP.mapcoefficientsnz_to!(output::Polynomial, f::Function, t::MP.AbstractTermLike)
3434
MP.mapcoefficientsnz_to!(output, f, polynomial(t))

src/term.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ struct Term{C, T} <: AbstractTerm{T}
44
α::T
55
x::Monomial{C}
66
end
7+
MP.term(α, mono::Monomial) = Term(α, mono)
78

89
iscomm(::Type{Term{C, T}}) where {C, T} = C
910

0 commit comments

Comments
 (0)