Skip to main content

InnerProduct

Trait InnerProduct 

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

A trait for inner product algorithms implementations.

C is the config needed to perform the operations: () for self-sufficient types, or a field config for dynamic field elements.

Required Methods§

Source

fn inner_product<const CHECK: bool>( cfg: &C, 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<C> InnerProduct<C, [<C as SetConfig>::Element], <C as SetConfig>::Element, <C as SetConfig>::Element> for NativeInnerProduct
where C: SemiringConfig,

Source§

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

Source§

impl<C, Lhs, Rhs, Out> InnerProduct<C, Lhs, Rhs, Out> for ScalarProduct
where Out: FromRef<Lhs> + MulByScalar<Rhs, Out>,

Source§

impl<C, Rhs> InnerProduct<C, [<C as SetConfig>::Element], Rhs, <C as SetConfig>::Element> for FieldInnerProduct
where C: SemiringConfig + ProjectElementWithConfig<Rhs>,

Source§

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