Struct ark_poly::evaluations::multivariate::multilinear::SparseMultilinearExtension [−][src]
pub struct SparseMultilinearExtension<F: Field> { pub evaluations: BTreeMap<usize, F>, pub num_vars: usize, // some fields omitted }
Expand description
Stores a multilinear polynomial in sparse evaluation form.
Fields
evaluations: BTreeMap<usize, F>tuples of index and value
num_vars: usizenumber of variables
Implementations
pub fn from_evaluations<'a>(
num_vars: usize,
evaluations: impl IntoIterator<Item = &'a (usize, F)>
) -> Self[src]pub fn rand_with_config<R: Rng>(
num_vars: usize,
num_nonzero_entries: usize,
rng: &mut R
) -> Self[src]
pub fn rand_with_config<R: Rng>(
num_vars: usize,
num_nonzero_entries: usize,
rng: &mut R
) -> Self[src]Outputs an l-variate multilinear extension where value of evaluations are sampled uniformly at random.
The number of nonzero entries is num_nonzero_entries and indices of those nonzero entries are distributed uniformly at random.
Note that this function uses rejection sampling. As number of nonzero entries approach 2 ^ num_vars,
sampling will be very slow due to large number of collisions.
Convert the sparse multilinear polynomial to dense form.
Trait Implementations
impl<'a, 'b, F: Field> Add<&'a SparseMultilinearExtension<F>> for &'b SparseMultilinearExtension<F>[src]
impl<'a, 'b, F: Field> Add<&'a SparseMultilinearExtension<F>> for &'b SparseMultilinearExtension<F>[src]type Output = SparseMultilinearExtension<F>
type Output = SparseMultilinearExtension<F>The resulting type after applying the + operator.
Performs the + operation. Read more
type Output = SparseMultilinearExtension<F>
type Output = SparseMultilinearExtension<F>The resulting type after applying the + operator.
Performs the + operation. Read more
impl<'a, 'b, F: Field> AddAssign<&'a SparseMultilinearExtension<F>> for SparseMultilinearExtension<F>[src]
impl<'a, 'b, F: Field> AddAssign<&'a SparseMultilinearExtension<F>> for SparseMultilinearExtension<F>[src]Performs the += operation. Read more
impl<'a, 'b, F: Field> AddAssign<(F, &'a SparseMultilinearExtension<F>)> for SparseMultilinearExtension<F>[src]
impl<'a, 'b, F: Field> AddAssign<(F, &'a SparseMultilinearExtension<F>)> for SparseMultilinearExtension<F>[src]Performs the += operation. Read more
Performs the += operation. Read more
Reads Self from reader.
Reads Self from reader without compression.
Reads self from reader without compression, and without performing
validity checks. Should be used only when the input is trusted. Read more
Serializes self into writer.
It is left up to a particular type for how it strikes the
serialization efficiency vs compression tradeoff.
For standard types (e.g. bool, lengths, etc.) typically an uncompressed
form is used, whereas for algebraic types compressed forms are used. Read more
Serializes self into writer without compression.
Serializes self into writer without compression, and without
performing validity checks. Should be used only when there is no
danger of adversarial manipulation of the output. Read more
Returns the “default value” for a type. Read more
Returns the evaluation of the polynomial at a point represented by index.
Index represents a vector in {0,1}^num_vars in little endian form. For example, 0b1011 represents P(1,1,0,1)
For Sparse multilinear polynomial, Lookup_evaluation takes log time to the size of polynomial.
type Output = F
type Output = FThe returned type after indexing.
Outputs an l-variate multilinear extension where value of evaluations are sampled uniformly at random.
The number of nonzero entries is sqrt(2^num_vars) and indices of those nonzero entries are distributed uniformly at random.
Evaluates self at the given the vector point in slice.
If the number of variables does not match, return None. Read more
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. Read more
Reduce the number of variables of self by fixing the partial_point.len() variables at partial_point.
Returns a list of evaluations over the domain, which is the boolean hypercube.
impl<F: PartialEq + Field> PartialEq<SparseMultilinearExtension<F>> for SparseMultilinearExtension<F>[src]
impl<F: PartialEq + Field> PartialEq<SparseMultilinearExtension<F>> for SparseMultilinearExtension<F>[src]This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
impl<'a, 'b, F: Field> Sub<&'a SparseMultilinearExtension<F>> for &'b SparseMultilinearExtension<F>[src]
impl<'a, 'b, F: Field> Sub<&'a SparseMultilinearExtension<F>> for &'b SparseMultilinearExtension<F>[src]type Output = SparseMultilinearExtension<F>
type Output = SparseMultilinearExtension<F>The resulting type after applying the - operator.
Performs the - operation. Read more
type Output = SparseMultilinearExtension<F>
type Output = SparseMultilinearExtension<F>The resulting type after applying the - operator.
Performs the - operation. Read more
impl<'a, 'b, F: Field> SubAssign<&'a SparseMultilinearExtension<F>> for SparseMultilinearExtension<F>[src]
impl<'a, 'b, F: Field> SubAssign<&'a SparseMultilinearExtension<F>> for SparseMultilinearExtension<F>[src]Performs the -= operation. Read more
Performs the -= operation. Read more
Auto Trait Implementations
impl<F> Send for SparseMultilinearExtension<F>impl<F> Sync for SparseMultilinearExtension<F>impl<F> Unpin for SparseMultilinearExtension<F> where
F: Unpin, Blanket Implementations
Mutably borrows from an owned value. Read more
pub default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64 where
B: BuildHasher,
H: Hash + ?Sized, fn hash_uncompressed<H>(&self) -> GenericArray<u8, <H as Digest>::OutputSize> where
H: Digest, [src]type Output = T
type Output = TShould always be Self
pub fn vzip(self) -> V