pub struct MatrixOrder { /* private fields */ }Expand description
Matrix ordering: compare monomials by multiplying exponent vectors by an integer matrix and comparing the results lexicographically.
Given an $n \times n$ matrix $M$, monomial $\alpha > \beta$ iff $M\alpha >_{\text{lex}} M\beta$. This generalizes all standard orderings and is particularly useful for constructing elimination orderings.
§Example
use ocas_poly::sparse::{MatrixOrder, MonomialOrder};
// 2×2 identity matrix = Lex order
let ord = MatrixOrder::new(vec![vec![1, 0], vec![0, 1]]);
assert_eq!(ord.cmp(&[1, 0], &[0, 1]), std::cmp::Ordering::Greater);Implementations§
Source§impl MatrixOrder
impl MatrixOrder
Sourcepub fn elimination_order(elim_vars: usize, n_vars: usize) -> Self
pub fn elimination_order(elim_vars: usize, n_vars: usize) -> Self
Create an elimination ordering that eliminates the first elim_vars
variables. Equivalent to BlockOrder([elim_vars in Lex, rest in Grevlex]) but expressed as a weight matrix.
Trait Implementations§
Source§impl Clone for MatrixOrder
impl Clone for MatrixOrder
Source§fn clone(&self) -> MatrixOrder
fn clone(&self) -> MatrixOrder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MatrixOrder
impl Debug for MatrixOrder
Source§impl Default for MatrixOrder
impl Default for MatrixOrder
impl Eq for MatrixOrder
Source§impl MonomialOrder for MatrixOrder
impl MonomialOrder for MatrixOrder
Source§impl PartialEq for MatrixOrder
impl PartialEq for MatrixOrder
impl StructuralPartialEq for MatrixOrder
Auto Trait Implementations§
impl Freeze for MatrixOrder
impl RefUnwindSafe for MatrixOrder
impl Send for MatrixOrder
impl Sync for MatrixOrder
impl Unpin for MatrixOrder
impl UnsafeUnpin for MatrixOrder
impl UnwindSafe for MatrixOrder
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