[][src]Struct gauss_quad::Midpoint

pub struct Midpoint { /* fields omitted */ }

A midpoint rule quadrature scheme.

// initialize a midpoint rule with 100 cells
let quad: Midpoint = Midpoint::init(100);

// numerically integrate a function from -1.0 to 1.0 using the midpoint rule
let approx = quad.integrate(-1.0, 1.0, |x| x * x);

Implementations

impl Midpoint[src]

pub fn init(degree: usize) -> Self[src]

Initialize a new midpoint rule with degree number of cells.

pub fn integrate<F>(&self, a: f64, b: f64, integrand: F) -> f64 where
    F: Fn(f64) -> f64
[src]

Integrate over the domain [a, b].

Trait Implementations

impl Clone for Midpoint[src]

impl Debug for Midpoint[src]

Auto Trait Implementations

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> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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

type Owned = T

The resulting type after obtaining ownership.

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.