Trait sprs::MulAcc

source ·
pub trait MulAcc<A = Self, B = A> {
    // Required method
    fn mul_acc(&mut self, a: &A, b: &B);
}
Expand description

Trait for types that have a multiply-accumulate operation, as required in dot products and matrix products.

This trait is automatically implemented for numeric types that are Copy, however the implementation is open for more complex types, to allow them to provide the most performant implementation. For instance, we could have a default implementation for numeric types that are Clone, but it would make possibly unnecessary copies.

Required Methods§

source

fn mul_acc(&mut self, a: &A, b: &B)

Multiply and accumulate in this variable, formally *self += a * b.

Implementors§

source§

impl<N, A, B> MulAcc<A, B> for Nwhere for<'x> &'x A: Mul<&'x B, Output = N>, N: AddAssign<N>,

Default for types which supports mul_add