pub struct MixedRadixEvaluationDomain<F: FftField> {
pub size: u64,
pub log_size_of_group: u32,
pub size_as_field_element: F,
pub size_inv: F,
pub group_gen: F,
pub group_gen_inv: F,
pub offset: F,
pub offset_inv: F,
pub offset_pow_size: F,
}
Expand description
Defines a domain over which finite field (I)FFTs can be performed. Works only for fields that have a multiplicative subgroup of size that is a power-of-2 and another small subgroup over a different base defined.
Fields§
§size: u64
The size of the domain.
log_size_of_group: u32
log_2(self.size)
.
size_as_field_element: F
Size of the domain as a field element.
size_inv: F
Inverse of the size in the field.
group_gen: F
A generator of the subgroup.
group_gen_inv: F
Inverse of the generator of the subgroup.
offset: F
Offset that specifies the coset.
offset_inv: F
Inverse of the offset that specifies the coset.
offset_pow_size: F
Constant coefficient for the vanishing polynomial.
Equals self.offset^self.size
.
Trait Implementations§
Source§impl<F: FftField> CanonicalDeserialize for MixedRadixEvaluationDomain<F>
impl<F: FftField> CanonicalDeserialize for MixedRadixEvaluationDomain<F>
Source§fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Self, SerializationError>
fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>
The general deserialize method that takes in customization flags.
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
Source§impl<F: FftField> CanonicalSerialize for MixedRadixEvaluationDomain<F>
impl<F: FftField> CanonicalSerialize for MixedRadixEvaluationDomain<F>
Source§fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>
fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>
The general serialize method that takes in customization flags.
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
Source§impl<F: Clone + FftField> Clone for MixedRadixEvaluationDomain<F>
impl<F: Clone + FftField> Clone for MixedRadixEvaluationDomain<F>
Source§fn clone(&self) -> MixedRadixEvaluationDomain<F>
fn clone(&self) -> MixedRadixEvaluationDomain<F>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<F: FftField> Debug for MixedRadixEvaluationDomain<F>
impl<F: FftField> Debug for MixedRadixEvaluationDomain<F>
Source§impl<F: FftField> EvaluationDomain<F> for MixedRadixEvaluationDomain<F>
impl<F: FftField> EvaluationDomain<F> for MixedRadixEvaluationDomain<F>
Source§fn new(num_coeffs: usize) -> Option<Self>
fn new(num_coeffs: usize) -> Option<Self>
Construct a domain that is large enough for evaluations of a polynomial
having num_coeffs
coefficients.
Source§fn get_coset(&self, offset: F) -> Option<Self>
fn get_coset(&self, offset: F) -> Option<Self>
Construct a coset domain from a subgroup domain
Source§fn compute_size_of_domain(num_coeffs: usize) -> Option<usize>
fn compute_size_of_domain(num_coeffs: usize) -> Option<usize>
Return the size of a domain that is large enough for evaluations of a
polynomial having
num_coeffs
coefficients.Source§fn log_size_of_group(&self) -> u64
fn log_size_of_group(&self) -> u64
Return log_2(size) of
self
.Source§fn group_gen(&self) -> F
fn group_gen(&self) -> F
Return the generator for the multiplicative subgroup that defines this domain.
Source§fn group_gen_inv(&self) -> F
fn group_gen_inv(&self) -> F
Return the group inverse of
self.group_gen()
.Source§fn coset_offset(&self) -> F
fn coset_offset(&self) -> F
Return the group offset that defines this domain.
Source§fn coset_offset_inv(&self) -> F
fn coset_offset_inv(&self) -> F
Return the inverse of
self.offset()
.Source§fn coset_offset_pow_size(&self) -> F
fn coset_offset_pow_size(&self) -> F
Return
offset^size
.Source§fn fft_in_place<T: DomainCoeff<F>>(&self, coeffs: &mut Vec<T>)
fn fft_in_place<T: DomainCoeff<F>>(&self, coeffs: &mut Vec<T>)
Compute a FFT, modifying the vector in place.
Source§fn ifft_in_place<T: DomainCoeff<F>>(&self, evals: &mut Vec<T>)
fn ifft_in_place<T: DomainCoeff<F>>(&self, evals: &mut Vec<T>)
Compute a IFFT, modifying the vector in place.
Source§fn sample_element_outside_domain<R: Rng>(&self, rng: &mut R) -> F
fn sample_element_outside_domain<R: Rng>(&self, rng: &mut R) -> F
Sample an element that is not in the domain.
Source§fn new_coset(num_coeffs: usize, offset: F) -> Option<Self>
fn new_coset(num_coeffs: usize, offset: F) -> Option<Self>
Construct a coset domain that is large enough for evaluations of a polynomial
having
num_coeffs
coefficients.Source§fn size_as_field_element(&self) -> F
fn size_as_field_element(&self) -> F
Return the size of
self
as a field element.Source§fn distribute_powers<T: DomainCoeff<F>>(coeffs: &mut [T], g: F)
fn distribute_powers<T: DomainCoeff<F>>(coeffs: &mut [T], g: F)
Multiply the
i
-th element of coeffs
with g^i
.Source§fn distribute_powers_and_mul_by_const<T: DomainCoeff<F>>(
coeffs: &mut [T],
g: F,
c: F,
)
fn distribute_powers_and_mul_by_const<T: DomainCoeff<F>>( coeffs: &mut [T], g: F, c: F, )
Multiply the
i
-th element of coeffs
with c*g^i
.Source§fn evaluate_all_lagrange_coefficients(&self, tau: F) -> Vec<F>
fn evaluate_all_lagrange_coefficients(&self, tau: F) -> Vec<F>
Evaluate all the lagrange polynomials defined by this domain at the
point
tau
. This is computed in time O(|domain|).
Then given the evaluations of a degree d polynomial P over this domain,
where d < |domain|, P(tau)
can be computed as
P(tau) = sum_{i in [|Domain|]} L_{i, Domain}(tau) * P(g^i)
.
L_{i, Domain}
is the value of the i-th lagrange coefficient
in the returned vector.Source§fn vanishing_polynomial(&self) -> SparsePolynomial<F>
fn vanishing_polynomial(&self) -> SparsePolynomial<F>
Return the sparse vanishing polynomial.
Source§fn evaluate_vanishing_polynomial(&self, tau: F) -> F
fn evaluate_vanishing_polynomial(&self, tau: F) -> F
This evaluates the vanishing polynomial for this domain at tau.
Source§fn filter_polynomial(&self, subdomain: &Self) -> DensePolynomial<F>
fn filter_polynomial(&self, subdomain: &Self) -> DensePolynomial<F>
Return the filter polynomial of
self
with respect to the subdomain subdomain
.
Assumes that subdomain
is contained within self
. Read moreSource§fn evaluate_filter_polynomial(&self, subdomain: &Self, tau: F) -> F
fn evaluate_filter_polynomial(&self, subdomain: &Self, tau: F) -> F
This evaluates at
tau
the filter polynomial for self
with respect
to the subdomain subdomain
.Source§fn reindex_by_subdomain(&self, other: Self, index: usize) -> usize
fn reindex_by_subdomain(&self, other: Self, index: usize) -> usize
Given an index which assumes the first elements of this domain are the
elements of another (sub)domain,
this returns the actual index into this domain.
Source§impl<F: PartialEq + FftField> PartialEq for MixedRadixEvaluationDomain<F>
impl<F: PartialEq + FftField> PartialEq for MixedRadixEvaluationDomain<F>
Source§fn eq(&self, other: &MixedRadixEvaluationDomain<F>) -> bool
fn eq(&self, other: &MixedRadixEvaluationDomain<F>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<F: FftField> Valid for MixedRadixEvaluationDomain<F>
impl<F: FftField> Valid for MixedRadixEvaluationDomain<F>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send,
) -> Result<(), SerializationError>where
Self: 'a,
impl<F: Copy + FftField> Copy for MixedRadixEvaluationDomain<F>
impl<F: Eq + FftField> Eq for MixedRadixEvaluationDomain<F>
impl<F: FftField> StructuralPartialEq for MixedRadixEvaluationDomain<F>
Auto Trait Implementations§
impl<F> Freeze for MixedRadixEvaluationDomain<F>where
F: Freeze,
impl<F> RefUnwindSafe for MixedRadixEvaluationDomain<F>where
F: RefUnwindSafe,
impl<F> Send for MixedRadixEvaluationDomain<F>
impl<F> Sync for MixedRadixEvaluationDomain<F>
impl<F> Unpin for MixedRadixEvaluationDomain<F>where
F: Unpin,
impl<F> UnwindSafe for MixedRadixEvaluationDomain<F>where
F: 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> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
fn hash_uncompressed<H>(
&self,
) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)