Skip to content

Commit 15d1289

Browse files
authored
Merge pull request #115 from JuliaAlgebra/bl/unary_prod
Implement unary product
2 parents 0adb690 + 7366407 commit 15d1289

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/operators.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Base.:-(m::AbstractMonomialLike) = (-1) * m
4545
Base.:-(t::AbstractTermLike) = (-coefficient(t)) * monomial(t)
4646
Base.:-(p::APL) = polynomial((-).(terms(p)))
4747
Base.:+(p::Union{APL, RationalPoly}) = p
48+
Base.:*(p::Union{APL, RationalPoly}) = p
4849

4950
# Avoid adding a zero constant that might artificially increase the Newton polytope
5051
# Need to add polynomial conversion for type stability

test/polynomial.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const MP = MultivariatePolynomials
4242
Mod.@polyvar y
4343

4444
p = 3x^2*y^4 + 2x
45+
@test +(p) === p
46+
@test *(p) === p
4547
@test terms(p)[end] == 2x
4648
typetests(p)
4749
typetests([p, x + y])

0 commit comments

Comments
 (0)