ark_poly::polynomial

Trait DenseMVPolynomial

Source
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)

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.

Implementors§