Enum Elementary

Source
pub enum Elementary {
Show 24 variants Sin(Arc<Elementary>), Cos(Arc<Elementary>), Tan(Arc<Elementary>), Sec(Arc<Elementary>), Csc(Arc<Elementary>), Cot(Arc<Elementary>), Asin(Arc<Elementary>), Acos(Arc<Elementary>), Atan(Arc<Elementary>), Sinh(Arc<Elementary>), Cosh(Arc<Elementary>), Tanh(Arc<Elementary>), Add(Arc<Elementary>, Arc<Elementary>), Sub(Arc<Elementary>, Arc<Elementary>), Mul(Arc<Elementary>, Arc<Elementary>), Div(Arc<Elementary>, Arc<Elementary>), Pow(Arc<Elementary>, Arc<Elementary>), Log(Arc<Elementary>, Arc<Elementary>), Factorial(Arc<Elementary>), Gamma(Arc<Elementary>), Polygamma(Arc<Elementary>, usize), Abs(Arc<Elementary>), Con(f64), X,
}

Variants§

Implementations§

Source§

impl Elementary

Source

pub fn call(self) -> Box<dyn Fn(f64) -> f64 + 'static>

Source§

impl Elementary

Source§

impl Elementary

Source

pub fn expand_maclaurin(&self, order: u8) -> Result<SeriesExpansion, Error>

Source

pub fn expand_taylor( &self, order: u8, centre: f64, ) -> Result<SeriesExpansion, Error>

Source§

impl Elementary

Source

pub fn classify(&self) -> Result<Category, Error>

Source

pub fn is_constant(&self) -> bool

Source

pub fn is_digit(&self) -> Result<bool, Error>

Source

pub fn is_exponential(&self) -> Result<bool, Error>

Source§

impl Elementary

Source

pub fn simplify(&self) -> Result<Self, Error>

Source

pub fn simplify_operations(&self) -> Result<Self, Error>

Source

pub fn simplify_power(base: &Self, exp: &Self) -> Result<Self, Error>

Source

pub fn divide(&self) -> Result<Self, Error>

Source

pub fn factor(&self) -> Result<Vec<Self>, Error>

Source

pub fn simplify_constant(&self) -> Result<Self, Error>

Trait Implementations§

Source§

impl Add<&mut Elementary> for Elementary

Source§

type Output = Elementary

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &mut Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Elementary> for Arc<Elementary>

Source§

type Output = Elementary

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Elementary) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f64> for Elementary

Source§

type Output = Elementary

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for Elementary

Source§

type Output = Elementary

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign for Elementary

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl Clone for Elementary

Source§

fn clone(&self) -> Elementary

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Elementary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Div<&mut Elementary> for Elementary

Source§

type Output = Elementary

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &mut Self) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Elementary> for Arc<Elementary>

Source§

type Output = Elementary

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Elementary) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for Elementary

Source§

type Output = Elementary

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div for Elementary

Source§

type Output = Elementary

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign for Elementary

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<'a> From<&'a str> for Elementary

Source§

fn from(value: &'a str) -> Self

Converts to this type from the input type.
Source§

impl From<Elementary> for Function

Source§

fn from(value: Elementary) -> Self

Converts to this type from the input type.
Source§

impl Integrate for Elementary

See Integrate for usage and examples.

Source§

fn evaluate_integral(&self, lower_bound: f64, upper_bound: f64) -> f64

Evaluating the integral gives a value of the integral with eight decimal places

Source§

fn integrate(&self) -> Integral

Method will return an instance of Integral that can be taylored to specific usecases. Read more
Source§

impl Mul<&mut Elementary> for Elementary

Source§

type Output = Elementary

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &mut Self) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Elementary> for Arc<Elementary>

Source§

type Output = Elementary

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Elementary) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for Elementary

Source§

type Output = Elementary

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for Elementary

Source§

type Output = Elementary

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign for Elementary

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl PartialEq for Elementary

Source§

fn eq(&self, other: &Elementary) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Sub<Elementary> for Arc<Elementary>

Source§

type Output = Elementary

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Elementary) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f64> for Elementary

Source§

type Output = Elementary

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for Elementary

Source§

type Output = Elementary

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Sum for Elementary

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl StructuralPartialEq for Elementary

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.