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