pub struct ChebSeries { /* private fields */ }
Implementations
sourceimpl ChebSeries
impl ChebSeries
pub fn new(n: usize) -> Option<Self>
sourcepub fn init<F: Fn(f64) -> f64>(&mut self, f: F, a: f64, b: f64) -> Value
pub fn init<F: Fn(f64) -> f64>(&mut self, f: F, a: f64, b: f64) -> 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 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) -> (Value, f64, f64)
pub fn eval_err(&self, x: f64) -> (Value, f64, f64)
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.
Returns (result, abs_err)
.
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) -> (Value, f64, f64)
pub fn eval_n_err(&self, order: usize, x: f64) -> (Value, f64, f64)
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.
Returns (result, abs_err)
.
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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ChebSeries
impl !Send for ChebSeries
impl !Sync for ChebSeries
impl Unpin for ChebSeries
impl UnwindSafe for ChebSeries
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