From 61420f10690f9973cdc236c7889d81b7e32f9acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 13 Jun 2025 23:00:19 +0200 Subject: [PATCH] Add ordering for a vector of variables --- src/comparison.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/comparison.jl b/src/comparison.jl index cfa9cb9..c209f8a 100644 --- a/src/comparison.jl +++ b/src/comparison.jl @@ -302,6 +302,10 @@ function ordering end ordering(::Type{<:AbstractMonomial}) = Graded{LexOrder} ordering(::Type{P}) where {P} = ordering(monomial_type(P)) ordering(p::AbstractPolynomialLike) = ordering(typeof(p)) +# Useful for instance to ask ordering given the list +# of variables +ordering(::AbstractVector{T}) where {T} = ordering(T) +ordering(t::Tuple) = ordering(first(t)) # We reverse the order of comparisons here so that the result # of x < y is equal to the result of Monomial(x) < Monomial(y)