Struct LimitApproximator
pub struct LimitApproximator { /* private fields */ }Expand description
Symmetric two-sided limit approximation settings.
Implementations§
§impl LimitApproximator
impl LimitApproximator
pub const fn new(step: f64, tolerance: f64) -> LimitApproximator
pub const fn new(step: f64, tolerance: f64) -> LimitApproximator
Creates a limit approximator from a sample step and comparison tolerance.
pub fn try_new(
step: f64,
tolerance: f64,
) -> Result<LimitApproximator, CalculusError>
pub fn try_new( step: f64, tolerance: f64, ) -> Result<LimitApproximator, CalculusError>
Creates a limit approximator from a finite positive step and a finite non-negative tolerance.
§Errors
Returns CalculusError::NonFiniteStep or
CalculusError::NonPositiveStep when step is invalid, and returns
CalculusError::NonFiniteTolerance or
CalculusError::NegativeTolerance when tolerance is invalid.
pub fn validate(self) -> Result<LimitApproximator, CalculusError>
pub fn validate(self) -> Result<LimitApproximator, CalculusError>
Validates that the stored step and tolerance are acceptable.
§Errors
Returns the same error variants as Self::try_new.
pub const fn tolerance(&self) -> f64
pub const fn tolerance(&self) -> f64
Returns the acceptance tolerance between the left and right samples.
pub fn at<F>(self, function: F, at: f64) -> Result<f64, CalculusError>
pub fn at<F>(self, function: F, at: f64) -> Result<f64, CalculusError>
Approximates a two-sided limit at at using one symmetric sample scale.
§Errors
Returns CalculusError when the stored step or tolerance is invalid,
at is not finite, sampled evaluations are not finite, or the left and
right samples disagree by more than tolerance.
Trait Implementations§
§impl Clone for LimitApproximator
impl Clone for LimitApproximator
§fn clone(&self) -> LimitApproximator
fn clone(&self) -> LimitApproximator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more