pub enum DifferenceScheme {
Central,
ForwardOneSided,
BackwardOneSided,
}Expand description
Which finite-difference formula actually produced a Derivative (review fix I4).
A one-sided scheme has different, generally larger (O(h) vs. O(h^2)) truncation error
than a central one – see the module doc’s “One-sided fallback” section for when and why
each one is chosen. This is part of the public contract precisely so a caller building an
error budget (or reporting a method, MBA-1347) does not have to silently assume every
Derivative is central.
Serialize/Deserialize (0.33.0 decision-support Task 10, MBA-1347): error_budget’s
SourceContributionV1 carries this scheme directly in its wire payload, per that task’s
requirement that a one-sided derivative’s larger truncation error be visible in the report
itself, not just in prose documentation.
Variants§
Central
(f(x+h) - f(x-h)) / 2h – both perturbed sides evaluated successfully.
ForwardOneSided
(f(x+h) - f(x)) / h – the backward side (x-h) failed to evaluate (most often
because it left the axis’s physical domain), so the forward side and the unperturbed
value at x were used instead.
BackwardOneSided
(f(x) - f(x-h)) / h – the forward side (x+h) failed to evaluate (most often because
it left the axis’s physical domain), so the backward side and the unperturbed value at
x were used instead.
Trait Implementations§
Source§impl Clone for DifferenceScheme
impl Clone for DifferenceScheme
Source§fn clone(&self) -> DifferenceScheme
fn clone(&self) -> DifferenceScheme
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DifferenceScheme
Source§impl Debug for DifferenceScheme
impl Debug for DifferenceScheme
Source§impl<'de> Deserialize<'de> for DifferenceScheme
impl<'de> Deserialize<'de> for DifferenceScheme
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for DifferenceScheme
Source§impl PartialEq for DifferenceScheme
impl PartialEq for DifferenceScheme
Source§impl Serialize for DifferenceScheme
impl Serialize for DifferenceScheme
impl StructuralPartialEq for DifferenceScheme
Auto Trait Implementations§
impl Freeze for DifferenceScheme
impl RefUnwindSafe for DifferenceScheme
impl Send for DifferenceScheme
impl Sync for DifferenceScheme
impl Unpin for DifferenceScheme
impl UnsafeUnpin for DifferenceScheme
impl UnwindSafe for DifferenceScheme
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> Scalar 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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.