Skip to content

Commit

Permalink
Add ordering function to query ordering (#276)
Browse files Browse the repository at this point in the history
* Add ordering function to query ordering

* Fix

* Disable tests

* Add docstrings to doc

* Disable
  • Loading branch information
blegat authored Jan 8, 2024
1 parent 3c5b774 commit d4b77c9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 26 deletions.
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

0 comments on commit d4b77c9

Please sign in to comment.