pub struct Expr(Rc<Atom>);
Tuple Fields§
§0: Rc<Atom>
Implementations§
source§impl Expr
impl Expr
pub fn undef() -> Expr
pub fn zero() -> Expr
pub fn one() -> Expr
pub fn min_one() -> Expr
pub fn var(str: &str) -> Expr
pub fn rational<T: Into<Rational>>(r: T) -> Expr
pub fn add(lhs: impl Borrow<Expr>, rhs: impl Borrow<Expr>) -> Expr
pub fn sub(lhs: impl Borrow<Expr>, rhs: impl Borrow<Expr>) -> Expr
pub fn mul(lhs: impl Borrow<Expr>, rhs: impl Borrow<Expr>) -> Expr
pub fn div(lhs: impl Borrow<Expr>, rhs: impl Borrow<Expr>) -> Expr
pub fn cos(e: impl Borrow<Expr>) -> Expr
pub fn sin(e: impl Borrow<Expr>) -> Expr
pub fn tan(e: impl Borrow<Expr>) -> Expr
pub fn sec(e: impl Borrow<Expr>) -> Expr
pub fn arc_sin(e: impl Borrow<Expr>) -> Expr
pub fn arc_cos(e: impl Borrow<Expr>) -> Expr
pub fn arc_tan(e: impl Borrow<Expr>) -> Expr
pub fn exp(e: impl Borrow<Expr>) -> Expr
pub fn log(base: impl Into<Real>, e: impl Borrow<Expr>) -> Expr
pub fn ln(e: impl Borrow<Expr>) -> Expr
pub fn log10(e: impl Borrow<Expr>) -> Expr
pub fn raw_pow(base: impl Borrow<Expr>, exponent: impl Borrow<Expr>) -> Expr
pub fn pow(base: impl Borrow<Expr>, exponent: impl Borrow<Expr>) -> Expr
pub fn sqrt(v: impl Borrow<Expr>) -> Expr
pub fn is_undef(&self) -> bool
fn is_primitive(&self) -> bool
pub fn check_real(&self, r: &Real) -> bool
source§impl Expr
impl Expr
pub fn free_of(&self, expr: &Expr) -> bool
pub fn free_of_set<'a, I: IntoIterator<Item = &'a Self>>( &'a self, exprs: I, ) -> bool
pub fn substitude(&self, from: &Expr, to: &Expr) -> Self
pub fn seq_substitude<'a, T>(&self, subs: T) -> Self
pub fn concurr_substitude<'a, T>(&self, subs: T) -> Self
pub fn variables(&self) -> HashSet<Expr, FxBuildHasher>
pub fn numerator(&self) -> Expr
pub fn denominator(&self) -> Expr
pub fn base(&self) -> Expr
pub fn exponent(&self) -> Expr
fn is_const(&self) -> bool
pub fn const(&self) -> Option<Expr>
pub fn term(&self) -> Option<Expr>
pub fn get(&self) -> &Atom
pub fn get_flatten(&self) -> &Atom
pub fn make_mut(&mut self) -> &mut Atom
fn iter_args(&self) -> Box<dyn Iterator<Item = &Self> + '_>
fn iter_args_mut(&mut self) -> Box<dyn Iterator<Item = &mut Self> + '_>
fn try_for_each_compl_sub_expr<F>(&mut self, func: F)
fn for_each_compl_sub_expr<F>(&mut self, func: F)
fn iter_compl_sub_exprs(&self) -> ExprIterator<'_> ⓘ
fn variables_impl(&self, vars: &mut HashSet<Expr, FxBuildHasher>)
source§impl Expr
impl Expr
pub fn pow_expand(base: impl Borrow<Expr>, exponent: impl Borrow<Expr>) -> Expr
pub fn mul_expand(lhs: impl Borrow<Expr>, rhs: impl Borrow<Expr>) -> Expr
pub fn derivative<T: Borrow<Self>>(&self, x: T) -> Self
pub fn expand(&self) -> Self
pub fn expand_main_op(&self) -> Self
pub fn distribute(&self) -> Self
pub fn reduce(&self) -> Self
pub fn as_monomial<'a>(&'a self, vars: &'a VarSet) -> MonomialView<'a>
pub fn as_polynomial<'a>(&'a self, vars: &'a VarSet) -> PolynomialView<'a>
fn rationalize_add(lhs: &Self, rhs: &Self) -> Expr
pub fn rationalize(&self) -> Expr
sourcepub fn factorize_common_terms(lhs: &Expr, rhs: &Self) -> (Expr, (Expr, Expr))
pub fn factorize_common_terms(lhs: &Expr, rhs: &Self) -> (Expr, (Expr, Expr))
divide lhs and rhs by their common factor and return them in the form (fac, (lhs/fac, rhs/fac)
pub fn common_factors(lhs: &Self, rhs: &Self) -> Expr
pub fn factor_out(&self) -> Expr
pub fn cancel(&self) -> Expr
Trait Implementations§
source§impl<T: Borrow<Expr>> AddAssign<T> for Expr
impl<T: Borrow<Expr>> AddAssign<T> for Expr
source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+=
operation. Read moresource§impl<T: Borrow<Expr>> DivAssign<T> for Expr
impl<T: Borrow<Expr>> DivAssign<T> for Expr
source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/=
operation. Read moresource§impl From<Expr> for ReducedProd
impl From<Expr> for ReducedProd
source§impl From<Irrational> for Expr
impl From<Irrational> for Expr
source§fn from(value: Irrational) -> Self
fn from(value: Irrational) -> Self
Converts to this type from the input type.
source§impl<T: Borrow<Expr>> MulAssign<T> for Expr
impl<T: Borrow<Expr>> MulAssign<T> for Expr
source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moresource§impl Ord for Expr
impl Ord for Expr
source§impl PartialEq for Expr
impl PartialEq for Expr
source§impl PartialOrd for Expr
impl PartialOrd for Expr
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T: Borrow<Expr>> SubAssign<T> for Expr
impl<T: Borrow<Expr>> SubAssign<T> for Expr
source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
Performs the
-=
operation. Read moreimpl Eq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl !Send for Expr
impl !Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. 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