ark_poly::polynomial

Trait Polynomial

Source
pub trait Polynomial<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> {
    type Point: Sized + Clone + Ord + Debug + Sync + Hash;

    // Required methods
    fn degree(&self) -> usize;
    fn evaluate(&self, point: &Self::Point) -> F;
}
Expand description

Describes the common interface for univariate and multivariate polynomials

Required Associated Types§

Source

type Point: Sized + Clone + Ord + Debug + Sync + Hash

The type of evaluation points for this polynomial.

Required Methods§

Source

fn degree(&self) -> usize

Returns the total degree of the polynomial

Source

fn evaluate(&self, point: &Self::Point) -> F

Evaluates self at the given point in Self::Point.

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§

Source§

impl<F: Field> Polynomial<F> for DenseMultilinearExtension<F>

Source§

type Point = Vec<F>

Source§

impl<F: Field> Polynomial<F> for SparseMultilinearExtension<F>

Source§

type Point = Vec<F>

Source§

impl<F: Field> Polynomial<F> for ark_poly::polynomial::multivariate::SparsePolynomial<F, SparseTerm>

Source§

type Point = Vec<F>

Source§

impl<F: Field> Polynomial<F> for DensePolynomial<F>

Source§

type Point = F

Source§

impl<F: Field> Polynomial<F> for ark_poly::polynomial::univariate::SparsePolynomial<F>

Source§

type Point = F