Struct rgsl::types::chebyshev::ChebSeries
source · pub struct ChebSeries { /* private fields */ }
Implementations§
source§impl ChebSeries
impl ChebSeries
pub fn new(n: usize) -> Option<ChebSeries>
sourcepub fn init<T>(&mut self, func: function<T>, a: f64, b: f64, param: &mut T) -> Value
pub fn init<T>(&mut self, func: function<T>, a: f64, b: f64, param: &mut T) -> Value
This function computes the Chebyshev approximation cs for the function f over the range (a,b) to the previously specified order. The computation of the Chebyshev approximation is an O(n^2) process, and requires n function evaluations.
sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
This function returns the size of the Chebyshev coefficient array c[] for the Chebyshev series cs.
sourcepub fn as_slice<'r>(&'r self) -> &'r [f64]
pub fn as_slice<'r>(&'r self) -> &'r [f64]
This function returns a pointer to the coefficient array c[] location in memory for the Chebyshev series cs.
sourcepub fn as_mut_slice<'r>(&'r mut self) -> &'r mut [f64]
pub fn as_mut_slice<'r>(&'r mut self) -> &'r mut [f64]
This function returns a pointer to the coefficient array c[] location in memory for the Chebyshev series cs.
sourcepub fn eval(&self, x: f64) -> f64
pub fn eval(&self, x: f64) -> f64
This function evaluates the Chebyshev series cs at a given point x.
sourcepub fn eval_err(&self, x: f64, result: &mut f64, abs_err: &mut f64) -> Value
pub fn eval_err(&self, x: f64, result: &mut f64, abs_err: &mut f64) -> Value
This function computes the Chebyshev series cs at a given point x, estimating both the series result and its absolute error abserr. The error estimate is made from the first neglected term in the series.
sourcepub fn eval_n(&self, order: usize, x: f64) -> f64
pub fn eval_n(&self, order: usize, x: f64) -> f64
This function evaluates the Chebyshev series cs at a given point x, to (at most) the given order order.
sourcepub fn eval_n_err(
&self,
order: usize,
x: f64,
result: &mut f64,
abs_err: &mut f64
) -> Value
pub fn eval_n_err(
&self,
order: usize,
x: f64,
result: &mut f64,
abs_err: &mut f64
) -> Value
This function evaluates a Chebyshev series cs at a given point x, estimating both the series result and its absolute error abserr, to (at most) the given order order. The error estimate is made from the first neglected term in the series.
sourcepub fn calc_deriv(&self, deriv: &mut ChebSeries) -> Value
pub fn calc_deriv(&self, deriv: &mut ChebSeries) -> Value
This function computes the derivative of the series cs, storing the derivative coefficients in the previously allocated deriv. The two series cs and deriv must have been allocated with the same order.
sourcepub fn calc_integ(&self, integ: &mut ChebSeries) -> Value
pub fn calc_integ(&self, integ: &mut ChebSeries) -> Value
This function computes the integral of the series cs, storing the integral coefficients in the previously allocated integ. The two series cs and integ must have been allocated with the same order. The lower limit of the integration is taken to be the left hand end of the range a.