Struct rgsl::types::series_acceleration::LevinUTruncWorkspace
[−]
[src]
pub struct LevinUTruncWorkspace { // some fields omitted }
The following functions perform the same calculation without estimating the errors. They require O(N) storage instead of O(N2). This may be useful for summing many similar series where the size of the error has already been estimated reliably and is not expected to change.
Methods
impl LevinUTruncWorkspace
[src]
fn new(n: usize) -> Option<LevinUTruncWorkspace>
This function allocates a workspace for a Levin u-transform of n terms, without error estimation. The size of the workspace is O(3n).
fn accel(&self, array: &[f64], sum_accel: &mut f64, abserr_trunc: &mut f64) -> Value
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. The actual term-by-term sum is returned in w->sum_plain. The algorithm terminates when the difference between two successive extrapolations reaches a minimum or is sufficiently small. The difference between these two values is used as estimate of the error and is stored in abserr_trunc. To improve the reliability of the algorithm the extrapolated values are replaced by moving averages when calculating the truncation error, smoothing out any fluctuations.