pub struct IntegrationQawsTable { /* private fields */ }
Expand description

The QAWS algorithm is designed for integrands with algebraic-logarithmic singularities at the end-points of an integration region. In order to work efficiently the algorithm requires a precomputed table of Chebyshev moments.

Implementations§

source§

impl IntegrationQawsTable

source

pub fn new( alpha: f64, beta: f64, mu: i32, nu: i32 ) -> Option<IntegrationQawsTable>

This function allocates space for a gsl_integration_qaws_table struct describing a singular weight function W(x) with the parameters alpha, beta, mu and nu,

W(x) = (x-a)^alpha (b-x)^beta log^mu (x-a) log^nu (b-x)

where alpha > -1f64, beta > -1f64, and mu = 0, 1, nu = 0, 1. The weight function can take four different forms depending on the values of mu and nu,

W(x) = (x-a)^alpha (b-x)^beta                   (mu = 0, nu = 0)
W(x) = (x-a)^alpha (b-x)^beta log(x-a)          (mu = 1, nu = 0)
W(x) = (x-a)^alpha (b-x)^beta log(b-x)          (mu = 0, nu = 1)
W(x) = (x-a)^alpha (b-x)^beta log(x-a) log(b-x) (mu = 1, nu = 1)

The singular points (a,b) do not have to be specified until the integral is computed, where they are the endpoints of the integration range.

The function returns a pointer to the newly allocated table gsl_integration_qaws_table if no errors were detected, and 0 in the case of error.

source

pub fn set( &mut self, alpha: f64, beta: f64, mu: i32, nu: i32 ) -> Result<(), Value>

This function modifies the parameters (\alpha, \beta, \mu, \nu)

source

pub fn qaws<F: Fn(f64) -> f64>( &mut self, f: F, a: f64, b: f64, epsabs: f64, epsrel: f64, limit: usize, workspace: &mut IntegrationWorkspace ) -> Result<(f64, f64), Value>

This function computes the integral of the function f(x) over the interval (a,b) with the singular weight function (x-a)^\alpha (b-x)^\beta \log^\mu (x-a) \log^\nu (b-x). The parameters of the weight function (\alpha, \beta, \mu, \nu) are taken from the table self. The integral is,

I = \int_a^b dx f(x) (x-a)^alpha (b-x)^beta log^mu (x-a) log^nu (b-x).

The adaptive bisection algorithm of QAG is used. When a subinterval contains one of the endpoints then a special 25-point modified Clenshaw-Curtis rule is used to control the singularities. For subintervals which do not include the endpoints an ordinary 15-point Gauss-Kronrod integration rule is used.

Returns (result, abs_err)

Trait Implementations§

source§

impl Drop for IntegrationQawsTable

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.