Struct triton_vm::arithmetic_domain::ArithmeticDomain
source · pub struct ArithmeticDomain {
pub offset: BFieldElement,
pub generator: BFieldElement,
pub length: usize,
}Fields§
§offset: BFieldElement§generator: BFieldElement§length: usizeImplementations§
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>,
pub fn interpolate<FF>(&self, values: &[FF]) -> Polynomial<FF>
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>,
pub fn domain_value(&self, index: u32) -> BFieldElement
pub fn domain_values(&self) -> Vec<BFieldElement>
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
source§fn eq(&self, other: &ArithmeticDomain) -> bool
fn eq(&self, other: &ArithmeticDomain) -> bool
This method tests for
self and other values to be equal, and is used
by ==.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> 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