Trait peroxide::numerical::integral::NCIntegrable

source ·
pub trait NCIntegrable: Sub<Self, Output = Self> + Sized {
    type NodeY;
    type NCPolynomial;

    // Required methods
    fn compute_node_y<F>(f: F, node_x: &[f64]) -> Self::NodeY
       where F: Fn(f64) -> Self;
    fn compute_polynomial(
        node_x: &[f64],
        node_y: &Self::NodeY,
    ) -> Self::NCPolynomial;
    fn integrate_polynomial(p: &Self::NCPolynomial) -> Self::NCPolynomial;
    fn evaluate_polynomial(p: &Self::NCPolynomial, x: f64) -> Self;
}
Expand description

Type that can be integrated using Newton Cotes Quadrature

Required Associated Types§

Required Methods§

source

fn compute_node_y<F>(f: F, node_x: &[f64]) -> Self::NodeY
where F: Fn(f64) -> Self,

Returns the image of node_x under function f, in a representation (Self::NodeY) suitable for separately computing one Lagrange polynomial for each of the degrees of freedom of Self (e.g. a Vec with as many entries as the number of degrees of freedom).

source

fn compute_polynomial( node_x: &[f64], node_y: &Self::NodeY, ) -> Self::NCPolynomial

Computes one Lagrange polynomial for each one of the degrees of freedom of Self, returning them in a representation (Self::NCPolynomial) suitable to separately performing operation on them (e.g. Vec<Polynomial>).

source

fn integrate_polynomial(p: &Self::NCPolynomial) -> Self::NCPolynomial

Separately integrates each of the polynomials obtained using compute_polynomial.

source

fn evaluate_polynomial(p: &Self::NCPolynomial, x: f64) -> Self

Separately evaluates each of the polynomial integrated using integrate_polynomial at x, then recombines the result into a Self.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl NCIntegrable for f64

Implementors§