File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,10 @@ function ordering end
328328ordering (:: Type{<:AbstractMonomial} ) = Graded{LexOrder}
329329ordering (:: Type{P} ) where {P} = ordering (monomial_type (P))
330330ordering (p:: AbstractPolynomialLike ) = ordering (typeof (p))
331+ # Useful for instance to ask ordering given the list
332+ # of variables
333+ ordering (:: AbstractVector{T} ) where {T} = ordering (T)
334+ ordering (t:: Tuple ) = ordering (first (t))
331335
332336# We reverse the order of comparisons here so that the result
333337# of x < y is equal to the result of Monomial(x) < Monomial(y)
Original file line number Diff line number Diff line change 11@testset " Comparison" begin
22 @testset " Graded Lex Order" begin
33 Mod. @polyvar x y z
4+ O = Graded{LexOrder}
5+ @test ordering (x) == O
6+ @test ordering (x * y) == O
7+ @test ordering (variables (x * y)) == O
48 @test x > y > z
59 @test x^ 2 * y > y^ 3 > z
610 @test y^ 2 >= x
You can’t perform that action at this time.
0 commit comments