Open nsajko opened 8 months ago
julia> using DynamicPolynomials julia> import MutableArithmetics julia> const MA = MutableArithmetics MutableArithmetics julia> @polyvar x (x,) julia> MA.operate!(-, 2x, 3x) ^CERROR: InterruptException: Stacktrace: [1] operate! @ MultivariatePolynomials ~/tmp/jl/MultivariatePolynomials.jl/src/operators.jl:303 [inlined] [2] operate! @ MultivariatePolynomials ~/tmp/jl/MultivariatePolynomials.jl/src/operators.jl:97 [inlined] [3] operate! @ MultivariatePolynomials ~/tmp/jl/MultivariatePolynomials.jl/src/operators.jl:303 [inlined] [4] operate!(op::typeof(-), p::Term{Int64, Monomial{DynamicPolynomials.Commutative{…}, Graded{…}}}, α::Term{Term{Term{…}, Monomial{…}}, Monomial{DynamicPolynomials.Commutative{…}, Graded{…}}}) @ MultivariatePolynomials ~/tmp/jl/MultivariatePolynomials.jl/src/operators.jl:97--- the above 4 lines are repeated 54 more times --- Some type information was truncated. Use `show(err)` to see complete types.
related: #167?
These might indeed be related but I think it's different. I guess operate! should mutate the coefficient if the terms have the same monomial and error otherwise. This simply need a new method
operate!