pub struct Extrapolator<T: Float> { /* private fields */ }
Expand description
Extrapolator for extending interpolation methods beyond their domain.
This class provides a flexible way to extrapolate values outside the original domain of interpolation, using a variety of methods that can be customized separately for the lower and upper boundaries.
Implementations§
Source§impl<T: Float + Display> Extrapolator<T>
impl<T: Float + Display> Extrapolator<T>
Sourcepub fn new(
lower_bound: T,
upper_bound: T,
lower_value: T,
upper_value: T,
lower_method: ExtrapolationMethod,
upper_method: ExtrapolationMethod,
) -> Self
pub fn new( lower_bound: T, upper_bound: T, lower_value: T, upper_value: T, lower_method: ExtrapolationMethod, upper_method: ExtrapolationMethod, ) -> Self
Creates a new extrapolator with the specified methods and boundary values.
§Arguments
lower_bound
- Lower boundary of the original domainupper_bound
- Upper boundary of the original domainlower_value
- Function value at the lower boundaryupper_value
- Function value at the upper boundarylower_method
- Extrapolation method for below the lower boundaryupper_method
- Extrapolation method for above the upper boundary
§Returns
A new Extrapolator
instance
Sourcepub fn with_derivatives(self, lower_derivative: T, upper_derivative: T) -> Self
pub fn with_derivatives(self, lower_derivative: T, upper_derivative: T) -> Self
Sourcepub fn with_second_derivatives(
self,
lower_second_derivative: T,
upper_second_derivative: T,
) -> Self
pub fn with_second_derivatives( self, lower_second_derivative: T, upper_second_derivative: T, ) -> Self
Sourcepub fn with_parameters(self, parameters: ExtrapolationParameters<T>) -> Self
pub fn with_parameters(self, parameters: ExtrapolationParameters<T>) -> Self
Sourcepub fn extrapolate(&self, x: T) -> InterpolateResult<T>
pub fn extrapolate(&self, x: T) -> InterpolateResult<T>
Sourcepub fn lower_bound(&self) -> T
pub fn lower_bound(&self) -> T
Get the lower bound of the extrapolator domain
Sourcepub fn upper_bound(&self) -> T
pub fn upper_bound(&self) -> T
Get the upper bound of the extrapolator domain
Sourcepub fn lower_method(&self) -> ExtrapolationMethod
pub fn lower_method(&self) -> ExtrapolationMethod
Get the extrapolation method for the lower boundary
Sourcepub fn upper_method(&self) -> ExtrapolationMethod
pub fn upper_method(&self) -> ExtrapolationMethod
Get the extrapolation method for the upper boundary
Sourcepub fn is_in_domain(&self, x: T) -> bool
pub fn is_in_domain(&self, x: T) -> bool
Check if the point is within the extrapolator’s domain
Sourcepub fn domain_width(&self) -> T
pub fn domain_width(&self) -> T
Get the domain width
Trait Implementations§
Source§impl<T: Clone + Float> Clone for Extrapolator<T>
impl<T: Clone + Float> Clone for Extrapolator<T>
Source§fn clone(&self) -> Extrapolator<T>
fn clone(&self) -> Extrapolator<T>
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<T> Freeze for Extrapolator<T>where
T: Freeze,
impl<T> RefUnwindSafe for Extrapolator<T>where
T: RefUnwindSafe,
impl<T> Send for Extrapolator<T>where
T: Send,
impl<T> Sync for Extrapolator<T>where
T: Sync,
impl<T> Unpin for Extrapolator<T>where
T: Unpin,
impl<T> UnwindSafe for Extrapolator<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.