Skip to main content

InnerProduct

Trait InnerProduct 

Source
pub trait InnerProduct<Lhs: ?Sized, Rhs, Output> {
    // Required method
    fn inner_product<const CHECK: bool>(
        lhs: &Lhs,
        rhs: &[Rhs],
        zero: Output,
    ) -> Result<Output, InnerProductError>;
}
Expand description

A trait for inner product algorithms implementations.

Required Methods§

Source

fn inner_product<const CHECK: bool>( lhs: &Lhs, rhs: &[Rhs], zero: Output, ) -> Result<Output, InnerProductError>

The main entry point for the inner product. CHECK determines whether the implementation should check for overflow.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Lhs, Rhs, Out> InnerProduct<[Lhs], Rhs, Out> for MBSInnerProduct
where Out: FromRef<Lhs> + for<'a> MulByScalar<&'a Rhs> + CheckedAdd,

Source§

impl<Lhs, Rhs, Out> InnerProduct<Lhs, Rhs, Out> for ScalarProduct
where Out: for<'a> MulByScalar<&'a Rhs> + FromRef<Lhs>,

Source§

impl<Rhs: Clone, Out: FromRef<Rhs> + CheckedAdd> InnerProduct<[Boolean], Rhs, Out> for BooleanInnerProductAdd