binius_core::polynomial::multivariate

Trait CompositionPoly

source
pub trait CompositionPoly<P>:
    Debug
    + Send
    + Sync
where P: PackedField,
{ // Required methods fn n_vars(&self) -> usize; fn degree(&self) -> usize; fn evaluate(&self, query: &[P]) -> Result<P, Error>; fn binary_tower_level(&self) -> usize; // Provided method fn sparse_batch_evaluate( &self, sparse_batch_query: &[&[P]], evals: &mut [P], ) -> Result<(), Error> { ... } }
Expand description

A multivariate polynomial that defines a composition of MultilinearComposite.

Required Methods§

source

fn n_vars(&self) -> usize

The number of variables.

source

fn degree(&self) -> usize

Total degree of the polynomial.

source

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.

For example, given a polynomial represented as query[0] + query[1]:

  • The addition operation is applied element-wise between query[0] and query[1].
  • Each scalar value in query[0] is added to the corresponding scalar value in query[1].
  • There are no operations performed between scalar values within the same packed value.
source

fn binary_tower_level(&self) -> usize

Returns the maximum binary tower level of all constants in the arithmetic expression.

Provided Methods§

source

fn sparse_batch_evaluate( &self, sparse_batch_query: &[&[P]], evals: &mut [P], ) -> Result<(), Error>

Batch evaluation that admits non-strided argument layout. sparse_batch_query is a slice of slice references of equal length, which furthermore should equal the length of evals parameter.

Evaluation follows SIMD semantics as in evaluate:

  • evals[j] := composition([sparse_batch_query[i][j] forall i]) forall j
  • no crosstalk between evaluations

This method has a default implementation.

Implementations on Foreign Types§

source§

impl<'a, P, T: 'a + CompositionPoly<P> + ?Sized> CompositionPoly<P> for &'a T
where &'a T: Debug + Send + Sync, P: PackedField,

source§

fn n_vars(&self) -> usize

source§

fn degree(&self) -> usize

source§

fn evaluate(&self, query: &[P]) -> Result<P, Error>

source§

fn binary_tower_level(&self) -> usize

source§

fn sparse_batch_evaluate( &self, sparse_batch_query: &[&[P]], evals: &mut [P], ) -> Result<(), Error>

source§

impl<P, T: CompositionPoly<P> + ?Sized> CompositionPoly<P> for Arc<T>
where Arc<T>: Debug + Send + Sync, P: PackedField,

source§

fn n_vars(&self) -> usize

source§

fn degree(&self) -> usize

source§

fn evaluate(&self, query: &[P]) -> Result<P, Error>

source§

fn binary_tower_level(&self) -> usize

source§

fn sparse_batch_evaluate( &self, sparse_batch_query: &[&[P]], evals: &mut [P], ) -> Result<(), Error>

Implementors§

source§

impl<F, P, Composition> CompositionPoly<F> for CompositionScalarAdapter<P, Composition>
where F: Field, P: PackedField<Scalar = F>, Composition: CompositionPoly<P>,

source§

impl<F: TowerField, P: PackedField<Scalar: ExtensionField<F>>> CompositionPoly<P> for ArithCircuitPoly<F, P>

source§

impl<P, Composition> CompositionPoly<P> for ExtraProduct<Composition>
where P: PackedField, Composition: CompositionPoly<P>,

source§

impl<P, IC> CompositionPoly<P> for MixComposition<P, IC>
where P: PackedField<Scalar: TowerField>, IC: HornerCompositions<P> + Clone + Debug + Send + Sync,

source§

impl<P: PackedField> CompositionPoly<P> for BivariateProduct

source§

impl<P: PackedField> CompositionPoly<P> for IdentityCompositionPoly

source§

impl<P: PackedField, C: CompositionPoly<P>, const N: usize> CompositionPoly<P> for IndexComposition<C, N>