Skip to content

Add ordering for a vector of variables #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/comparison.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@
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))

Check warning on line 308 in src/comparison.jl

View check run for this annotation

Codecov / codecov/patch

src/comparison.jl#L307-L308

Added lines #L307 - L308 were not covered by tests

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