pub enum SymbolicExpression<F: IntegrateFloat> {
Show 19 variants
Constant(F),
Var(Variable),
Add(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>),
Sub(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>),
Mul(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>),
Div(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>),
Pow(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>),
Neg(Box<SymbolicExpression<F>>),
Sin(Box<SymbolicExpression<F>>),
Cos(Box<SymbolicExpression<F>>),
Exp(Box<SymbolicExpression<F>>),
Ln(Box<SymbolicExpression<F>>),
Sqrt(Box<SymbolicExpression<F>>),
Tan(Box<SymbolicExpression<F>>),
Atan(Box<SymbolicExpression<F>>),
Sinh(Box<SymbolicExpression<F>>),
Cosh(Box<SymbolicExpression<F>>),
Tanh(Box<SymbolicExpression<F>>),
Abs(Box<SymbolicExpression<F>>),
}Expand description
Symbolic expression types
Variants§
Constant(F)
Constant value
Var(Variable)
Variable
Add(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>)
Addition
Sub(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>)
Subtraction
Mul(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>)
Multiplication
Div(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>)
Division
Pow(Box<SymbolicExpression<F>>, Box<SymbolicExpression<F>>)
Power
Neg(Box<SymbolicExpression<F>>)
Negation
Sin(Box<SymbolicExpression<F>>)
Sine
Cos(Box<SymbolicExpression<F>>)
Cosine
Exp(Box<SymbolicExpression<F>>)
Exponential
Ln(Box<SymbolicExpression<F>>)
Natural logarithm
Sqrt(Box<SymbolicExpression<F>>)
Square root
Tan(Box<SymbolicExpression<F>>)
Tangent
Atan(Box<SymbolicExpression<F>>)
Arctangent
Sinh(Box<SymbolicExpression<F>>)
Hyperbolic sine
Cosh(Box<SymbolicExpression<F>>)
Hyperbolic cosine
Tanh(Box<SymbolicExpression<F>>)
Hyperbolic tangent
Abs(Box<SymbolicExpression<F>>)
Absolute value
Implementations§
Source§impl<F: IntegrateFloat> SymbolicExpression<F>
impl<F: IntegrateFloat> SymbolicExpression<F>
Sourcepub fn indexedvar(name: impl Into<String>, index: usize) -> Self
pub fn indexedvar(name: impl Into<String>, index: usize) -> Self
Create an indexed variable expression
Sourcepub fn tan(expr: SymbolicExpression<F>) -> Self
pub fn tan(expr: SymbolicExpression<F>) -> Self
Create a tangent expression
Sourcepub fn atan(expr: SymbolicExpression<F>) -> Self
pub fn atan(expr: SymbolicExpression<F>) -> Self
Create an arctangent expression
Sourcepub fn sinh(expr: SymbolicExpression<F>) -> Self
pub fn sinh(expr: SymbolicExpression<F>) -> Self
Create a hyperbolic sine expression
Sourcepub fn cosh(expr: SymbolicExpression<F>) -> Self
pub fn cosh(expr: SymbolicExpression<F>) -> Self
Create a hyperbolic cosine expression
Sourcepub fn tanh(expr: SymbolicExpression<F>) -> Self
pub fn tanh(expr: SymbolicExpression<F>) -> Self
Create a hyperbolic tangent expression
Sourcepub fn abs(expr: SymbolicExpression<F>) -> Self
pub fn abs(expr: SymbolicExpression<F>) -> Self
Create an absolute value expression
Sourcepub fn differentiate(&self, var: &Variable) -> SymbolicExpression<F>
pub fn differentiate(&self, var: &Variable) -> SymbolicExpression<F>
Differentiate with respect to a variable
Sourcepub fn evaluate(&self, values: &HashMap<Variable, F>) -> IntegrateResult<F>
pub fn evaluate(&self, values: &HashMap<Variable, F>) -> IntegrateResult<F>
Evaluate the expression with given variable values
Trait Implementations§
Source§impl<F: IntegrateFloat> Add for SymbolicExpression<F>
impl<F: IntegrateFloat> Add for SymbolicExpression<F>
Source§impl<F: Clone + IntegrateFloat> Clone for SymbolicExpression<F>
impl<F: Clone + IntegrateFloat> Clone for SymbolicExpression<F>
Source§fn clone(&self) -> SymbolicExpression<F>
fn clone(&self) -> SymbolicExpression<F>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<F: Debug + IntegrateFloat> Debug for SymbolicExpression<F>
impl<F: Debug + IntegrateFloat> Debug for SymbolicExpression<F>
Source§impl<F: IntegrateFloat> Display for SymbolicExpression<F>
impl<F: IntegrateFloat> Display for SymbolicExpression<F>
Source§impl<F: IntegrateFloat> Div for SymbolicExpression<F>
impl<F: IntegrateFloat> Div for SymbolicExpression<F>
Source§impl<F: IntegrateFloat> Mul for SymbolicExpression<F>
impl<F: IntegrateFloat> Mul for SymbolicExpression<F>
Source§impl<F: IntegrateFloat> Neg for SymbolicExpression<F>
impl<F: IntegrateFloat> Neg for SymbolicExpression<F>
Source§impl<F: PartialEq + IntegrateFloat> PartialEq for SymbolicExpression<F>
impl<F: PartialEq + IntegrateFloat> PartialEq for SymbolicExpression<F>
Source§impl<F: IntegrateFloat> Sub for SymbolicExpression<F>
impl<F: IntegrateFloat> Sub for SymbolicExpression<F>
impl<F: IntegrateFloat> StructuralPartialEq for SymbolicExpression<F>
Auto Trait Implementations§
impl<F> Freeze for SymbolicExpression<F>where
F: Freeze,
impl<F> RefUnwindSafe for SymbolicExpression<F>where
F: RefUnwindSafe,
impl<F> Send for SymbolicExpression<F>where
F: Send,
impl<F> Sync for SymbolicExpression<F>where
F: Sync,
impl<F> Unpin for SymbolicExpression<F>where
F: Unpin,
impl<F> UnwindSafe for SymbolicExpression<F>where
F: UnwindSafe,
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<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