[][src]Trait rustnomial::Evaluable

pub trait Evaluable<N> {
    pub fn eval(&self, point: N) -> N;
}

Required methods

pub fn eval(&self, point: N) -> N[src]

Loading content...

Implementors

impl<N> Evaluable<N> for LinearBinomial<N> where
    N: Add<Output = N> + Mul<Output = N> + Copy
[src]

pub fn eval(&self, point: N) -> N[src]

Returns the value of the LinearBinomial at the given point.

Example

use rustnomial::{LinearBinomial, Evaluable};
let binomial = LinearBinomial::new([1, 2]);
assert_eq!(7, binomial.eval(5));
assert_eq!(2, binomial.eval(0));

impl<N> Evaluable<N> for Monomial<N> where
    N: PowUsize + Mul<Output = N> + Copy
[src]

pub fn eval(&self, point: N) -> N[src]

Returns the value of the Monomial at the given point.

Example

use rustnomial::{Monomial, Evaluable};
let monomial = Monomial::new(5, 2);
assert_eq!(125, monomial.eval(5));
assert_eq!(1, Monomial::new(1, 0).eval(0));

impl<N> Evaluable<N> for Polynomial<N> where
    N: Zero + Copy + AddAssign + MulAssign + Mul<Output = N>, 
[src]

pub fn eval(&self, point: N) -> N[src]

Returns the value of the Polynomial at the given point.

Example

impl<N> Evaluable<N> for QuadraticTrinomial<N> where
    N: Add<Output = N> + Mul<Output = N> + Copy
[src]

pub fn eval(&self, point: N) -> N[src]

Returns the value of the QuadraticTrinomial at the given point.

Example

use rustnomial::{QuadraticTrinomial, Evaluable};
let trinomial = QuadraticTrinomial::new([1, 2, 3]);
assert_eq!(6, trinomial.eval(1));
assert_eq!(3, trinomial.eval(0));

impl<N> Evaluable<N> for SparsePolynomial<N> where
    N: Zero + PowUsize + Copy + AddAssign + Mul<Output = N>, 
[src]

Loading content...