[][src]Trait rustnomial::Integrable

pub trait Integrable<N, P: FreeSizePolynomial<N> + Evaluable<N>> {
    pub fn integral(&self) -> Integral<N, P>;
}

Required methods

pub fn integral(&self) -> Integral<N, P>[src]

Loading content...

Implementors

impl<N> Integrable<N, Polynomial<N>> for LinearBinomial<N> where
    N: Zero + Copy + DivAssign + Mul<Output = N> + MulAssign + AddAssign + Div<Output = N> + TryFromUsizeContinuous, 
[src]

pub fn integral(&self) -> Integral<N, Polynomial<N>>[src]

Returns the integral of the LinearBinomial.

Example

use rustnomial::{LinearBinomial, Integrable, Polynomial};
let binomial = LinearBinomial::new([2.0, 0.]);
let integral = binomial.integral();
assert_eq!(&Polynomial::new(vec![1.0, 0.0, 0.0]), integral.inner());

Will panic if N can not losslessly represent 2usize.

impl<N> Integrable<N, Polynomial<N>> for Polynomial<N> where
    N: Zero + One + Copy + DivAssign + Mul<Output = N> + MulAssign + AddAssign + TryFromUsizeContinuous + SubAssign
[src]

pub fn integral(&self) -> Integral<N, Polynomial<N>>[src]

Returns the integral of the Polynomial.

Example

use rustnomial::{Polynomial, Integrable};
let polynomial = Polynomial::new(vec![1.0, 2.0, 5.0]);
let integral = polynomial.integral();
assert_eq!(&Polynomial::new(vec![1.0/3.0, 1.0, 5.0, 0.0]), integral.inner());

Errors

Will panic if N can not losslessly encode the numbers from 0 to the degree of self self.

impl<N> Integrable<N, Polynomial<N>> for QuadraticTrinomial<N> where
    N: Zero + TryFromUsizeExact + Copy + DivAssign + Mul<Output = N> + MulAssign + AddAssign + Div<Output = N>, 
[src]

pub fn integral(&self) -> Integral<N, Polynomial<N>>[src]

Returns the integral of the Monomial.

Example

use rustnomial::{QuadraticTrinomial, Integrable, Polynomial};
let trinomial = QuadraticTrinomial::new([3.0, 0., 0.]);
let integral = trinomial.integral();
assert_eq!(&Polynomial::new(vec![1.0, 0.0, 0.0, 0.0]), integral.inner());

Errors

Will panic if N can not losslessly represent 2usize or 3usize.

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

pub fn integral(&self) -> Integral<N, SparsePolynomial<N>>[src]

Returns the integral of the Monomial.

Example

use rustnomial::{Monomial, SparsePolynomial, Integrable, FreeSizePolynomial};
let monomial = Monomial::new(3.0, 2);
let integral = monomial.integral();
assert_eq!(&SparsePolynomial::from_terms(&[(1.0, 3)]), integral.inner());
assert_eq!(1., integral.eval(0., 1.));

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

pub fn integral(&self) -> Integral<N, SparsePolynomial<N>>[src]

Returns the integral of the Polynomial.

Example

use rustnomial::{SparsePolynomial, Integrable};
let polynomial = SparsePolynomial::from(vec![1.0, 2.0, 5.0]);
let integral = polynomial.integral();
assert_eq!(&SparsePolynomial::from(vec![1.0/3.0, 1.0, 5.0, 0.0]), integral.inner());

Errors

Will panic if a term has a degree, which when incremented by one, does not have a lossless representation in N.

Loading content...