pub struct LimitApproximator { /* private fields */ }Expand description
Symmetric two-sided limit approximation settings.
Implementations§
Source§impl LimitApproximator
impl LimitApproximator
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub const fn tolerance(&self) -> f64
pub const fn tolerance(&self) -> f64
Returns the acceptance tolerance between the left and right samples.
Sourcepub 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§
Source§impl Clone for LimitApproximator
impl Clone for LimitApproximator
Source§fn clone(&self) -> LimitApproximator
fn clone(&self) -> LimitApproximator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LimitApproximator
impl Debug for LimitApproximator
Source§impl PartialEq for LimitApproximator
impl PartialEq for LimitApproximator
Source§fn eq(&self, other: &LimitApproximator) -> bool
fn eq(&self, other: &LimitApproximator) -> bool
self and other values to be equal, and is used by ==.