In pre-0.5 versions, monomial vectors were ordered decreasingly. Accordingly, the documentation for monovec states:
Returns the vector of monomials X in decreasing order and without any duplicates.
Calling monomial_vector on [xy, x, xy, x^2y, x] should return [x^2y, xy, x].
This was true:
julia> using DynamicPolynomials
julia> @polyvar x y;
julia> mv = monovec([x*y, x, x*y, x^2*y, x])
3-element MonomialVector{true}:
x²y
xy
x
julia> mv[1] > mv[2] > mv[3]
true
For 0.5, the documentation is unchanged. However, now the vector is sorted in increasing order:
julia> using DynamicPolynomials
julia> @polyvar x y;
julia> mv = monovec([x*y, x, x*y, x^2*y, x])
3-element MonomialVector{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}}:
x
xy
x²y
julia> mv[1] < mv[2] < mv[3]
true
Same happens for TypedPolynomials. So I guess the behavior changed intentionally, but the documentation was not updated?
Thanks for reporting this, this is quite a big breaking change so I tried to make it visible and even added a warning in the README of this package but I might have missed that docstring
In pre-0.5 versions, monomial vectors were ordered decreasingly. Accordingly, the documentation for
monovec
states:This was true:
For 0.5, the documentation is unchanged. However, now the vector is sorted in increasing order:
Same happens for TypedPolynomials. So I guess the behavior changed intentionally, but the documentation was not updated?