pub trait IterState: Sized {
type Value;
type Solution;
// Required methods
fn init_from_value(initial_point: Self::Value) -> Self;
fn to_sol(&self) -> Self::Solution;
}
Expand description
Intermediate state of an iterative algorithm.
For many iterative algorithms, the intermediate state often requires a more complex structure to describe compared to the initial iteration value and the solution.
In practical iterative algorithms, it is often necessary to perform some simple computations or obtain algorithm metadata after obtaining the solution.
Therefore, IterState allows you to customize the intermediate state and separate the abstractions of value and solution.
If you expect the simplest behavior, this crate has already implemented IterState
for basic data types i*
, u*
, and f*
, where their associated types Value and Solution are themselves.
Required Associated Types§
Required Methods§
Sourcefn init_from_value(initial_point: Self::Value) -> Self
fn init_from_value(initial_point: Self::Value) -> Self
Initializes the state from an initial value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.