Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MA.operate!(-, term0, term1) recurs infinitely #284

Open
nsajko opened this issue Nov 26, 2023 · 2 comments
Open

MA.operate!(-, term0, term1) recurs infinitely #284

nsajko opened this issue Nov 26, 2023 · 2 comments

Comments

@nsajko
Copy link
Contributor

nsajko commented Nov 26, 2023

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.
@nsajko
Copy link
Contributor Author

nsajko commented Nov 26, 2023

related: #167?

@blegat
Copy link
Member

blegat commented Nov 28, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants