Trait PreparedMultiplicationRing

Source
pub trait PreparedMultiplicationRing: RingBase {
    type PreparedMultiplicant;

    // Required methods
    fn prepare_multiplicant(
        &self,
        x: &Self::Element,
    ) -> Self::PreparedMultiplicant;
    fn mul_prepared(
        &self,
        lhs: &Self::PreparedMultiplicant,
        rhs: &Self::PreparedMultiplicant,
    ) -> Self::Element;

    // Provided method
    fn inner_product_prepared<'a, I>(&self, parts: I) -> Self::Element
       where I: IntoIterator<Item = (&'a Self::PreparedMultiplicant, &'a Self::PreparedMultiplicant)>,
             Self: 'a { ... }
}

Required Associated Types§

Required Methods§

Source

fn prepare_multiplicant(&self, x: &Self::Element) -> Self::PreparedMultiplicant

Converts an element of the ring into a PreparedMultiplicant, which can then be used to compute multiplications by this element faster.

Source

fn mul_prepared( &self, lhs: &Self::PreparedMultiplicant, rhs: &Self::PreparedMultiplicant, ) -> Self::Element

Computes the product of two elements that have previously been “prepared” via PreparedMultiplicationRing::prepare_multiplicant().

Provided Methods§

Source

fn inner_product_prepared<'a, I>(&self, parts: I) -> Self::Element
where I: IntoIterator<Item = (&'a Self::PreparedMultiplicant, &'a Self::PreparedMultiplicant)>, Self: 'a,

Computes the inner product of two vectors over this ring, whose elements have previously been “prepared” via PreparedMultiplicationRing::prepare_multiplicant().

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§