Trait qudoku::Polynomial

source ·
pub trait Polynomial<I, O> {
    // Required methods
    fn evaluate(&self, input: I) -> O;
    fn degree(&self) -> usize;

    // Provided method
    fn interpolation_threshold(&self) -> usize { ... }
}

Required Methods§

source

fn evaluate(&self, input: I) -> O

Evaluate the polynomial on a given input.

source

fn degree(&self) -> usize

Returns the degree of the polynomial, which is usually the number of coefficients minus 1. If the polynomial has no coefficients, it has degree zero.

Provided Methods§

source

fn interpolation_threshold(&self) -> usize

Returns the number of evaluations needed to interpolate this polynomial, which is just the number of coefficients in the polynomial.

Implementors§

source§

impl<I, O> Polynomial<I, O> for LagrangePolynomial<I, O>
where I: Copy + PartialEq + One + Zero + Sub<I, Output = I> + UnsafeDiv<I, Output = I> + Mul<I, Output = I>, O: Copy + Zero + Mul<I, Output = O> + Add<O, Output = O>,

source§

impl<I, T> Polynomial<I, T> for StandardFormPolynomial<T>
where I: Copy, T: Copy + Zero + Mul<I, Output = T> + Add<T, Output = T>,