pub struct ArithmeticDomain {
pub offset: BFieldElement,
pub generator: BFieldElement,
pub length: usize,
}
Fields§
§offset: BFieldElement
§generator: BFieldElement
§length: usize
Implementations§
Source§impl ArithmeticDomain
impl ArithmeticDomain
Sourcepub fn of_length(length: usize) -> Result<Self, ArithmeticDomainError>
pub fn of_length(length: usize) -> Result<Self, ArithmeticDomainError>
Create a new domain with the given length.
No offset is applied, but can be added through with_offset()
.
§Errors
Errors if the domain length is not a power of 2.
Sourcepub fn with_offset(self, offset: BFieldElement) -> Self
pub fn with_offset(self, offset: BFieldElement) -> Self
Set the offset of the domain.
Sourcepub fn generator_for_length(
domain_length: u64,
) -> Result<BFieldElement, ArithmeticDomainError>
pub fn generator_for_length( domain_length: u64, ) -> Result<BFieldElement, ArithmeticDomainError>
Derive a generator for a domain of the given length.
§Errors
Errors if the domain length is not a power of 2.
pub fn evaluate<FF>(&self, polynomial: &Polynomial<'_, FF>) -> Vec<FF>where
FF: FiniteField + MulAssign<BFieldElement> + Mul<BFieldElement, Output = FF> + From<BFieldElement> + 'static,
Sourcepub fn interpolate<FF>(&self, values: &[FF]) -> Polynomial<'static, FF>
pub fn interpolate<FF>(&self, values: &[FF]) -> Polynomial<'static, FF>
§Panics
Panics if the length of the argument does not match the length of self
.
pub fn low_degree_extension<FF>(
&self,
codeword: &[FF],
target_domain: Self,
) -> Vec<FF>where
FF: FiniteField + MulAssign<BFieldElement> + Mul<BFieldElement, Output = FF> + From<BFieldElement> + 'static,
Sourcepub fn domain_value(&self, n: u32) -> BFieldElement
pub fn domain_value(&self, n: u32) -> BFieldElement
Compute the n
th element of the domain.
pub fn domain_values(&self) -> Vec<BFieldElement>
Sourcepub fn zerofier(&self) -> Polynomial<'_, BFieldElement>
pub fn zerofier(&self) -> Polynomial<'_, BFieldElement>
A polynomial that evaluates to 0 on (and only on) a domain value.
Sourcepub fn mul_zerofier_with<FF>(
&self,
polynomial: Polynomial<'_, FF>,
) -> Polynomial<'static, FF>
pub fn mul_zerofier_with<FF>( &self, polynomial: Polynomial<'_, FF>, ) -> Polynomial<'static, FF>
Self::zerofier
times the argument.
More performant than polynomial multiplication.
See Self::zerofier
for details.
Trait Implementations§
Source§impl Clone for ArithmeticDomain
impl Clone for ArithmeticDomain
Source§fn clone(&self) -> ArithmeticDomain
fn clone(&self) -> ArithmeticDomain
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 Debug for ArithmeticDomain
impl Debug for ArithmeticDomain
Source§impl PartialEq for ArithmeticDomain
impl PartialEq for ArithmeticDomain
impl Copy for ArithmeticDomain
impl Eq for ArithmeticDomain
impl StructuralPartialEq for ArithmeticDomain
Auto Trait Implementations§
impl Freeze for ArithmeticDomain
impl RefUnwindSafe for ArithmeticDomain
impl Send for ArithmeticDomain
impl Sync for ArithmeticDomain
impl Unpin for ArithmeticDomain
impl UnwindSafe for ArithmeticDomain
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> 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
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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