pub struct ChebSeries { /* private fields */ }

Implementations§

source§

impl ChebSeries

source

pub fn new(n: usize) -> Option<Self>

source

pub fn init<F: Fn(f64) -> f64>( &mut self, f: F, a: f64, b: f64 ) -> Result<(), 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.

source

pub fn order(&self) -> usize

This function returns the order of Chebyshev series cs.

source

pub fn size(&self) -> usize

This function returns the size of the Chebyshev coefficient array c[] for the Chebyshev series cs.

source

pub fn eval(&self, x: f64) -> f64

This function evaluates the Chebyshev series cs at a given point x.

source

pub fn eval_err(&self, x: f64) -> Result<(f64, 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.

Returns (result, abs_err).

source

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.

source

pub fn eval_n_err(&self, order: usize, x: f64) -> Result<(f64, 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.

Returns (result, abs_err).

source

pub fn calc_deriv(&self, deriv: &mut ChebSeries) -> Result<(), 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.

source

pub fn calc_integ(&self, integ: &mut ChebSeries) -> Result<(), 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§

source§

impl Drop for ChebSeries

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.