pub struct Grlex;Expand description
Graded lexicographic ordering: first by total degree descending, then lexicographic.
Grlex is sometimes preferred over grevlex in Gröbner basis computations because it can lead to smaller intermediate matrices in the F4 algorithm.
§Example
use ocas_poly::sparse::{Grlex, MonomialOrder};
let a = [2, 0]; // x^2, degree 2
let b = [1, 1]; // x*y, degree 2
let c = [0, 3]; // y^3, degree 3
// c has highest degree, so it comes first
assert_eq!(Grlex.cmp(&c, &a), std::cmp::Ordering::Less);
// a and b have same degree; a > b lexicographically
assert_eq!(Grlex.cmp(&a, &b), std::cmp::Ordering::Greater);Trait Implementations§
impl Copy for Grlex
impl Eq for Grlex
Source§impl MonomialOrder for Grlex
impl MonomialOrder for Grlex
impl StructuralPartialEq for Grlex
Auto Trait Implementations§
impl Freeze for Grlex
impl RefUnwindSafe for Grlex
impl Send for Grlex
impl Sync for Grlex
impl Unpin for Grlex
impl UnsafeUnpin for Grlex
impl UnwindSafe for Grlex
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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