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

Bug: Using custom variables for polynomials #119

Open
harris-mit opened this issue Oct 24, 2022 · 2 comments
Open

Bug: Using custom variables for polynomials #119

harris-mit opened this issue Oct 24, 2022 · 2 comments

Comments

@harris-mit
Copy link

harris-mit commented Oct 24, 2022

The following code used to work in older versions:

using DynamicPolynomials
@polyvar var1 var2
v = randn(3);
_mons = monomials([var1, var2], length(v) - 1);
p = sum(_mons .* v)
p + p
ERROR: AssertionError: issorted(Z, lt = grlex)
Stacktrace:
 [1] MonomialVector{true}(vars::Vector{PolyVar{true}}, Z::Vector{Vector{Int64}})
   @ DynamicPolynomials ~/.julia/packages/DynamicPolynomials/jOoxo/src/monovec.jl:11
 [2] plusorminus(p::Polynomial{true, Float64}, q::Polynomial{true, Float64}, op::Function)
   @ DynamicPolynomials ~/.julia/packages/DynamicPolynomials/jOoxo/src/operators.jl:53
 [3] +(x::Polynomial{true, Float64}, y::Polynomial{true, Float64})
   @ DynamicPolynomials ~/.julia/packages/DynamicPolynomials/jOoxo/src/operators.jl:130
 [4] top-level scope
   @ REPL[33]:1
@harris-mit harris-mit changed the title Using custom variables for polynomials Bug: Using custom variables for polynomials Oct 24, 2022
@harris-mit
Copy link
Author

Should I just delete the offending assertion errors?

@blegat
Copy link
Member

blegat commented Oct 27, 2022

No, the error is expected, things will get worse after the assertion so it's best the program stops there.
See the detailed explanation in https://discourse.julialang.org/t/error-in-dynamicpolynomials/89196/2

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