pub struct ChebyshevExpansion {
pub coefficients: Vec<f64>,
}Expand description
Chebyshev expansion of a function f(x) ≈ Σ c_k T_k(x)
Fields§
§coefficients: Vec<f64>Chebyshev coefficients c_k
Implementations§
Source§impl ChebyshevExpansion
impl ChebyshevExpansion
Sourcepub fn from_function<F: Fn(f64) -> f64>(f: F, degree: usize) -> Self
pub fn from_function<F: Fn(f64) -> f64>(f: F, degree: usize) -> Self
Approximate function on [-1, 1] using n+1 Chebyshev nodes
Sourcepub fn heat_kernel(t: f64, degree: usize) -> Self
pub fn heat_kernel(t: f64, degree: usize) -> Self
Approximate exp(-t*x) for heat kernel (x in [0, 2]) Maps [0, 2] to [-1, 1] via x’ = x - 1
Sourcepub fn low_pass(cutoff: f64, degree: usize) -> Self
pub fn low_pass(cutoff: f64, degree: usize) -> Self
Approximate low-pass filter: 1 if λ < cutoff, 0 otherwise Smooth transition via sigmoid-like function
Sourcepub fn eval(&self, x: f64) -> f64
pub fn eval(&self, x: f64) -> f64
Evaluate expansion at point x using Clenshaw recurrence More numerically stable than direct summation
Sourcepub fn eval_vector(&self, x: &[f64]) -> Vec<f64>
pub fn eval_vector(&self, x: &[f64]) -> Vec<f64>
Evaluate expansion on vector: apply filter to each component
Sourcepub fn derivative(&self) -> Self
pub fn derivative(&self) -> Self
Derivative expansion d/dx Σ c_k T_k(x) = Σ c’_k T_k(x)
Trait Implementations§
Source§impl Clone for ChebyshevExpansion
impl Clone for ChebyshevExpansion
Source§fn clone(&self) -> ChebyshevExpansion
fn clone(&self) -> ChebyshevExpansion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChebyshevExpansion
impl RefUnwindSafe for ChebyshevExpansion
impl Send for ChebyshevExpansion
impl Sync for ChebyshevExpansion
impl Unpin for ChebyshevExpansion
impl UnwindSafe for ChebyshevExpansion
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