pub struct Mono { /* private fields */ }Expand description
A power product $\prod_i x_i^{e_i}$ (for example, $x^2y^5$). The variable part of a Poly term.
Mono::cmp implements graded-lex ordering.
let a = mono!(x^2);
let b = mono!(x*y);
let c = mono!(x*z^2);
assert_eq!(a.mul(&b).mul(&c), mono!(x^4*y*z^2));Implementations§
Source§impl Mono
impl Mono
pub fn new(exps: impl IntoIterator<Item = (Var, Pow)>) -> Self
pub fn exps(&self) -> &[(Var, Pow)]
pub fn is_unit(&self) -> bool
pub fn total_degree(&self) -> Pow
pub fn always_nonneg(&self, nonneg: &dyn Fn(Var) -> bool) -> bool
pub fn mul(&self, other: &Self) -> Self
pub fn div(&self, other: &Self) -> Option<Self>
pub fn degree_in<T: Into<Var>>(&self, v: T) -> Pow
pub fn lcm(&self, rhs: &Self) -> Self
pub fn assert_canonical(&self)
Trait Implementations§
impl Eq for Mono
Source§impl Ord for Mono
impl Ord for Mono
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Graded-lex: total degree first;
ties broken lexicographically on exponent vectors with lower Var index more significant
(larger exponent on the first differing variable wins).
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Mono
impl PartialOrd for Mono
impl StructuralPartialEq for Mono
Auto Trait Implementations§
impl Freeze for Mono
impl RefUnwindSafe for Mono
impl Send for Mono
impl Sync for Mono
impl Unpin for Mono
impl UnsafeUnpin for Mono
impl UnwindSafe for Mono
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