Skip to content

Commit 1a567fe

Browse files
committed
Fix mapexponents! with different variables
1 parent 50bb63d commit 1a567fe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/cmult.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function MP.mapexponents_to!(output::Monomial{true}, f::Function, x::Monomial{tr
114114
return output
115115
end
116116
function MP.mapexponents!(f::Function, x::Monomial{true}, y::Monomial{true})
117-
multdivmono!(x.z, x.vars, x.vars, y, f, x.z)
117+
multdivmono!(x.z, x.vars, copy(x.vars), y, f, x.z)
118118
return x
119119
end
120120
function MP.mapexponents(f::Function, x::Monomial{true}, y::Monomial{true})

test/mono.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,7 @@
133133
@test (x^2)(3) == 9
134134
@test (x)(3) == 3
135135
end
136+
@testset "TODO remove when added to MP" begin
137+
@test x == DynamicPolynomials.MP.mapexponents!(div, x^1, x * y^2)
138+
end
136139
end

0 commit comments

Comments
 (0)