Skip to main content

ConstArithAlgebra

Trait ConstArithAlgebra 

Source
pub trait ConstArithAlgebra<Value, Const> {
    // Required methods
    fn setc(&mut self, v: &Value, c: Const) -> Value;
    fn addc(&mut self, v: &Value, c: Const) -> Value;
    fn mulc(&mut self, v: &Value, c: Const) -> Value;
    fn powc(&mut self, v: &Value, c: Const) -> Value;
}
Expand description

Element-wise arithmetic operations with a constant value.

Required Methods§

Source

fn setc(&mut self, v: &Value, c: Const) -> Value

Return a value with the same shape as v but filled with constant c.

Source

fn addc(&mut self, v: &Value, c: Const) -> Value

Element-wise addition of a constant v + c.

Source

fn mulc(&mut self, v: &Value, c: Const) -> Value

Element-wise multiplication by a constant v * c.

Source

fn powc(&mut self, v: &Value, c: Const) -> Value

Element-wise exponentiation by a constant v ^ c.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C> ConstArithAlgebra<(), C> for Check

Source§

impl<D, E, Dims, C> ConstArithAlgebra<Value<D>, C> for Graph<Config1<E>>
where E: Default + Clone + CoreAlgebra<D, Value = D> + ArithAlgebra<D> + ConstArithAlgebra<D, C> + LinkedAlgebra<Value<D>, D>, C: Sub<C, Output = C> + One + Clone + 'static + Send + Sync, D: HasDims<Dims = Dims> + Clone + 'static + Send + Sync, Dims: PartialEq + Debug + Clone + 'static + Send + Sync,

Source§

impl<D, E, Dims, C> ConstArithAlgebra<Value<D>, C> for Graph<ConfigN<E>>
where E: Default + Clone + CoreAlgebra<D, Value = D> + ArithAlgebra<D> + ConstArithAlgebra<D, C> + LinkedAlgebra<Value<D>, D>, C: Sub<C, Output = C> + One + Clone + 'static + Send + Sync, D: HasDims<Dims = Dims> + Clone + 'static + Send + Sync, Dims: PartialEq + Debug + Clone + 'static + Send + Sync,

Source§

impl<T, C> ConstArithAlgebra<T, C> for Eval
where T: Number + From<C> + Pow<C, Output = T>,