pub struct PolyBase<X, R>{ /* private fields */ }Expand description
A polynomial: a linear combination of monomials X with coefficients in R.
Internally a Lc<X, R> — a sparse map from monomial to coefficient.
Implementations§
Source§impl<X, R> PolyBase<X, R>
impl<X, R> PolyBase<X, R>
pub fn from_const(r: R) -> Self
pub fn inner(&self) -> &Lc<X, R>
pub fn nterms(&self) -> usize
pub fn any_term(&self) -> Option<(&X, &R)>
pub fn is_mono(&self) -> bool
pub fn as_mono(&self) -> Option<X>
pub fn coeff(&self, x: &X) -> &R
pub fn iter(&self) -> impl Iterator<Item = (&X, &R)>
pub fn coeff_for(&self, i: X::Deg) -> &R
pub fn is_const(&self) -> bool
pub fn const_term(&self) -> &R
pub fn lead_term(&self) -> (&X, &R)
pub fn lead_coeff(&self) -> &R
pub fn lead_deg(&self) -> X::Deg
pub fn sort_terms_by<F>(&self, cmp: F) -> impl Iterator<Item = (&X, &R)>
pub fn to_string_by<F>(&self, cmp: F, descending: bool) -> String
Trait Implementations§
Source§impl<X, R> AddAssign for PolyBase<X, R>
impl<X, R> AddAssign for PolyBase<X, R>
Source§fn add_assign(&mut self, rhs: PolyBase<X, R>)
fn add_assign(&mut self, rhs: PolyBase<X, R>)
Performs the
+= operation. Read moreSource§impl<X, R> AddAssign<&PolyBase<X, R>> for PolyBase<X, R>
impl<X, R> AddAssign<&PolyBase<X, R>> for PolyBase<X, R>
Source§fn add_assign(&mut self, rhs: &PolyBase<X, R>)
fn add_assign(&mut self, rhs: &PolyBase<X, R>)
Performs the
+= operation. Read moreimpl<X, R> AddGrp for PolyBase<X, R>
impl<X, R> AddGrpOps for PolyBase<X, R>
impl<X, R> AddGrpOps<PolyBase<X, R>> for &PolyBase<X, R>
impl<X, R> AddMonOps for PolyBase<X, R>
impl<X, R> AddMonOps<PolyBase<X, R>> for &PolyBase<X, R>
Source§impl<const X: char, R> DivAssign<&PolyBase<Var<X, usize>, R>> for Poly<X, R>
impl<const X: char, R> DivAssign<&PolyBase<Var<X, usize>, R>> for Poly<X, R>
Source§fn div_assign(&mut self, rhs: &Poly<X, R>)
fn div_assign(&mut self, rhs: &Poly<X, R>)
Performs the
/= operation. Read moreimpl<X, R> Eq for PolyBase<X, R>
impl<const X: char, R> EucRingOps<PolyBase<Var<X, usize>, R>> for &Poly<X, R>
Source§impl<X, R> FromIterator<(X, R)> for PolyBase<X, R>
impl<X, R> FromIterator<(X, R)> for PolyBase<X, R>
Source§impl<X, R> IntoIterator for PolyBase<X, R>
impl<X, R> IntoIterator for PolyBase<X, R>
impl<X, R> MonOps for PolyBase<X, R>
impl<X, R> MonOps<PolyBase<X, R>> for &PolyBase<X, R>
Source§impl<X, R> MulAssign for PolyBase<X, R>
impl<X, R> MulAssign for PolyBase<X, R>
Source§fn mul_assign(&mut self, rhs: PolyBase<X, R>)
fn mul_assign(&mut self, rhs: PolyBase<X, R>)
Performs the
*= operation. Read moreSource§impl<X, R> MulAssign<&PolyBase<X, R>> for PolyBase<X, R>
impl<X, R> MulAssign<&PolyBase<X, R>> for PolyBase<X, R>
Source§fn mul_assign(&mut self, rhs: &PolyBase<X, R>)
fn mul_assign(&mut self, rhs: &PolyBase<X, R>)
Performs the
*= operation. Read moreSource§impl<X, R> MulAssign<&R> for PolyBase<X, R>
impl<X, R> MulAssign<&R> for PolyBase<X, R>
Source§fn mul_assign(&mut self, rhs: &R)
fn mul_assign(&mut self, rhs: &R)
Performs the
*= operation. Read moreSource§impl<X, R> MulAssign<R> for PolyBase<X, R>
impl<X, R> MulAssign<R> for PolyBase<X, R>
Source§fn mul_assign(&mut self, rhs: R)
fn mul_assign(&mut self, rhs: R)
Performs the
*= operation. Read moreSource§impl<const X: char, R> RemAssign<&PolyBase<Var<X, usize>, R>> for Poly<X, R>
impl<const X: char, R> RemAssign<&PolyBase<Var<X, usize>, R>> for Poly<X, R>
Source§fn rem_assign(&mut self, rhs: &Poly<X, R>)
fn rem_assign(&mut self, rhs: &Poly<X, R>)
Performs the
%= operation. Read moreSource§impl<X, R> Ring for PolyBase<X, R>
impl<X, R> Ring for PolyBase<X, R>
Source§fn inv(&self) -> Option<Self>
fn inv(&self) -> Option<Self>
Multiplicative inverse, if this element is a unit; otherwise
None.Source§fn is_unit(&self) -> bool
fn is_unit(&self) -> bool
true iff this element is a unit (has a multiplicative inverse). Read moreSource§fn normalizing_unit(&self) -> Self
fn normalizing_unit(&self) -> Self
Source§fn normalized(&self) -> Self
fn normalized(&self) -> Self
The canonical associate of
self (i.e. self * self.normalizing_unit()).Source§fn into_normalized(self) -> Self
fn into_normalized(self) -> Self
Like
normalized, but consuming.impl<X, R> RingOps for PolyBase<X, R>
impl<X, R> RingOps<PolyBase<X, R>> for &PolyBase<X, R>
impl<X, R> StructuralPartialEq for PolyBase<X, R>
Source§impl<X, R> SubAssign for PolyBase<X, R>
impl<X, R> SubAssign for PolyBase<X, R>
Source§fn sub_assign(&mut self, rhs: PolyBase<X, R>)
fn sub_assign(&mut self, rhs: PolyBase<X, R>)
Performs the
-= operation. Read moreSource§impl<X, R> SubAssign<&PolyBase<X, R>> for PolyBase<X, R>
impl<X, R> SubAssign<&PolyBase<X, R>> for PolyBase<X, R>
Source§fn sub_assign(&mut self, rhs: &PolyBase<X, R>)
fn sub_assign(&mut self, rhs: &PolyBase<X, R>)
Performs the
-= operation. Read moreSource§impl<X, R> TeX for PolyBase<X, R>
impl<X, R> TeX for PolyBase<X, R>
fn tex_math_symbol() -> String
fn tex_string(&self) -> String
Auto Trait Implementations§
impl<X, R> Freeze for PolyBase<X, R>
impl<X, R> RefUnwindSafe for PolyBase<X, R>
impl<X, R> Send for PolyBase<X, R>
impl<X, R> Sync for PolyBase<X, R>
impl<X, R> Unpin for PolyBase<X, R>
impl<X, R> UnsafeUnpin for PolyBase<X, R>
impl<X, R> UnwindSafe for PolyBase<X, R>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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