Skip to content

Commit 45a99a8

Browse files
committed
Add ordering for a vector of variables
1 parent 8e55f79 commit 45a99a8

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
@@ -328,6 +328,10 @@ function ordering end
328328
ordering(::Type{<:AbstractMonomial}) = Graded{LexOrder}
329329
ordering(::Type{P}) where {P} = ordering(monomial_type(P))
330330
ordering(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)

0 commit comments

Comments
 (0)