pub struct DegRevLex;Expand description
The graded reverse lexicographic order. This is the most important monomial order, since computing a Groebner basis w.r.t. this order is usually more efficient than for other orders. Also sometimes referred to as “grevlex”.
Concretely, this is the ordering of monomials we get by first comparing monomial degrees, and in case of a tie reverse the outcome of a lexicographic comparison, using a reversed order of variables.
§Example
let poly_ring = MultivariatePolyRingImpl::new(StaticRing::<i64>::RING, 3);
let monomials_descending = [
[2, 0, 0], // x1^2
[1, 1, 0], // x1 x2
[0, 2, 0], // x2^2
[1, 0, 1], // x1 x3
[0, 1, 1], // x2 x3
[0, 0, 2], // x3^2
].into_iter().map(|m| poly_ring.create_monomial(m)).collect::<Vec<_>>();
for i in 1..6 {
assert!(DegRevLex.compare(&poly_ring, &monomials_descending[i - 1], &monomials_descending[i]) == Ordering::Greater);
}Trait Implementations§
Source§impl MonomialOrder for DegRevLex
impl MonomialOrder for DegRevLex
Source§fn as_any(&self) -> Option<&dyn Any>
fn as_any(&self) -> Option<&dyn Any>
Upcasts this reference to
&dyn Any, which is sometimes required to compare monomial order
objects of different types.fn compare<P>( &self, ring: P, lhs: &PolyMonomial<P>, rhs: &PolyMonomial<P>, ) -> Ordering
Source§fn eq_mon<P>(
&self,
ring: P,
lhs: &PolyMonomial<P>,
rhs: &PolyMonomial<P>,
) -> bool
fn eq_mon<P>( &self, ring: P, lhs: &PolyMonomial<P>, rhs: &PolyMonomial<P>, ) -> bool
Checks whether two monomials are equal. Read more
Source§fn is_same<O>(&self, rhs: &O) -> boolwhere
O: MonomialOrder,
fn is_same<O>(&self, rhs: &O) -> boolwhere
O: MonomialOrder,
Whether this order is the same as the given other order, i.e.
MonomialOrder::compare()
gives the same output on all inputs. Read moreimpl Copy for DegRevLex
impl Eq for DegRevLex
impl GradedMonomialOrder for DegRevLex
impl StructuralPartialEq for DegRevLex
Auto Trait Implementations§
impl Freeze for DegRevLex
impl RefUnwindSafe for DegRevLex
impl Send for DegRevLex
impl Sync for DegRevLex
impl Unpin for DegRevLex
impl UnsafeUnpin for DegRevLex
impl UnwindSafe for DegRevLex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more