pub trait DenseMVPolynomial<F: Field>: Polynomial<F> {
    type Term: Term;

    // Required methods
    fn from_coefficients_vec(
        num_vars: usize,
        terms: Vec<(F, Self::Term)>
    ) -> Self;
    fn terms(&self) -> &[(F, Self::Term)];
    fn num_vars(&self) -> usize;
    fn rand<R: Rng>(d: usize, num_vars: usize, rng: &mut R) -> Self;

    // Provided method
    fn from_coefficients_slice(
        num_vars: usize,
        terms: &[(F, Self::Term)]
    ) -> Self { ... }
}
Expand description

Describes the interface for multivariate polynomials

Required Associated Types§

source

type Term: Term

The type of the terms of self

Required Methods§

source

fn from_coefficients_vec(num_vars: usize, terms: Vec<(F, Self::Term)>) -> Self

Constructs a new polynomial from a list of tuples of the form (coeff, Self::Term)

source

fn terms(&self) -> &[(F, Self::Term)]

Returns the terms of a self as a list of tuples of the form (coeff, Self::Term)

source

fn num_vars(&self) -> usize

Returns the number of variables in self

source

fn rand<R: Rng>(d: usize, num_vars: usize, rng: &mut R) -> Self

Outputs an l-variate polynomial which is the sum of l d-degree univariate polynomials where each coefficient is sampled uniformly at random.

Provided Methods§

source

fn from_coefficients_slice(num_vars: usize, terms: &[(F, Self::Term)]) -> Self

Constructs a new polynomial from a list of tuples of the form (coeff, Self::Term)

Implementors§