pub struct OdeLaneSolution { /* private fields */ }Expand description
The outcome of a single ensemble lane: its status, its final state, how far it got and how much work it took.
The fields are private on purpose. The only way to get a state that is
claimed to be the answer is Self::state, which returns Option<&[f64]>
and hands back Some only for a completed lane. The raw state is available
from Self::last_state, whose name is chosen so that using a failed lane’s
partial trajectory is a visible decision in the calling code.
§Units
Self::state and Self::last_state carry the lane’s own state units;
Self::x_reached and Self::dx_final are in the independent variable’s
units; Self::steps is a dimensionless count.
Implementations§
Source§impl OdeLaneSolution
impl OdeLaneSolution
Sourcepub fn state(&self) -> Option<&[f64]>
pub fn state(&self) -> Option<&[f64]>
The final state, if this lane reached x_end.
None for every failure status. This is the accessor to reach for; the
Option is the point.
Sourcepub fn last_state(&self) -> &[f64]
pub fn last_state(&self) -> &[f64]
The last state the stepper held, completed or not.
The answer only when Self::status is
OdeLaneStatus::Completed. For
OdeLaneStatus::MaxStepsExceeded and
OdeLaneStatus::StepSizeUnderflow this is a genuine state on the
trajectory — the state at Self::x_reached, not at x_end — and is
offered so the caller can restart, sub-cycle, or re-run the lane with a
stiff stepper. For OdeLaneStatus::InvalidLane every component is
NaN, because there is no honest number to report.
Sourcepub fn x_reached(&self) -> f64
pub fn x_reached(&self) -> f64
The independent-variable value the trajectory actually reached.
Equal to the last accepted step’s endpoint, which for a completed lane is
x_end up to the accumulated rounding of the step sequence — it is the
measured value, not x_end substituted in. NaN for
OdeLaneStatus::InvalidLane.
Sourcepub fn dx_final(&self) -> f64
pub fn dx_final(&self) -> f64
The step size the adaptive controller ended on, in the independent variable’s units.
Worth carrying forward as the next call’s dx0 when marching an ensemble
through many intervals: it saves the controller re-discovering the scale
every interval. NaN for OdeLaneStatus::InvalidLane.
Sourcepub fn steps(&self) -> u32
pub fn steps(&self) -> u32
Accepted sub-steps this lane took, dimensionless.
Counts accepted steps only; a step rejected by the error controller and retried at a smaller size is not counted separately, because the retry loop lives inside the stepper. This is the number to look at when diagnosing which lanes are dragging an ensemble — a lane taking 50x the median is the stiff one.
Sourcepub fn status(&self) -> OdeLaneStatus
pub fn status(&self) -> OdeLaneStatus
How this lane ended.