pub struct DerivativeSolution { /* private fields */ }Expand description
One lane’s scalar derivative, with the diagnostics needed to judge it.
§Units
Self::raw_value carries the units of f divided by the units of x
— a derivative changes dimension, which is exactly why this module does not
try to uom-type the generic form. See the module-level “Units” section.
realised_step carries the units of x.
Implementations§
Source§impl DerivativeSolution
impl DerivativeSolution
Sourcepub fn derivative(&self) -> Option<f64>
pub fn derivative(&self) -> Option<f64>
The derivative, only if this lane succeeded.
Returns None for every non-DiffStatus::Ok status, so a caller
cannot accidentally consume a NaN as a derivative. The diagnostic
number is behind the deliberately-named Self::raw_value.
Sourcepub fn raw_value(&self) -> f64
pub fn raw_value(&self) -> f64
The difference quotient as computed, whatever the status — a diagnostic,
not an answer. Frequently NaN.
Sourcepub fn realised_step(&self) -> f64
pub fn realised_step(&self) -> f64
The step actually taken, after the x + h rounding correction described
on derivative. Units of x.
This is the denominator that was really divided by, not the h that
DiffSettings::step_for asked for, and comparing the two is the
cheapest way to see step-size trouble.
Sourcepub fn status(&self) -> DiffStatus
pub fn status(&self) -> DiffStatus
Why this lane succeeded or failed.