Struct calcu_rs::polynomial::PolynomialView
source · pub struct PolynomialView<'a> {
poly: &'a Expr,
vars: &'a VarSet,
}
Expand description
View the expression as a polynomial in one or multiple generalized variables
Fields§
§poly: &'a Expr
§vars: &'a VarSet
Implementations§
source§impl<'a> PolynomialView<'a>
impl<'a> PolynomialView<'a>
pub fn new(poly: &'a Expr, vars: &'a VarSet) -> Self
pub fn check(&self) -> bool
pub fn degree(&self) -> Option<Int>
pub fn degree_of(&self, v: &Expr) -> Option<Int>
pub fn coeffs_of_deg(&self, v: &Expr, deg: &Int) -> Option<Expr>
pub fn coeffs_of(&self, v: &Expr) -> HashMap<Int, Expr, FxBuildHasher>
pub fn coeffs(&self) -> HashMap<VarPow, Expr, FxBuildHasher>
pub fn leading_coeff_of(&self, v: &Expr) -> Option<Expr>
pub fn collect_terms(&self) -> Option<Expr>
Auto Trait Implementations§
impl<'a> Freeze for PolynomialView<'a>
impl<'a> RefUnwindSafe for PolynomialView<'a>
impl<'a> !Send for PolynomialView<'a>
impl<'a> !Sync for PolynomialView<'a>
impl<'a> Unpin for PolynomialView<'a>
impl<'a> UnwindSafe for PolynomialView<'a>
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<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
fn exact_from(value: T) -> U
§impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
fn exact_into(self) -> U
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