Trait EvalTypes

Source
pub trait EvalTypes {
    type Coeff;
    type Eval;
    type EvalInfo;

    // Required methods
    fn prep(pts: impl Iterator<Item = Self::Eval>) -> Self::EvalInfo;
    fn post(
        out: &mut impl Extend<Self::Eval>,
        coeffs: &[Self::Coeff],
        info: &Self::EvalInfo,
    ) -> Result<()>;
}
Expand description

Trait for evaluating polynomials over (possibly) a different domain.

Evaluation is divided into pre-processing EvalTypes::prep stage, which depends only on the evaluation points, and the actual evaluation phase EvalTypes::post.

Typically the provided blanket implementations for EvalTrait should be sufficient, unless you care creating a new polynomial type.

Required Associated Types§

Source

type Coeff

Coefficient type of the polynomial being evaluated.

Source

type Eval

Type of the evaluation point(s) and the output(s) of the polynomial evaluation.

Source

type EvalInfo

Opaque type to hold pre-processing results.

Required Methods§

Source

fn prep(pts: impl Iterator<Item = Self::Eval>) -> Self::EvalInfo

Pre-processing for multi-point evaluation.

Takes a list of evaluation points and prepares an EvalInfo opaque object which can be re-used to evaluate multiple polynomials over the same evaluation points.

Source

fn post( out: &mut impl Extend<Self::Eval>, coeffs: &[Self::Coeff], info: &Self::EvalInfo, ) -> Result<()>

Multi-point evaluation after pre-processing.

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<C, U> EvalTypes for EvalTrait<ClassicalTraits<C>, U>
where C: Clone, U: Clone + Zero + MulAssign + AddAssign, DefConv<C, U>: OneWay<Source = C, Dest = U>,