pub struct DenseMultilinearPolynomial<F: IsField>{ /* private fields */ }
Expand description
Represents a multilinear polynomials as a vector of evaluations (FieldElements) in lagrange basis
Implementations§
source§impl<F: IsField> DenseMultilinearPolynomial<F>
impl<F: IsField> DenseMultilinearPolynomial<F>
sourcepub fn new(evals: Vec<FieldElement<F>>) -> Self
pub fn new(evals: Vec<FieldElement<F>>) -> Self
Build a new multilinear polynomial, from collection of evaluations
pub fn num_vars(&self) -> usize
pub fn evals(&self) -> &Vec<FieldElement<F>>
pub fn len(&self) -> usize
sourcepub fn evaluate(
&self,
r: Vec<FieldElement<F>>,
) -> Result<FieldElement<F>, MultilinearError>
pub fn evaluate( &self, r: Vec<FieldElement<F>>, ) -> Result<FieldElement<F>, MultilinearError>
Evaluates self
at the point p
in O(n) time.
pub fn evaluate_with( evals: &[FieldElement<F>], r: &[FieldElement<F>], ) -> Result<FieldElement<F>, MultilinearError>
sourcepub fn extend(&mut self, other: &DenseMultilinearPolynomial<F>)
pub fn extend(&mut self, other: &DenseMultilinearPolynomial<F>)
Extends a DenseMultilinearPolynomial by concatenating other
polynomial of the same length.
sourcepub fn merge(
polys: &[DenseMultilinearPolynomial<F>],
) -> DenseMultilinearPolynomial<F>
pub fn merge( polys: &[DenseMultilinearPolynomial<F>], ) -> DenseMultilinearPolynomial<F>
Merges a series of DenseMultilienarPolynomials into one polynomial. Zero-pads the final merged polynomial to the next power_of_two length if necessary.
pub fn from_u64(evals: &[u64]) -> Self
pub fn scalar_mul(&self, scalar: &FieldElement<F>) -> Self
Trait Implementations§
source§impl<F: IsField> Add for DenseMultilinearPolynomial<F>
impl<F: IsField> Add for DenseMultilinearPolynomial<F>
Adds another multilinear polynomial to self
.
Assumes the two polynomials have the same number of variables.
source§impl<F: Clone + IsField> Clone for DenseMultilinearPolynomial<F>
impl<F: Clone + IsField> Clone for DenseMultilinearPolynomial<F>
source§fn clone(&self) -> DenseMultilinearPolynomial<F>
fn clone(&self) -> DenseMultilinearPolynomial<F>
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<F: IsField> Index<usize> for DenseMultilinearPolynomial<F>
impl<F: IsField> Index<usize> for DenseMultilinearPolynomial<F>
source§type Output = FieldElement<F>
type Output = FieldElement<F>
The returned type after indexing.
source§impl<F: IsField> Mul<&FieldElement<F>> for DenseMultilinearPolynomial<F>
impl<F: IsField> Mul<&FieldElement<F>> for DenseMultilinearPolynomial<F>
source§type Output = DenseMultilinearPolynomial<F>
type Output = DenseMultilinearPolynomial<F>
The resulting type after applying the
*
operator.source§impl<F: IsField> Mul<FieldElement<F>> for DenseMultilinearPolynomial<F>
impl<F: IsField> Mul<FieldElement<F>> for DenseMultilinearPolynomial<F>
source§type Output = DenseMultilinearPolynomial<F>
type Output = DenseMultilinearPolynomial<F>
The resulting type after applying the
*
operator.source§impl<F: PartialEq + IsField> PartialEq for DenseMultilinearPolynomial<F>
impl<F: PartialEq + IsField> PartialEq for DenseMultilinearPolynomial<F>
source§fn eq(&self, other: &DenseMultilinearPolynomial<F>) -> bool
fn eq(&self, other: &DenseMultilinearPolynomial<F>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl<F: IsField> StructuralPartialEq for DenseMultilinearPolynomial<F>
Auto Trait Implementations§
impl<F> Freeze for DenseMultilinearPolynomial<F>
impl<F> RefUnwindSafe for DenseMultilinearPolynomial<F>
impl<F> Send for DenseMultilinearPolynomial<F>
impl<F> Sync for DenseMultilinearPolynomial<F>
impl<F> Unpin for DenseMultilinearPolynomial<F>
impl<F> UnwindSafe for DenseMultilinearPolynomial<F>
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<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