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 fn multithreaded_with_max_threads(
self,
log_max_threads: usize,
) -> MultithreadedNTT<F, TA>
pub 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<DomainField: BinaryField + Into<F>>(
log_domain_size: usize,
) -> Result<Self, Error>
pub fn with_domain_field<DomainField: BinaryField + Into<F>>( log_domain_size: usize, ) -> Result<Self, Error>
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>
pub fn with_twiddle_access(twiddle_access: Vec<TA>) -> Self
sourcepub fn log_domain_size(&self) -> usize
pub fn log_domain_size(&self) -> usize
Base-2 logarithm of the size of the NTT domain.
sourcepub fn get_subspace_eval(&self, i: usize, j: usize) -> F
pub fn get_subspace_eval(&self, i: usize, j: usize) -> F
Get the normalized subspace polynomial evaluation $\hat{W}_i(\beta_j)$.
§Preconditions
i
must be less thanself.log_domain_size()
j
must be less thanself.log_domain_size() - i
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, P> AdditiveNTT<P> for SingleThreadedNTT<F, TA>
impl<F, TA, P> AdditiveNTT<P> for SingleThreadedNTT<F, TA>
source§fn log_domain_size(&self) -> usize
fn log_domain_size(&self) -> usize
Base-2 logarithm of the size of the NTT domain.
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(
&self,
data: &mut [P],
coset: u32,
log_batch_size: usize,
) -> Result<(), Error>
fn forward_transform( &self, data: &mut [P], coset: u32, log_batch_size: usize, ) -> Result<(), Error>
source§fn inverse_transform(
&self,
data: &mut [P],
coset: u32,
log_batch_size: usize,
) -> Result<(), Error>
fn inverse_transform( &self, data: &mut [P], coset: u32, log_batch_size: usize, ) -> Result<(), Error>
fn forward_transform_ext<PE>( &self, data: &mut [PE], coset: u32, ) -> Result<(), Error>
fn inverse_transform_ext<PE>( &self, data: &mut [PE], coset: u32, ) -> 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