pub trait MultilinearExtension<F: Field>:
Sized
+ Clone
+ Debug
+ Hash
+ PartialEq
+ Eq
+ Add
+ Neg
+ Zero
+ CanonicalSerialize
+ CanonicalDeserialize
+ for<'a> AddAssign<&'a Self>
+ for<'a> AddAssign<(F, &'a Self)>
+ for<'a> SubAssign<&'a Self>
+ Index<usize>
+ Polynomial<F, Point = Vec<F>> {
// Required methods
fn num_vars(&self) -> usize;
fn rand<R: Rng>(num_vars: usize, rng: &mut R) -> Self;
fn relabel(&self, a: usize, b: usize, k: usize) -> Self;
fn fix_variables(&self, partial_point: &[F]) -> Self;
fn to_evaluations(&self) -> Vec<F>;
}
Expand description
This trait describes an interface for the multilinear extension
of an array.
The latter is a multilinear polynomial represented in terms of its
evaluations over the domain {0,1}^num_vars
(i.e. the Boolean hypercube).
Index represents a point, which is a vector in {0,1}^num_vars
in little
endian form. For example, 0b1011
represents P(1,1,0,1)
Required Methods§
Sourcefn rand<R: Rng>(num_vars: usize, rng: &mut R) -> Self
fn rand<R: Rng>(num_vars: usize, rng: &mut R) -> Self
Outputs an l
-variate multilinear extension where value of evaluations
are sampled uniformly at random.
Sourcefn relabel(&self, a: usize, b: usize, k: usize) -> Self
fn relabel(&self, a: usize, b: usize, k: usize) -> Self
Relabel the point by swapping k
scalars from positions a..a+k
to
positions b..b+k
, and from position b..b+k
to position a..a+k
in vector.
This function turns P(x_1,...,x_a,...,x_{a+k - 1},...,x_b,...,x_{b+k - 1},...,x_n)
to P(x_1,...,x_b,...,x_{b+k - 1},...,x_a,...,x_{a+k - 1},...,x_n)
Sourcefn fix_variables(&self, partial_point: &[F]) -> Self
fn fix_variables(&self, partial_point: &[F]) -> Self
Reduce the number of variables of self
by fixing the
partial_point.len()
variables at partial_point
.
Sourcefn to_evaluations(&self) -> Vec<F>
fn to_evaluations(&self) -> Vec<F>
Returns a list of evaluations over the domain, which is the boolean hypercube. The evaluations are in little-endian order.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.