pub struct SingleThreadedNTT<F: BinaryField, TA: TwiddleAccess<F> = OnTheFlyTwiddleAccess<F>> { /* private fields */ }
Expand description
Implementation of AdditiveNTT
that performs the computation single-threaded.
Implementations§
Source§impl<F: BinaryField, TA: TwiddleAccess<F> + Sync> SingleThreadedNTT<F, TA>
impl<F: BinaryField, TA: TwiddleAccess<F> + Sync> SingleThreadedNTT<F, TA>
Sourcepub fn multithreaded(self) -> MultithreadedNTT<F, TA>
pub fn multithreaded(self) -> MultithreadedNTT<F, TA>
Returns multithreaded NTT implementation which uses default number of threads.
Sourcepub const fn multithreaded_with_max_threads(
self,
log_max_threads: usize,
) -> MultithreadedNTT<F, TA>
pub const fn multithreaded_with_max_threads( self, log_max_threads: usize, ) -> MultithreadedNTT<F, TA>
Returns multithreaded NTT implementation which uses 1 << log_max_threads
threads.
Source§impl<F: BinaryField> SingleThreadedNTT<F>
impl<F: BinaryField> SingleThreadedNTT<F>
Sourcepub fn new(log_domain_size: usize) -> Result<Self, Error>
pub fn new(log_domain_size: usize) -> Result<Self, Error>
Default constructor constructs an NTT over the canonical subspace for the field using on-the-fly computed twiddle factors.
Sourcepub fn with_domain_field<FDomain>(log_domain_size: usize) -> Result<Self, Error>where
FDomain: BinaryField,
F: From<FDomain>,
pub fn with_domain_field<FDomain>(log_domain_size: usize) -> Result<Self, Error>where
FDomain: BinaryField,
F: From<FDomain>,
Constructs an NTT over an isomorphic subspace for the given domain field using on-the-fly computed twiddle factors.
pub fn precompute_twiddles( &self, ) -> SingleThreadedNTT<F, PrecomputedTwiddleAccess<F>>
Source§impl<F: TowerField> SingleThreadedNTT<F>
impl<F: TowerField> SingleThreadedNTT<F>
Sourcepub fn with_canonical_field(log_domain_size: usize) -> Result<Self, Error>
pub fn with_canonical_field(log_domain_size: usize) -> Result<Self, Error>
A specialization of with_domain_field
to the canonical tower field.
Source§impl<F: BinaryField, TA: TwiddleAccess<F>> SingleThreadedNTT<F, TA>
impl<F: BinaryField, TA: TwiddleAccess<F>> SingleThreadedNTT<F, TA>
Trait Implementations§
Source§impl<F, TA> AdditiveNTT<F> for SingleThreadedNTT<F, TA>where
F: BinaryField,
TA: TwiddleAccess<F>,
impl<F, TA> AdditiveNTT<F> for SingleThreadedNTT<F, TA>where
F: BinaryField,
TA: TwiddleAccess<F>,
Source§fn log_domain_size(&self) -> usize
fn log_domain_size(&self) -> usize
Base-2 logarithm of the maximum size of the NTT domain, $\ell$.
Source§fn subspace(&self, i: usize) -> BinarySubspace<F>
fn subspace(&self, i: usize) -> BinarySubspace<F>
Returns the binary subspace $S^(i)$. Read more
Source§fn get_subspace_eval(&self, i: usize, j: usize) -> F
fn get_subspace_eval(&self, i: usize, j: usize) -> F
Get the normalized subspace polynomial evaluation $\hat{W}_i(\beta_j)$. Read more
Source§fn forward_transform<P: PackedField<Scalar = F>>(
&self,
data: &mut [P],
coset: u32,
log_batch_size: usize,
log_n: usize,
) -> Result<(), Error>
fn forward_transform<P: PackedField<Scalar = F>>( &self, data: &mut [P], coset: u32, log_batch_size: usize, log_n: usize, ) -> Result<(), Error>
Source§fn inverse_transform<P: PackedField<Scalar = F>>(
&self,
data: &mut [P],
coset: u32,
log_batch_size: usize,
log_n: usize,
) -> Result<(), Error>
fn inverse_transform<P: PackedField<Scalar = F>>( &self, data: &mut [P], coset: u32, log_batch_size: usize, log_n: usize, ) -> Result<(), Error>
fn forward_transform_ext<PE: PackedExtension<F>>( &self, data: &mut [PE], coset: u32, log_n: usize, ) -> Result<(), Error>
fn inverse_transform_ext<PE: PackedExtension<F>>( &self, data: &mut [PE], coset: u32, log_n: usize, ) -> Result<(), Error>
Source§impl<F: Debug + BinaryField, TA: Debug + TwiddleAccess<F>> Debug for SingleThreadedNTT<F, TA>
impl<F: Debug + BinaryField, TA: Debug + TwiddleAccess<F>> Debug for SingleThreadedNTT<F, TA>
Auto Trait Implementations§
impl<F, TA> Freeze for SingleThreadedNTT<F, TA>
impl<F, TA> RefUnwindSafe for SingleThreadedNTT<F, TA>
impl<F, TA> Send for SingleThreadedNTT<F, TA>
impl<F, TA> Sync for SingleThreadedNTT<F, TA>
impl<F, TA> Unpin for SingleThreadedNTT<F, TA>
impl<F, TA> UnwindSafe for SingleThreadedNTT<F, TA>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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