pub struct CachedPoly<F: Field, Inner: CompositionPoly<F>> { /* private fields */ }
Expand description
Cached composition poly wrapper.
It stores the efficient implementations of the composition poly for some known set of packed field types. We are usually able to use this when the inner poly is constructed with a macro for the known field and packed field types.
Implementations§
source§impl<F: Field, Inner: CompositionPoly<F>> CachedPoly<F, Inner>
impl<F: Field, Inner: CompositionPoly<F>> CachedPoly<F, Inner>
sourcepub fn new(inner: Inner) -> Self
pub fn new(inner: Inner) -> Self
Create a new cached polynomial with the given inner polynomial.
sourcepub fn register<P: PackedField<Scalar: ExtensionField<F>>>(
&mut self,
composition: impl CompositionPolyOS<P> + 'static,
)
pub fn register<P: PackedField<Scalar: ExtensionField<F>>>( &mut self, composition: impl CompositionPolyOS<P> + 'static, )
Register efficient implementations for the P
packed field type in the cache.
Trait Implementations§
source§impl<F: Field, Inner: CompositionPoly<F>> CompositionPoly<F> for CachedPoly<F, Inner>
impl<F: Field, Inner: CompositionPoly<F>> CompositionPoly<F> for CachedPoly<F, Inner>
fn n_vars(&self) -> usize
fn degree(&self) -> usize
fn binary_tower_level(&self) -> usize
fn evaluate<P: PackedField<Scalar: ExtensionField<F>>>( &self, query: &[P], ) -> Result<P, Error>
fn batch_evaluate<P: PackedField<Scalar: ExtensionField<F>>>( &self, batch_query: &[&[P]], evals: &mut [P], ) -> Result<(), Error>
source§impl<F: Field, Inner: CompositionPoly<F>, P: PackedField<Scalar: ExtensionField<F>>> CompositionPolyOS<P> for CachedPoly<F, Inner>
impl<F: Field, Inner: CompositionPoly<F>, P: PackedField<Scalar: ExtensionField<F>>> CompositionPolyOS<P> for CachedPoly<F, Inner>
source§fn binary_tower_level(&self) -> usize
fn binary_tower_level(&self) -> usize
Returns the maximum binary tower level of all constants in the arithmetic expression.
source§fn evaluate(&self, query: &[P]) -> Result<P, Error>
fn evaluate(&self, query: &[P]) -> Result<P, Error>
Evaluates the polynomial using packed values, where each packed value may contain multiple scalar values.
The evaluation follows SIMD semantics, meaning that operations are performed
element-wise across corresponding scalar values in the packed values. Read more
source§impl<F: Debug + Field, Inner: Debug + CompositionPoly<F>> Debug for CachedPoly<F, Inner>
impl<F: Debug + Field, Inner: Debug + CompositionPoly<F>> Debug for CachedPoly<F, Inner>
source§impl<F: Default + Field, Inner: Default + CompositionPoly<F>> Default for CachedPoly<F, Inner>
impl<F: Default + Field, Inner: Default + CompositionPoly<F>> Default for CachedPoly<F, Inner>
source§fn default() -> CachedPoly<F, Inner>
fn default() -> CachedPoly<F, Inner>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<F, Inner> Freeze for CachedPoly<F, Inner>
impl<F, Inner> !RefUnwindSafe for CachedPoly<F, Inner>
impl<F, Inner> Send for CachedPoly<F, Inner>
impl<F, Inner> Sync for CachedPoly<F, Inner>
impl<F, Inner> Unpin for CachedPoly<F, Inner>
impl<F, Inner> !UnwindSafe for CachedPoly<F, Inner>
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