pub enum BinaryOperator {
Add,
Sub,
Mul,
Div,
Rem,
Max,
Min,
}Expand description
Binary arithmetic operator.
Variants§
Implementations§
Source§impl BinaryOperator
impl BinaryOperator
Sourcepub fn eval<T: Num + PartialOrd>(&self, a: T, b: T) -> T
pub fn eval<T: Num + PartialOrd>(&self, a: T, b: T) -> T
Returns the result of the evaluation.
Sourcepub fn eval_operation_x<T: Num + PartialOrd + Copy>(
&self,
x: T,
y: Vec<T>,
) -> Vec<T>
pub fn eval_operation_x<T: Num + PartialOrd + Copy>( &self, x: T, y: Vec<T>, ) -> Vec<T>
Returns the result of the evaluation with x and each element in y.
Sourcepub fn eval_operation_y<T: Num + PartialOrd + Copy>(
&self,
x: Vec<T>,
y: T,
) -> Vec<T>
pub fn eval_operation_y<T: Num + PartialOrd + Copy>( &self, x: Vec<T>, y: T, ) -> Vec<T>
Returns the result of the evaluation with each element in x and y.
Sourcepub fn eval_vector_operation_in_x<T: Num + PartialOrd + Copy>(
&self,
x: Vec<T>,
y: &[T],
) -> Vec<T>
pub fn eval_vector_operation_in_x<T: Num + PartialOrd + Copy>( &self, x: Vec<T>, y: &[T], ) -> Vec<T>
Returns the result of the evaluation with each element in x and each element in y.
If y is longer than x, the result is truncated to the length of x.
Sourcepub fn eval_vector_operation_in_y<T: Num + PartialOrd + Copy>(
&self,
x: &[T],
y: Vec<T>,
) -> Vec<T>
pub fn eval_vector_operation_in_y<T: Num + PartialOrd + Copy>( &self, x: &[T], y: Vec<T>, ) -> Vec<T>
Returns the result of the evaluation with each element in x and each element in y.
If x is longer than y, the result is truncated to the length of y.
Trait Implementations§
Source§impl Clone for BinaryOperator
impl Clone for BinaryOperator
Source§fn clone(&self) -> BinaryOperator
fn clone(&self) -> BinaryOperator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinaryOperator
impl Debug for BinaryOperator
impl Eq for BinaryOperator
Source§impl PartialEq for BinaryOperator
impl PartialEq for BinaryOperator
Source§fn eq(&self, other: &BinaryOperator) -> bool
fn eq(&self, other: &BinaryOperator) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BinaryOperator
Auto Trait Implementations§
impl Freeze for BinaryOperator
impl RefUnwindSafe for BinaryOperator
impl Send for BinaryOperator
impl Sync for BinaryOperator
impl Unpin for BinaryOperator
impl UnsafeUnpin for BinaryOperator
impl UnwindSafe for BinaryOperator
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