pub struct InternalFunction {
pub grid: Vec<f64>,
pub values: Vec<f64>,
}Expand description
An internal function approximation: a function on a hyperfinite grid.
Fields§
§grid: Vec<f64>Grid points (as f64 for computability).
values: Vec<f64>Function values at each grid point.
Implementations§
Source§impl InternalFunction
impl InternalFunction
Sourcepub fn new(grid: Vec<f64>, values: Vec<f64>) -> Self
pub fn new(grid: Vec<f64>, values: Vec<f64>) -> Self
Create an internal function from a grid and corresponding values.
Sourcepub fn from_fn<F: Fn(f64) -> f64>(grid: Vec<f64>, f: F) -> Self
pub fn from_fn<F: Fn(f64) -> f64>(grid: Vec<f64>, f: F) -> Self
Sample the function from a standard function on the grid.
Sourcepub fn eval_nearest(&self, x: f64) -> f64
pub fn eval_nearest(&self, x: f64) -> f64
Evaluate (nearest-grid-point interpolation) at a point x.
Sourcepub fn ns_derivative_at(&self, i: usize) -> f64
pub fn ns_derivative_at(&self, i: usize) -> f64
Compute the nonstandard derivative at grid point i (finite difference).
Sourcepub fn riemann_sum(&self) -> f64
pub fn riemann_sum(&self) -> f64
Compute the internal Riemann sum ∑ f(xᵢ) Δxᵢ.
Auto Trait Implementations§
impl Freeze for InternalFunction
impl RefUnwindSafe for InternalFunction
impl Send for InternalFunction
impl Sync for InternalFunction
impl Unpin for InternalFunction
impl UnsafeUnpin for InternalFunction
impl UnwindSafe for InternalFunction
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