Skip to content

Commit 172550a

Browse files
authored
Merge pull request #10 from JuliaAlgebra/bl/dot
Use dot syntax
2 parents f830054 + 15d8dc9 commit 172550a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/mult.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ include("cmult.jl")
3030
include("ncmult.jl")
3131

3232
MP.multconstant(α, x::Monomial) = Term(α, x)
33-
MP.multconstant(α, p::Polynomial) = Polynomial*p.a, p.x)
34-
MP.multconstant(p::Polynomial, α) = Polynomial(p.a*α, p.x)
33+
MP.mapcoefficientsnz(f::Function, p::Polynomial) = Polynomial(f.(p.a), p.x)
3534

3635
# I do not want to cast x to TermContainer because that would force the promotion of eltype(q) with Int
3736
function *(x::DMonomialLike, p::Polynomial)
@@ -62,7 +61,7 @@ function _term_poly_mult(t::Term{C, S}, p::Polynomial{C, T}, op::Function) where
6261
Z[i][maps[1]] = t.x.z
6362
Z[i][maps[2]] += p.x.Z[i]
6463
end
65-
Polynomial(op(t.α, p.a), MonomialVector(allvars, Z))
64+
Polynomial(op.(t.α, p.a), MonomialVector(allvars, Z))
6665
end
6766
end
6867
*(p::Polynomial, t::Term) = _term_poly_mult(t, p, (α, β) -> β * α)

0 commit comments

Comments
 (0)