Skip to content
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

Add ordering function to query ordering #276

Merged
merged 5 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
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
13 changes: 12 additions & 1 deletion docs/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ map_exponents
multiplication_preserves_monomial_order
```

### Ordering

```@docs
AbstractMonomialOrdering
ordering
compare
LexOrder
InverseLexOrder
Graded
Reverse
```

## Terms

```@docs
Expand Down Expand Up @@ -72,7 +84,6 @@ nterms
coefficients
coefficient(p::AbstractPolynomialLike, m::AbstractMonomialLike, vars)
monomials
ordering
mindegree
maxdegree
extdegree
Expand Down
1 change: 0 additions & 1 deletion src/MultivariatePolynomials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ include("monomial.jl")
include("term.jl")
include("polynomial.jl")
include("monomial_vector.jl")
include("ordering.jl")

include("rational.jl")

Expand Down
7 changes: 7 additions & 0 deletions src/comparison.jl
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,10 @@ struct Reverse{O<:AbstractMonomialOrdering} <: AbstractMonomialOrdering
end

compare(a, b, ::Type{Reverse{O}}) where {O} = compare(b, a, O)

"""
ordering(p::AbstractPolynomialLike)

Returns the [`AbstractMonomialOrdering`](@ref) used for the monomials of `p`.
"""
function ordering end
22 changes: 0 additions & 22 deletions src/ordering.jl

This file was deleted.

2 changes: 1 addition & 1 deletion test/monomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ end
@test one(x^2) isa AbstractMonomial
@test (@inferred one(typeof(x^2))) == 1
@test one(typeof(x^2)) isa AbstractMonomial
@test ordering(x) === GradedLex()
# @test ordering(x) === GradedLex #FIXME add it back once it's implemented

Mod.@polyvar y[1:7]
mono = y[1] * y[3] * y[5] * y[7]
Expand Down
2 changes: 1 addition & 1 deletion test/polynomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const MP = MultivariatePolynomials
@test collect(coefficients(f)) == [4, -5, 4, 7]
@test collect(monomials(f)) ==
monomial_vector([x^2 * z^2, x * y^2 * z, x^3, z^2])
@test ordering(f) === GradedLex()
#@test ordering(f) === GradedLex #FIXME
end

@testset "Convertion" begin
Expand Down
Loading