Struct rgsl::types::integration::GLFixedTable
source · [−]pub struct GLFixedTable { /* private fields */ }
Expand description
The fixed-order Gauss-Legendre integration routines are provided for fast integration of smooth functions with known polynomial order. The n-point Gauss-Legendre rule is exact for polynomials of order 2*n-1 or less. For example, these rules are useful when integrating basis functions to form mass matrices for the Galerkin method. Unlike other numerical integration routines within the library, these routines do not accept absolute or relative error bounds.
Implementations
sourceimpl GLFixedTable
impl GLFixedTable
sourcepub fn new(n: usize) -> Option<GLFixedTable>
pub fn new(n: usize) -> Option<GLFixedTable>
This function determines the Gauss-Legendre abscissae and weights necessary for an n-point fixed order integration scheme. If possible, high precision precomputed coefficients are used. If precomputed weights are not available, lower precision coefficients are computed on the fly.
sourcepub fn point(&self, a: f64, b: f64, i: usize) -> (Value, f64, f64)
pub fn point(&self, a: f64, b: f64, i: usize) -> (Value, f64, f64)
For i in [0, …, t->n - 1], this function obtains the i-th Gauss-Legendre point xi and weight wi on the interval [a,b]. The points and weights are ordered by increasing point value. A function f may be integrated on [a,b] by summing wi * f(xi) over i.
Returns (Value, xi, wi)
.
sourcepub fn glfixed<F: Fn(f64) -> f64>(&self, f: F, a: f64, b: f64) -> f64
pub fn glfixed<F: Fn(f64) -> f64>(&self, f: F, a: f64, b: f64) -> f64
This function applies the Gauss-Legendre integration rule contained in table self and returns the result.
pub fn glfixed_point(
&self,
a: f64,
b: f64,
xi: &mut [f64],
wi: &mut [f64]
) -> Value
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GLFixedTable
impl !Send for GLFixedTable
impl !Sync for GLFixedTable
impl Unpin for GLFixedTable
impl UnwindSafe for GLFixedTable
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more