pub struct NTTConvolution<R, A = Global>{ /* private fields */ }Expand description
Computes the convolution over a finite field that has suitable roots of unity using a power-of-two length FFT (sometimes called Number-Theoretic Transform, NTT in this context).
§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.
Implementations§
Trait Implementations§
Source§impl<R, A> ConvolutionAlgorithm<<R as RingStore>::Type> for NTTConvolution<R, A>
impl<R, A> ConvolutionAlgorithm<<R as RingStore>::Type> for NTTConvolution<R, A>
Source§fn supports_ring<S: RingStore<Type = R::Type> + Copy>(&self, ring: S) -> bool
fn supports_ring<S: RingStore<Type = R::Type> + Copy>(&self, ring: S) -> bool
Returns whether this convolution algorithm supports computations of
the given ring. Read more
Source§fn compute_convolution<S: RingStore<Type = R::Type> + Copy, V1: VectorView<<R::Type as RingBase>::Element>, V2: VectorView<<R::Type as RingBase>::Element>>(
&self,
lhs: V1,
rhs: V2,
dst: &mut [El<R>],
ring: S,
)
fn compute_convolution<S: RingStore<Type = R::Type> + Copy, V1: VectorView<<R::Type as RingBase>::Element>, V2: VectorView<<R::Type as RingBase>::Element>>( &self, lhs: V1, rhs: V2, dst: &mut [El<R>], ring: S, )
Source§fn specialize_prepared_convolution<F>(function: F) -> Result<F::Output, F>where
F: PreparedConvolutionOperation<Self, R::Type>,
fn specialize_prepared_convolution<F>(function: F) -> Result<F::Output, F>where
F: PreparedConvolutionOperation<Self, R::Type>,
If this convolution implements
PreparedConvolutionAlgorithm, then
the given function is called and its result is returned. Otherwise,
Err is returned.Source§impl<R, A> PreparedConvolutionAlgorithm<<R as RingStore>::Type> for NTTConvolution<R, A>
impl<R, A> PreparedConvolutionAlgorithm<<R as RingStore>::Type> for NTTConvolution<R, A>
type PreparedConvolutionOperand = PreparedConvolutionOperand<R, A>
fn prepare_convolution_operand<S: RingStore<Type = R::Type> + Copy, V: VectorView<El<R>>>( &self, val: V, ring: S, ) -> Self::PreparedConvolutionOperand
fn compute_convolution_lhs_prepared<S: RingStore<Type = R::Type> + Copy, V: VectorView<El<R>>>( &self, lhs: &Self::PreparedConvolutionOperand, rhs: V, dst: &mut [El<R>], ring: S, )
fn compute_convolution_prepared<S: RingStore<Type = R::Type> + Copy>( &self, lhs: &Self::PreparedConvolutionOperand, rhs: &Self::PreparedConvolutionOperand, dst: &mut [El<R>], ring: S, )
fn compute_convolution_inner_product_prepared<'a, S, I>(
&self,
values: I,
dst: &mut [El<R>],
ring: S,
)where
S: RingStore<Type = R::Type> + Copy,
I: Iterator<Item = (&'a Self::PreparedConvolutionOperand, &'a Self::PreparedConvolutionOperand)>,
Self: 'a,
R: 'a,
PreparedConvolutionOperand<R, A>: 'a,
fn compute_convolution_rhs_prepared<S, V>( &self, lhs: V, rhs: &Self::PreparedConvolutionOperand, dst: &mut [R::Element], ring: S, )
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: 'a,
R: 'a,
Self::PreparedConvolutionOperand: 'a,
Auto Trait Implementations§
impl<R, A = Global> !Freeze for NTTConvolution<R, A>
impl<R, A = Global> !RefUnwindSafe for NTTConvolution<R, A>
impl<R, A> Send for NTTConvolution<R, A>
impl<R, A> Sync for NTTConvolution<R, A>
impl<R, A> Unpin for NTTConvolution<R, A>
impl<R, A> UnwindSafe for NTTConvolution<R, A>where
R: UnwindSafe + RefUnwindSafe,
A: UnwindSafe,
<<R as RingStore>::Type as RingBase>::Element: RefUnwindSafe + UnwindSafe,
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> 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