Skip to content

Commit 1f1dab2

Browse files
authored
Fix mapexponents_to! with same variables (#106)
1 parent e586c0d commit 1f1dab2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/cmult.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function MP.mapexponents_to!(output::Monomial{true}, f::Function, x::Monomial{tr
111111
copyto!(output.vars, x.vars)
112112
resize!(output.z, n)
113113
end
114-
_operate_exponents_to!(x.z, f, x.z, y.z)
114+
_operate_exponents_to!(output.z, f, x.z, y.z)
115115
else
116116
_multdivmono!(output.z, output.vars, x.vars, y, f, x.z)
117117
end

test/mono.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Test
2+
13
@testset "PolyVar and Monomial tests" begin
24
@testset "PolyVar macro index set" begin
35
n = 3
@@ -136,5 +138,8 @@
136138
@testset "TODO remove when added to MP" begin
137139
@polyvar x y
138140
@test x == DynamicPolynomials.MP.mapexponents!(div, x^1, x * y^2)
141+
for z in [x * y, x^2, y^2]
142+
@test y == DynamicPolynomials.MP.mapexponents_to!(z, -, x * y^2, x * y)
143+
end
139144
end
140145
end

0 commit comments

Comments
 (0)