[][src]Struct rustnomial::Integral

pub struct Integral<N, P: FreeSizePolynomial<N> + Evaluable<N>> { /* fields omitted */ }

Implementations

impl<N, P: FreeSizePolynomial<N> + Evaluable<N>> Integral<N, P>[src]

pub fn new(polynomial: P) -> Self[src]

pub fn inner(&self) -> &P[src]

impl<N, P: FreeSizePolynomial<N> + Evaluable<N> + Clone> Integral<N, P>[src]

pub fn replace_c(&self, c: N) -> P[src]

impl<N: Sub<Output = N>, P: FreeSizePolynomial<N> + Evaluable<N>> Integral<N, P>[src]

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

Returns the area of the integral from the first point to the second point.

Example

use rustnomial::{Polynomial, Integrable};
let polynomial = Polynomial::new(vec![2.0, 1.0]);
let integral = polynomial.integral();
assert_eq!(2.0, integral.eval(0.0, 1.0));
assert_eq!(6.0, integral.eval(0.0, 2.0));
assert_eq!(4.0, integral.eval(1.0, 2.0));

Trait Implementations

impl<N: Clone, P: Clone + FreeSizePolynomial<N> + Evaluable<N>> Clone for Integral<N, P>[src]

impl<N: Debug, P: Debug + FreeSizePolynomial<N> + Evaluable<N>> Debug for Integral<N, P>[src]

impl<N, P: FreeSizePolynomial<N> + Evaluable<N> + SizedPolynomial<N> + Display> Display for Integral<N, P> where
    N: IsPositive + Zero + One + Copy + IsNegativeOne + PartialEq + Display + Abs, 
[src]

Auto Trait Implementations

impl<N, P> RefUnwindSafe for Integral<N, P> where
    N: RefUnwindSafe,
    P: RefUnwindSafe
[src]

impl<N, P> Send for Integral<N, P> where
    N: Send,
    P: Send
[src]

impl<N, P> Sync for Integral<N, P> where
    N: Sync,
    P: Sync
[src]

impl<N, P> Unpin for Integral<N, P> where
    N: Unpin,
    P: Unpin
[src]

impl<N, P> UnwindSafe for Integral<N, P> where
    N: UnwindSafe,
    P: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.