feanor_math::algorithms::convolution

Trait PreparedConvolutionAlgorithm

Source
pub trait PreparedConvolutionAlgorithm<R: ?Sized + RingBase>: ConvolutionAlgorithm<R> {
    type PreparedConvolutionOperand;

    // Required methods
    fn prepare_convolution_operand<S, V>(
        &self,
        val: V,
        ring: S,
    ) -> Self::PreparedConvolutionOperand
       where S: RingStore<Type = R> + Copy,
             V: VectorView<R::Element>;
    fn compute_convolution_lhs_prepared<S, V>(
        &self,
        lhs: &Self::PreparedConvolutionOperand,
        rhs: V,
        dst: &mut [R::Element],
        ring: S,
    )
       where S: RingStore<Type = R> + Copy,
             V: VectorView<R::Element>;
    fn compute_convolution_prepared<S>(
        &self,
        lhs: &Self::PreparedConvolutionOperand,
        rhs: &Self::PreparedConvolutionOperand,
        dst: &mut [R::Element],
        ring: S,
    )
       where S: RingStore<Type = R> + Copy;

    // Provided methods
    fn compute_convolution_rhs_prepared<S, V>(
        &self,
        lhs: V,
        rhs: &Self::PreparedConvolutionOperand,
        dst: &mut [R::Element],
        ring: S,
    )
       where S: RingStore<Type = R> + Copy,
             V: VectorView<R::Element> { ... }
    fn compute_convolution_inner_product_lhs_prepared<'a, S, I, V>(
        &self,
        values: I,
        dst: &mut [R::Element],
        ring: S,
    )
       where S: RingStore<Type = R> + Copy,
             I: Iterator<Item = (&'a Self::PreparedConvolutionOperand, V)>,
             V: VectorView<R::Element>,
             Self::PreparedConvolutionOperand: 'a { ... }
    fn compute_convolution_inner_product_prepared<'a, S, I>(
        &self,
        values: I,
        dst: &mut [R::Element],
        ring: S,
    )
       where S: RingStore<Type = R> + Copy,
             I: Iterator<Item = (&'a Self::PreparedConvolutionOperand, &'a Self::PreparedConvolutionOperand)>,
             Self::PreparedConvolutionOperand: 'a { ... }
}
Expand description

Trait for convolution algorithms that can “prepare” one (or both) operands in advance by computing additional data, and then use this data to perform the actual convolution more efficiently.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Required Associated Types§

Required Methods§

Source

fn prepare_convolution_operand<S, V>( &self, val: V, ring: S, ) -> Self::PreparedConvolutionOperand
where S: RingStore<Type = R> + Copy, V: VectorView<R::Element>,

Source

fn compute_convolution_lhs_prepared<S, V>( &self, lhs: &Self::PreparedConvolutionOperand, rhs: V, dst: &mut [R::Element], ring: S, )
where S: RingStore<Type = R> + Copy, V: VectorView<R::Element>,

Source

fn compute_convolution_prepared<S>( &self, lhs: &Self::PreparedConvolutionOperand, rhs: &Self::PreparedConvolutionOperand, dst: &mut [R::Element], ring: S, )
where S: RingStore<Type = R> + Copy,

Provided Methods§

Source

fn compute_convolution_rhs_prepared<S, V>( &self, lhs: V, rhs: &Self::PreparedConvolutionOperand, dst: &mut [R::Element], ring: S, )
where S: RingStore<Type = R> + Copy, V: VectorView<R::Element>,

Source

fn compute_convolution_inner_product_lhs_prepared<'a, S, I, V>( &self, values: I, dst: &mut [R::Element], ring: S, )
where S: RingStore<Type = R> + Copy, I: Iterator<Item = (&'a Self::PreparedConvolutionOperand, V)>, V: VectorView<R::Element>, Self::PreparedConvolutionOperand: 'a,

Source

fn compute_convolution_inner_product_prepared<'a, S, I>( &self, values: I, dst: &mut [R::Element], ring: S, )
where S: RingStore<Type = R> + Copy, I: Iterator<Item = (&'a Self::PreparedConvolutionOperand, &'a Self::PreparedConvolutionOperand)>, Self::PreparedConvolutionOperand: 'a,

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§