Skip to main content

OdeLaneSolution

Struct OdeLaneSolution 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn status(&self) -> OdeLaneStatus

How this lane ended.

Source

pub fn completed(&self) -> bool

Whether this lane reached x_end.

Trait Implementations§

Source§

impl Clone for OdeLaneSolution

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OdeLaneSolution

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for OdeLaneSolution

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OdeLaneSolution

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.