pub struct ExpressionEvaluator<T: EvaluationDomain> { /* private fields */ }Expand description
Implementations§
Source§impl<T: EvaluationDomain + PowfExtension> ExpressionEvaluator<T>
impl<T: EvaluationDomain + PowfExtension> ExpressionEvaluator<T>
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Return the number of parameters expected by this evaluator.
Sourcepub fn evaluate(&self, params: &[T]) -> Result<Vec<T>>
pub fn evaluate(&self, params: &[T]) -> Result<Vec<T>>
Evaluate the expression with the given parameter values.
Returns a vector of result values. The number of results equals
result_indices.len().
§Errors
Returns EvaluationError if the number of parameters does not
match, or if an arithmetic error occurs (e.g. division by zero).
§Example
ⓘ
let result = evaluator.evaluate(&[2.0_f64])?;
assert_eq!(result.len(), 1);Source§impl<T: EvaluationDomain + PowfExtension> ExpressionEvaluator<T>
impl<T: EvaluationDomain + PowfExtension> ExpressionEvaluator<T>
Sourcepub fn compile_with(atom: Atom<'_>, map: FunctionMap<T>) -> Result<Self>
pub fn compile_with(atom: Atom<'_>, map: FunctionMap<T>) -> Result<Self>
Compile an Atom with a FunctionMap for user-defined functions.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ExpressionEvaluator<T>
impl<T> !UnwindSafe for ExpressionEvaluator<T>
impl<T> Freeze for ExpressionEvaluator<T>
impl<T> Send for ExpressionEvaluator<T>where
T: Send,
impl<T> Sync for ExpressionEvaluator<T>where
T: Sync,
impl<T> Unpin for ExpressionEvaluator<T>where
T: Unpin,
impl<T> UnsafeUnpin for ExpressionEvaluator<T>
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> 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