Struct rgsl::types::series_acceleration::LevinUWorkspace
source · [−]pub struct LevinUWorkspace { /* private fields */ }
Expand description
Workspace for Levin U Transform with error estimation.
Implementations
sourceimpl LevinUWorkspace
impl LevinUWorkspace
sourcepub fn new(n: usize) -> Option<LevinUWorkspace>
pub fn new(n: usize) -> Option<LevinUWorkspace>
This function allocates a workspace for a Levin u-transform of n terms. The size of the workspace is O(2n^2 + 3n).
sourcepub fn accel(&mut self, array: &[f64]) -> (Value, f64, f64)
pub fn accel(&mut self, array: &[f64]) -> (Value, f64, f64)
This function takes the terms of a series in array of size array_size and computes the extrapolated limit of the series using a Levin u-transform. Additional working space must be provided in w. The extrapolated sum is stored in sum_accel, with an estimate of the absolute error stored in abserr. The actual term-by-term sum is returned in w->sum_plain. The algorithm calculates the truncation error (the difference between two successive extrapolations) and round-off error (propagated from the individual terms) to choose an optimal number of terms for the extrapolation. All the terms of the series passed in through array should be non-zero.
Returns (Value, sum_accel, abserr)
.
pub fn sum_plain(&self) -> f64
pub fn terms_used(&self) -> usize
pub fn size(&self) -> usize
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LevinUWorkspace
impl !Send for LevinUWorkspace
impl !Sync for LevinUWorkspace
impl Unpin for LevinUWorkspace
impl UnwindSafe for LevinUWorkspace
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