pub struct ChebyshevApproximation { /* private fields */ }Expand description
A Chebyshev series f(x) ≈ c0/2 + Σ c_k T_k(t) with t the interval mapped onto [-1, 1].
Implementations§
Source§impl ChebyshevApproximation
impl ChebyshevApproximation
Sourcepub fn new(
f: impl Fn(f64) -> f64,
a: f64,
b: f64,
n: usize,
) -> Result<Self, ErrorsJSL>
pub fn new( f: impl Fn(f64) -> f64, a: f64, b: f64, n: usize, ) -> Result<Self, ErrorsJSL>
Fits n Chebyshev coefficients to f on [a, b] by sampling at the Chebyshev nodes.
Sourcepub fn coefficients(&self) -> &[f64]
pub fn coefficients(&self) -> &[f64]
The series coefficients c_0..c_{n-1} (note the half weight on c_0).
Sourcepub fn truncate(&mut self, tol: f64)
pub fn truncate(&mut self, tol: f64)
Drops trailing coefficients smaller than tol in magnitude (keeping at least one).
Sourcepub fn derivative(&self) -> ChebyshevApproximation
pub fn derivative(&self) -> ChebyshevApproximation
The Chebyshev series of the derivative.
Sourcepub fn integral(&self) -> ChebyshevApproximation
pub fn integral(&self) -> ChebyshevApproximation
The Chebyshev series of the antiderivative that vanishes at a.
Trait Implementations§
Source§impl Clone for ChebyshevApproximation
impl Clone for ChebyshevApproximation
Auto Trait Implementations§
impl Freeze for ChebyshevApproximation
impl RefUnwindSafe for ChebyshevApproximation
impl Send for ChebyshevApproximation
impl Sync for ChebyshevApproximation
impl Unpin for ChebyshevApproximation
impl UnsafeUnpin for ChebyshevApproximation
impl UnwindSafe for ChebyshevApproximation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more