pub struct Mle<F> { /* private fields */ }Expand description
Multilinear extension polynomial, in coefficient form.
Length of coeffs is 2^n where n is hypercube dimension.
Indexing of coeffs is to use the little-endian encoding of integer index as the powers of
variables.
Implementations§
Source§impl<F: Field> Mle<F>
impl<F: Field> Mle<F>
pub fn from_coeffs(coeffs: Vec<F>) -> Self
Sourcepub fn from_evaluations(evals: &[F]) -> Self
pub fn from_evaluations(evals: &[F]) -> Self
Create MLE from evaluations on the hypercube.
Takes evaluations of the polynomial at all points in {0,1}^n and converts them to coefficient form.
The input evals should have length 2^n where n is the number of variables.
The evaluation at index i corresponds to the point whose binary representation
is i (with bit 0 being the least significant).
pub fn into_coeffs(self) -> Vec<F>
Sourcepub fn eval_at_point<F2: Field, EF: ExtensionField<F> + Mul<F2, Output = EF>>(
&self,
x: &[F2],
) -> EF
pub fn eval_at_point<F2: Field, EF: ExtensionField<F> + Mul<F2, Output = EF>>( &self, x: &[F2], ) -> EF
Evaluate with O(1) extra memory via naive algorithm.
Performs N*log(N)/2 multiplications when N = x.len() is a power of two.
Sourcepub fn eval_at_point_inplace<F2>(self, x: &[F2]) -> Fwhere
F2: Field,
F: ExtensionField<F2>,
pub fn eval_at_point_inplace<F2>(self, x: &[F2]) -> Fwhere
F2: Field,
F: ExtensionField<F2>,
Evaluate with O(1) extra memory but consuming self.
Performs N - 1 multiplications for N = x.len().
pub fn evals_to_coeffs_inplace(a: &mut [F])
pub fn coeffs_to_evals_inplace(a: &mut [F])
Auto Trait Implementations§
impl<F> Freeze for Mle<F>
impl<F> RefUnwindSafe for Mle<F>where
F: RefUnwindSafe,
impl<F> Send for Mle<F>where
F: Send,
impl<F> Sync for Mle<F>where
F: Sync,
impl<F> Unpin for Mle<F>where
F: Unpin,
impl<F> UnsafeUnpin for Mle<F>
impl<F> UnwindSafe for Mle<F>where
F: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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>
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>
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