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>

source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate ) -> Result<Self, SerializationError>

The general deserialize method that takes in customization flags.
source§

fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where R: Read,

source§

fn deserialize_compressed_unchecked<R>( reader: R ) -> Result<Self, SerializationError>where R: Read,

source§

fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where R: Read,

source§

fn deserialize_uncompressed_unchecked<R>( reader: R ) -> Result<Self, SerializationError>where R: Read,

source§

impl<F: FftField> CanonicalSerialize for MixedRadixEvaluationDomain<F>

source§

fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress ) -> Result<(), SerializationError>

The general serialize method that takes in customization flags.
source§

fn serialized_size(&self, compress: Compress) -> usize

source§

fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where W: Write,

source§

fn compressed_size(&self) -> usize

source§

fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where W: Write,

source§

fn uncompressed_size(&self) -> usize

source§

impl<F: Clone + FftField> Clone for MixedRadixEvaluationDomain<F>

source§

fn clone(&self) -> MixedRadixEvaluationDomain<F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: FftField> Debug for MixedRadixEvaluationDomain<F>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<F: FftField> EvaluationDomain<F> for MixedRadixEvaluationDomain<F>

source§

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 elements(&self) -> Elements<F>

Return an iterator over the elements of the domain.

§

type Elements = Elements<F>

The type of the elements iterator.
source§

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>

Return the size of a domain that is large enough for evaluations of a polynomial having num_coeffs coefficients.
source§

fn size(&self) -> usize

Return the size of self.
source§

fn log_size_of_group(&self) -> u64

Return log_2(size) of self.
source§

fn size_inv(&self) -> F

Return the inverse of self.size_as_field_element().
source§

fn group_gen(&self) -> F

Return the generator for the multiplicative subgroup that defines this domain.
source§

fn group_gen_inv(&self) -> F

Return the group inverse of self.group_gen().
source§

fn coset_offset(&self) -> F

Return the group offset that defines this domain.
source§

fn coset_offset_inv(&self) -> F

Return the inverse of self.offset().
source§

fn coset_offset_pow_size(&self) -> F

Return offset^size.
source§

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>)

Compute a IFFT, modifying the vector in place.
source§

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>

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

Return the size of self as a field element.
source§

fn fft<T: DomainCoeff<F>>(&self, coeffs: &[T]) -> Vec<T>

Compute a FFT.
source§

fn ifft<T: DomainCoeff<F>>(&self, evals: &[T]) -> Vec<T>

Compute a IFFT.
source§

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 )

Multiply the i-th element of coeffs with c*g^i.
source§

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>

Return the sparse vanishing polynomial.
source§

fn evaluate_vanishing_polynomial(&self, tau: F) -> F

This evaluates the vanishing polynomial for this domain at tau.
source§

fn element(&self, i: usize) -> F

Returns the i-th element of the domain.
source§

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§

fn mul_polynomials_in_evaluation_domain( &self, self_evals: &[F], other_evals: &[F] ) -> Vec<F>

Perform O(n) multiplication of two polynomials that are presented by their evaluations in the domain. Returns the evaluations of the product over the domain. Read more
source§

impl<F: Hash + FftField> Hash for MixedRadixEvaluationDomain<F>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<F: PartialEq + FftField> PartialEq<MixedRadixEvaluationDomain<F>> for MixedRadixEvaluationDomain<F>

source§

fn eq(&self, other: &MixedRadixEvaluationDomain<F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F: FftField> Valid for MixedRadixEvaluationDomain<F>

source§

fn check(&self) -> Result<(), SerializationError>

source§

fn batch_check<'a>( batch: impl Iterator<Item = &'a Self> + Send ) -> Result<(), SerializationError>where Self: 'a,

source§

impl<F: Copy + FftField> Copy for MixedRadixEvaluationDomain<F>

source§

impl<F: Eq + FftField> Eq for MixedRadixEvaluationDomain<F>

source§

impl<F: FftField> StructuralEq for MixedRadixEvaluationDomain<F>

source§

impl<F: FftField> StructuralPartialEq for MixedRadixEvaluationDomain<F>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CanonicalSerializeHashExt for Twhere T: CanonicalSerialize,

source§

fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where H: Digest,

source§

fn hash_uncompressed<H>( &self ) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where H: Digest,

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V