pub struct Monomial {
pub exponents: Vec<usize>,
}Expand description
Monomial represented as exponent vector
For polynomial in variables [x, y, z], monomial x²y³z is [2, 3, 1] This representation enables O(1) monomial comparison and operations.
Fields§
§exponents: Vec<usize>Exponents for each variable (index corresponds to variable order)
Implementations§
Source§impl Monomial
impl Monomial
Sourcepub fn div(&self, other: &Self) -> Option<Self>
pub fn div(&self, other: &Self) -> Option<Self>
Divide two monomials if divisible (subtract exponents)
Sourcepub fn try_divide(&self, other: &Self) -> Option<Self>
pub fn try_divide(&self, other: &Self) -> Option<Self>
Try to divide monomial by another (returns None if not divisible)
Sourcepub fn cmp(&self, other: &Self, order: &MonomialOrder) -> Ordering
pub fn cmp(&self, other: &Self, order: &MonomialOrder) -> Ordering
Compare monomials using given ordering
Trait Implementations§
impl Eq for Monomial
impl StructuralPartialEq for Monomial
Auto Trait Implementations§
impl Freeze for Monomial
impl RefUnwindSafe for Monomial
impl Send for Monomial
impl Sync for Monomial
impl Unpin for Monomial
impl UnwindSafe for Monomial
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