Skip to content

Commit 61420f1

Browse files
committed
Add ordering for a vector of variables
1 parent 2f04595 commit 61420f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/comparison.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ function ordering end
302302
ordering(::Type{<:AbstractMonomial}) = Graded{LexOrder}
303303
ordering(::Type{P}) where {P} = ordering(monomial_type(P))
304304
ordering(p::AbstractPolynomialLike) = ordering(typeof(p))
305+
# Useful for instance to ask ordering given the list
306+
# of variables
307+
ordering(::AbstractVector{T}) where {T} = ordering(T)
308+
ordering(t::Tuple) = ordering(first(t))
305309

306310
# We reverse the order of comparisons here so that the result
307311
# of x < y is equal to the result of Monomial(x) < Monomial(y)

0 commit comments

Comments
 (0)