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

The QAWO algorithm is designed for integrands with an oscillatory factor, sin(omega x) or cos(omega x). In order to work efficiently the algorithm requires a table of Chebyshev moments which must be pre-computed with calls to the functions below.

Implementations§

source§

impl IntegrationQawoTable

source

pub fn new( omega: f64, l: f64, sine: IntegrationQawo, n: usize ) -> Option<IntegrationQawoTable>

This function allocates space for a gsl_integration_qawo_table struct and its associated workspace describing a sine or cosine weight function W(x) with the parameters (\omega, L),

W(x) = sin(omega x)
W(x) = cos(omega x)

The parameter L must be the length of the interval over which the function will be integrated L = b - a. The choice of sine or cosine is made with the parameter sine which should be chosen from one of the two following symbolic values:

::Cosine
::IntegrationQawo::Sine

The gsl_integration_qawo_table is a table of the trigonometric coefficients required in the integration process. The parameter n determines the number of levels of coefficients that are computed. Each level corresponds to one bisection of the interval L, so that n levels are sufficient for subintervals down to the length L/2^n. The integration routine gsl_integration_qawo returns the error ::Table if the number of levels is insufficient for the requested accuracy.

source

pub fn set( &mut self, omega: f64, l: f64, sine: IntegrationQawo ) -> Result<(), Value>

This function changes the parameters omega, L and sine of the existing self workspace.

source

pub fn set_length(&mut self, l: f64) -> Result<(), Value>

This function allows the length parameter l of the self workspace to be changed.

source

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

This function uses an adaptive algorithm to compute the integral of f over (a,b) with the weight function \sin(\omega x) or \cos(\omega x) defined by the table wf,

I = \int_a^b dx f(x) sin(omega x) I = \int_a^b dx f(x) cos(omega x)

The results are extrapolated using the epsilon-algorithm to accelerate the convergence of the integral. The function returns the final approximation from the extrapolation, result, and an estimate of the absolute error, abserr. The subintervals and their results are stored in the memory provided by workspace. The maximum number of subintervals is given by limit, which may not exceed the allocated size of the workspace.

Those subintervals with “large” widths d where d\omega > 4 are computed using a 25-point Clenshaw-Curtis integration rule, which handles the oscillatory behavior. Subintervals with a “small” widths where d\omega < 4 are computed using a 15-point Gauss-Kronrod integration.

Returns (result, abserr).

Trait Implementations§

source§

impl Drop for IntegrationQawoTable

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.