pub struct MBSInnerProduct;Expand description
An implementation of inner product that piggies back
on the MulByScalar and CheckedAdd traits.
It does mul_by_scalar for products of terms
and then combines the results using either add or checked_add.
Implementations§
Source§impl MBSInnerProduct
impl MBSInnerProduct
pub fn inner_product_field<Lhs, F>(
lhs: &[Lhs],
rhs: &[F],
zero: F,
) -> Result<F, InnerProductError>where
F: PrimeField + for<'a> FromWithConfig<&'a Lhs>,
Trait Implementations§
Source§impl Clone for MBSInnerProduct
impl Clone for MBSInnerProduct
Source§fn clone(&self) -> MBSInnerProduct
fn clone(&self) -> MBSInnerProduct
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MBSInnerProduct
impl Debug for MBSInnerProduct
Source§impl<Lhs, Rhs, Out> InnerProduct<[Lhs], Rhs, Out> for MBSInnerProduct
impl<Lhs, Rhs, Out> InnerProduct<[Lhs], Rhs, Out> for MBSInnerProduct
Source§fn inner_product<const CHECK: bool>(
lhs: &[Lhs],
rhs: &[Rhs],
zero: Out,
) -> Result<Out, InnerProductError>
fn inner_product<const CHECK: bool>( lhs: &[Lhs], rhs: &[Rhs], zero: Out, ) -> Result<Out, InnerProductError>
The mul-by-scalar inner product.
Auto Trait Implementations§
impl Freeze for MBSInnerProduct
impl RefUnwindSafe for MBSInnerProduct
impl Send for MBSInnerProduct
impl Sync for MBSInnerProduct
impl Unpin for MBSInnerProduct
impl UnsafeUnpin for MBSInnerProduct
impl UnwindSafe for MBSInnerProduct
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more