Arithmetic

Trait Arithmetic 

Source
pub trait Arithmetic<Op, Rhs = Self> {
    type Output;

    // Required method
    fn eval(self, rhs: Rhs) -> Self::Output;
}
Expand description

Trait for arithmetic operations.

Required Associated Types§

Source

type Output

The result type after performing the operation.

Required Methods§

Source

fn eval(self, rhs: Rhs) -> Self::Output

Perform the operation.

Implementations on Foreign Types§

Source§

impl<Op, T> Arithmetic<Op> for &Buffer<T>
where Op: Operator<T>,

Implementation that allocates a new output buffer.

Source§

type Output = Buffer<T>

Source§

fn eval(self, rhs: &Buffer<T>) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &Buffer<T>> for Buffer<T>
where T: Copy, BufferMut<T>: for<'a> Arithmetic<Op, &'a Buffer<T>, Output = Buffer<T>>, for<'a> &'a Buffer<T>: Arithmetic<Op, &'a Buffer<T>, Output = Buffer<T>>,

Implementation that attempts to downcast to a mutable buffer and operates in-place.

Source§

type Output = Buffer<T>

Source§

fn eval(self, rhs: &Buffer<T>) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &Buffer<T>> for BufferMut<T>
where T: Copy + Zero, Op: Operator<T>,

Implementation that operates in-place over a mutable buffer.

Source§

type Output = Buffer<T>

Source§

fn eval(self, rhs: &Buffer<T>) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &PVector<T>> for &PVector<T>
where T: NativePType, Op: Operator<T>, for<'a> &'a Buffer<T>: Arithmetic<Op, &'a Buffer<T>, Output = Buffer<T>>,

Implementation that allocates a new output vector.

Source§

type Output = PVector<T>

Source§

fn eval(self, rhs: &PVector<T>) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &PVector<T>> for PVector<T>
where T: NativePType, Op: Operator<T>,

Implementation that attempts to downcast to a mutable vector and operates in-place.

Source§

type Output = PVector<T>

Source§

fn eval(self, rhs: &PVector<T>) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &PVector<T>> for PVectorMut<T>
where T: NativePType, Op: Operator<T>, BufferMut<T>: for<'a> Arithmetic<Op, &'a Buffer<T>, Output = Buffer<T>>,

Implementation that operates in-place over a mutable vector.

Source§

type Output = PVector<T>

Source§

fn eval(self, other: &PVector<T>) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &T> for &Buffer<T>
where Op: Operator<T>,

Implementation that allocates a new output buffer operating against a scalar RHS value.

Source§

type Output = Buffer<T>

Source§

fn eval(self, rhs: &T) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &T> for &PVector<T>
where T: NativePType, Op: Operator<T>, for<'a> &'a Buffer<T>: Arithmetic<Op, &'a T, Output = Buffer<T>>,

Implementation that allocates a new output vector against a scalar RHS value.

Source§

type Output = PVector<T>

Source§

fn eval(self, rhs: &T) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &T> for Buffer<T>
where BufferMut<T>: for<'a> Arithmetic<Op, &'a T, Output = Buffer<T>>, for<'a> &'a Buffer<T>: Arithmetic<Op, &'a T, Output = Buffer<T>>,

Implementation that attempts to downcast to a mutable buffer and operates in-place against a scalar RHS value.

Source§

type Output = Buffer<T>

Source§

fn eval(self, rhs: &T) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &T> for BufferMut<T>
where T: Copy, Op: Operator<T>,

Implementation that operates in-place over a mutable buffer against a scalar RHS value.

Source§

type Output = Buffer<T>

Source§

fn eval(self, rhs: &T) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &T> for PVector<T>
where T: NativePType, Op: Operator<T>, PVectorMut<T>: for<'a> Arithmetic<Op, &'a T, Output = PVector<T>>,

Implementation that attempts to downcast to a mutable vector and operates in-place against a scalar RHS value.

Source§

type Output = PVector<T>

Source§

fn eval(self, rhs: &T) -> Self::Output

Source§

impl<Op, T> Arithmetic<Op, &T> for PVectorMut<T>
where T: NativePType, Op: Operator<T>, BufferMut<T>: for<'a> Arithmetic<Op, &'a T, Output = Buffer<T>>,

Implementation that operates in-place over a mutable vector against a scalar RHS value.

Source§

type Output = PVector<T>

Source§

fn eval(self, rhs: &T) -> Self::Output

Implementors§