pub struct Step { /* private fields */ }
Expand description
A small struct that holds iteration count, elapsed time etc for each algorithm step.
The elapsed time is calculated on first call or on Clone
.
The callbacks on_step
and converge_when
give access to a Step
structure.
Implementations§
Source§impl Step
impl Step
Sourcepub fn iteration(&self) -> usize
pub fn iteration(&self) -> usize
The iteration count.
Represents how many times ‘step’ has been invoked. Hence the first iteration is 1.
Sourcepub fn elapsed(&self) -> Duration
pub fn elapsed(&self) -> Duration
Total elapsed time since the call to crate::Driver::solve
.
The elapsed time is only updated after each iteration step, and will not change between calls otherwise.
§See also
Sourcepub fn progress_percentage(&self) -> Option<f64>
pub fn progress_percentage(&self) -> Option<f64>
An estimate between 0
and 100
of how complete the solving process is.
The most optimistic of
- iterations out of iters, or
- elapsed time out of of “fail after” duration
will be used for the estimate.
Sourcepub fn clone_without_elapsed(&self) -> Self
pub fn clone_without_elapsed(&self) -> Self
A version of Self::clone
that does not crystalize the elapsed time at clone time,
and hence is slightly more performant.
Sourcepub fn time_remaining(&self) -> Option<Duration>
pub fn time_remaining(&self) -> Option<Duration>
An estimate of the time remaining.
The estimate is based on Self::progress_percentage
, and how much time has elapsed so far.
Trait Implementations§
Source§impl Clone for Step
Clone but with the side-effect of crystalizing the elapsed
time
impl Clone for Step
Clone but with the side-effect of crystalizing the elapsed
time
Elapsed is calculated at clone time, if it has not already been calculated. This
is typically want you want, but if the overhead of calculating the time is not desired,
and using the elapsed time is not needed, then Step::clone_without_elapsed
can be called