Closed sumiya11 closed 2 years ago
Hi! At the moment, both DynamicPolynomials and TypedPolynomials use the graded lex order so it's safe to assume it. We could add an interface to get the ordering. We need to choose between
struct GradedLex <: Ordering end
struct GradedReverseLex <: Ordering end
ordering(...) = :graded_lex
ordering(...) = :graded_reverse_lex
or
struct GradedLex <: Ordering end
struct GradedReverseLex <: Ordering end
ordering(...) = GradedLex()
ordering(...) = GradedReverseLex()
or
@enum Ordering GRADED_LEX GRADED_REVERSE_LEX
ordering(...) = GRADED_LEX
ordering(...) = GRADED_REVERSE_LEX
I don't really like the first one because when you have typos and write an incorrect ordering, you don't see it and it might lead to subtle bugs.
The disadvantage of the 3rd one is that MultivariatePolynomials has to limit the set of possible ordering and it cannot be extended by other packages.
The 2nd one allows other packages to add subtypes of Ordering
and allows to use the ordering directly in multiple dispatch to dispatch to a function handling this ordering.
Hi! I think it would be nice to have a function for extracting the monomial ordering. So that, for example,
I'm developing a package for Groebner bases computations and want to support
MultivariatePolynomials.AbstractPolynomial
as an input type. To be coherent withAbstractAlgebra
, I assume and hardcode the ordering forAbstractPolynomial
which does not seem good