pub struct IterState<P, G, J, H, F> {Show 23 fields
pub param: Option<P>,
pub prev_param: Option<P>,
pub best_param: Option<P>,
pub prev_best_param: Option<P>,
pub cost: F,
pub prev_cost: F,
pub best_cost: F,
pub prev_best_cost: F,
pub target_cost: F,
pub grad: Option<G>,
pub prev_grad: Option<G>,
pub hessian: Option<H>,
pub prev_hessian: Option<H>,
pub inv_hessian: Option<H>,
pub prev_inv_hessian: Option<H>,
pub jacobian: Option<J>,
pub prev_jacobian: Option<J>,
pub iter: u64,
pub last_best_iter: u64,
pub max_iters: u64,
pub counts: HashMap<String, u64>,
pub time: Option<Duration>,
pub termination_reason: TerminationReason,
}
Expand description
Maintains the state from iteration to iteration of a solver
This struct is passed from one iteration of an algorithm to the next.
Keeps track of
- parameter vector of current and previous iteration
- best parameter vector of current and previous iteration
- gradient of current and previous iteration
- Jacobian of current and previous iteration
- Hessian of current and previous iteration
- inverse Hessian of current and previous iteration
- cost function value of current and previous iteration
- current and previous best cost function value
- target cost function value
- current iteration number
- iteration number where the last best parameter vector was found
- maximum number of iterations that will be executed
- problem function evaluation counts (cost function, gradient, jacobian, hessian, annealing,…)
- elapsed time
- termination reason (set to
TerminationReason::NotTerminated
if not terminated yet)
Fields
param: Option<P>
Current parameter vector
prev_param: Option<P>
Previous parameter vector
best_param: Option<P>
Current best parameter vector
prev_best_param: Option<P>
Previous best parameter vector
cost: F
Current cost function value
prev_cost: F
Previous cost function value
best_cost: F
Current best cost function value
prev_best_cost: F
Previous best cost function value
target_cost: F
Target cost function value
grad: Option<G>
Current gradient
prev_grad: Option<G>
Previous gradient
hessian: Option<H>
Current Hessian
prev_hessian: Option<H>
Previous Hessian
inv_hessian: Option<H>
Current inverse Hessian
prev_inv_hessian: Option<H>
Previous inverse Hessian
jacobian: Option<J>
Current Jacobian
prev_jacobian: Option<J>
Previous Jacobian
iter: u64
Current iteration
last_best_iter: u64
Iteration number of last best cost
max_iters: u64
Maximum number of iterations
counts: HashMap<String, u64>
Evaluation counts
time: Option<Duration>
Time required so far
termination_reason: TerminationReason
Reason of termination
Implementations
sourceimpl<P, G, J, H, F> IterState<P, G, J, H, F> where
Self: State<Float = F>,
F: ArgminFloat,
impl<P, G, J, H, F> IterState<P, G, J, H, F> where
Self: State<Float = F>,
F: ArgminFloat,
sourcepub fn param(self, param: P) -> Self
pub fn param(self, param: P) -> Self
Set parameter vector. This shifts the stored parameter vector to the previous parameter vector.
Example
let state = state.param(param);
sourcepub fn gradient(self, gradient: G) -> Self
pub fn gradient(self, gradient: G) -> Self
Set gradient. This shifts the stored gradient to the previous gradient.
Example
let state = state.gradient(grad);
sourcepub fn hessian(self, hessian: H) -> Self
pub fn hessian(self, hessian: H) -> Self
Set Hessian. This shifts the stored Hessian to the previous Hessian.
Example
let state = state.hessian(hessian);
sourcepub fn inv_hessian(self, inv_hessian: H) -> Self
pub fn inv_hessian(self, inv_hessian: H) -> Self
Set inverse Hessian. This shifts the stored inverse Hessian to the previous inverse Hessian.
Example
let state = state.inv_hessian(inv_hessian);
sourcepub fn jacobian(self, jacobian: J) -> Self
pub fn jacobian(self, jacobian: J) -> Self
Set Jacobian. This shifts the stored Jacobian to the previous Jacobian.
Example
let state = state.jacobian(jacobian);
sourcepub fn cost(self, cost: F) -> Self
pub fn cost(self, cost: F) -> Self
Set the current cost function value. This shifts the stored cost function value to the previous cost function value.
Example
let state = state.cost(cost);
sourcepub fn target_cost(self, target_cost: F) -> Self
pub fn target_cost(self, target_cost: F) -> Self
Set target cost.
When this cost is reached, the algorithm will stop. The default is
Self::Float::NEG_INFINITY
.
Example
let state = state.target_cost(0.0);
sourcepub fn get_prev_cost(&self) -> F
pub fn get_prev_cost(&self) -> F
sourcepub fn get_best_cost(&self) -> F
pub fn get_best_cost(&self) -> F
sourcepub fn get_prev_best_cost(&self) -> F
pub fn get_prev_best_cost(&self) -> F
Returns the previous best cost function value
Example
let prev_best_cost = state.get_prev_best_cost();
sourcepub fn get_target_cost(&self) -> F
pub fn get_target_cost(&self) -> F
sourcepub fn take_param(&mut self) -> Option<P>
pub fn take_param(&mut self) -> Option<P>
Moves the current parameter vector out and replaces it internally with None
Example
let param = state.take_param(); // Option<P>
sourcepub fn get_prev_param(&self) -> Option<&P>
pub fn get_prev_param(&self) -> Option<&P>
Returns a reference to previous parameter vector
Example
let prev_param = state.get_prev_param(); // Option<&P>
sourcepub fn take_prev_param(&mut self) -> Option<P>
pub fn take_prev_param(&mut self) -> Option<P>
Moves the previous parameter vector out and replaces it internally with None
Example
let prev_param = state.take_prev_param(); // Option<P>
sourcepub fn get_prev_best_param(&self) -> Option<&P>
pub fn get_prev_best_param(&self) -> Option<&P>
Returns a reference to previous best parameter vector
Example
let prev_best_param = state.get_prev_best_param(); // Option<&P>
sourcepub fn take_best_param(&mut self) -> Option<P>
pub fn take_best_param(&mut self) -> Option<P>
Moves the best parameter vector out and replaces it internally with None
Example
let best_param = state.take_best_param(); // Option<P>
sourcepub fn take_prev_best_param(&mut self) -> Option<P>
pub fn take_prev_best_param(&mut self) -> Option<P>
Moves the previous best parameter vector out and replaces it internally with None
Example
let prev_best_param = state.take_prev_best_param(); // Option<P>
sourcepub fn get_gradient(&self) -> Option<&G>
pub fn get_gradient(&self) -> Option<&G>
sourcepub fn take_gradient(&mut self) -> Option<G>
pub fn take_gradient(&mut self) -> Option<G>
Moves the gradient out and replaces it internally with None
Example
let grad = state.take_gradient(); // Option<G>
sourcepub fn get_prev_gradient(&self) -> Option<&G>
pub fn get_prev_gradient(&self) -> Option<&G>
Returns a reference to the previous gradient
Example
let prev_grad = state.get_prev_gradient(); // Option<&G>
sourcepub fn take_prev_gradient(&mut self) -> Option<G>
pub fn take_prev_gradient(&mut self) -> Option<G>
Moves the gradient out and replaces it internally with None
Example
let prev_grad = state.take_prev_gradient(); // Option<G>
sourcepub fn get_hessian(&self) -> Option<&H>
pub fn get_hessian(&self) -> Option<&H>
sourcepub fn take_hessian(&mut self) -> Option<H>
pub fn take_hessian(&mut self) -> Option<H>
Moves the Hessian out and replaces it internally with None
Example
let hessian = state.take_hessian(); // Option<H>
sourcepub fn get_prev_hessian(&self) -> Option<&H>
pub fn get_prev_hessian(&self) -> Option<&H>
Returns a reference to the previous Hessian
Example
let prev_hessian = state.get_prev_hessian(); // Option<&H>
sourcepub fn take_prev_hessian(&mut self) -> Option<H>
pub fn take_prev_hessian(&mut self) -> Option<H>
Moves the previous Hessian out and replaces it internally with None
Example
let prev_hessian = state.take_prev_hessian(); // Option<H>
sourcepub fn get_inv_hessian(&self) -> Option<&H>
pub fn get_inv_hessian(&self) -> Option<&H>
Returns a reference to the current inverse Hessian
Example
let inv_hessian = state.get_inv_hessian(); // Option<&H>
sourcepub fn take_inv_hessian(&mut self) -> Option<H>
pub fn take_inv_hessian(&mut self) -> Option<H>
Moves the inverse Hessian out and replaces it internally with None
Example
let inv_hessian = state.take_inv_hessian(); // Option<H>
sourcepub fn get_prev_inv_hessian(&self) -> Option<&H>
pub fn get_prev_inv_hessian(&self) -> Option<&H>
Returns a reference to the previous inverse Hessian
Example
let prev_inv_hessian = state.get_prev_inv_hessian(); // Option<&H>
sourcepub fn take_prev_inv_hessian(&mut self) -> Option<H>
pub fn take_prev_inv_hessian(&mut self) -> Option<H>
Moves the previous Hessian out and replaces it internally with None
Example
let prev_inv_hessian = state.take_prev_inv_hessian(); // Option<H>
sourcepub fn get_jacobian(&self) -> Option<&J>
pub fn get_jacobian(&self) -> Option<&J>
Returns a reference to the current Jacobian
Example
let jacobian = state.get_jacobian(); // Option<&J>
sourcepub fn take_jacobian(&mut self) -> Option<J>
pub fn take_jacobian(&mut self) -> Option<J>
Moves the Jacobian out and replaces it internally with None
Example
let jacobian = state.take_jacobian(); // Option<J>
sourcepub fn get_prev_jacobian(&self) -> Option<&J>
pub fn get_prev_jacobian(&self) -> Option<&J>
Returns a reference to the previous Jacobian
Example
let prev_jacobian = state.get_prev_jacobian(); // Option<&J>
sourcepub fn take_prev_jacobian(&mut self) -> Option<J>
pub fn take_prev_jacobian(&mut self) -> Option<J>
Moves the previous Jacobian out and replaces it internally with None
Example
let prev_jacobian = state.take_prev_jacobian(); // Option<J>
Trait Implementations
sourceimpl<P: Default, G: Default, J: Default, H: Default, F: Default> Default for IterState<P, G, J, H, F>
impl<P: Default, G: Default, J: Default, H: Default, F: Default> Default for IterState<P, G, J, H, F>
sourceimpl<'de, P, G, J, H, F> Deserialize<'de> for IterState<P, G, J, H, F> where
P: Deserialize<'de>,
G: Deserialize<'de>,
J: Deserialize<'de>,
H: Deserialize<'de>,
F: Deserialize<'de>,
impl<'de, P, G, J, H, F> Deserialize<'de> for IterState<P, G, J, H, F> where
P: Deserialize<'de>,
G: Deserialize<'de>,
J: Deserialize<'de>,
H: Deserialize<'de>,
F: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<P: PartialEq, G: PartialEq, J: PartialEq, H: PartialEq, F: PartialEq> PartialEq<IterState<P, G, J, H, F>> for IterState<P, G, J, H, F>
impl<P: PartialEq, G: PartialEq, J: PartialEq, H: PartialEq, F: PartialEq> PartialEq<IterState<P, G, J, H, F>> for IterState<P, G, J, H, F>
sourceimpl<P, G, J, H, F> Serialize for IterState<P, G, J, H, F> where
P: Serialize,
G: Serialize,
J: Serialize,
H: Serialize,
F: Serialize,
impl<P, G, J, H, F> Serialize for IterState<P, G, J, H, F> where
P: Serialize,
G: Serialize,
J: Serialize,
H: Serialize,
F: Serialize,
sourceimpl<O, F> Solver<O, IterState<F, (), (), (), F>> for BrentOpt<F> where
O: CostFunction<Param = F, Output = F>,
F: ArgminFloat,
impl<O, F> Solver<O, IterState<F, (), (), (), F>> for BrentOpt<F> where
O: CostFunction<Param = F, Output = F>,
F: ArgminFloat,
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &I) -> TerminationReason
fn terminate(&mut self, _state: &I) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourceimpl<O, F> Solver<O, IterState<F, (), (), (), F>> for BrentRoot<F> where
O: CostFunction<Param = F, Output = F>,
F: ArgminFloat,
impl<O, F> Solver<O, IterState<F, (), (), (), F>> for BrentRoot<F> where
O: CostFunction<Param = F, Output = F>,
F: ArgminFloat,
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &I) -> TerminationReason
fn terminate(&mut self, _state: &I) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourceimpl<O, F> Solver<O, IterState<F, (), (), (), F>> for GoldenSectionSearch<F> where
O: CostFunction<Param = F, Output = F>,
F: ArgminFloat,
impl<O, F> Solver<O, IterState<F, (), (), (), F>> for GoldenSectionSearch<F> where
O: CostFunction<Param = F, Output = F>,
F: ArgminFloat,
sourceconst NAME: &'static str = "Golden-section search"
const NAME: &'static str = "Golden-section search"
Name of the solver. Mainly used in Observers.
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
sourcefn terminate(
&mut self,
_state: &IterState<F, (), (), (), F>
) -> TerminationReason
fn terminate(
&mut self,
_state: &IterState<F, (), (), (), F>
) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<P, O, F> Solver<O, IterState<P, (), (), (), F>> for ConjugateGradient<P, F> where
O: Operator<Param = P, Output = P>,
P: Clone + SerializeAlias + ArgminDot<P, F> + ArgminSub<P, P> + ArgminScaledAdd<P, F, P> + ArgminConj + ArgminMul<F, P>,
F: ArgminFloat + ArgminNorm<F>,
impl<P, O, F> Solver<O, IterState<P, (), (), (), F>> for ConjugateGradient<P, F> where
O: Operator<Param = P, Output = P>,
P: Clone + SerializeAlias + ArgminDot<P, F> + ArgminSub<P, P> + ArgminScaledAdd<P, F, P> + ArgminConj + ArgminMul<F, P>,
F: ArgminFloat + ArgminNorm<F>,
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
Perform one iteration of CG algorithm
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &I) -> TerminationReason
fn terminate(&mut self, _state: &I) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourceimpl<O, P, F> Solver<O, IterState<P, (), (), (), F>> for NelderMead<P, F> where
O: CostFunction<Param = P, Output = F>,
P: Clone + SerializeAlias + ArgminSub<P, P> + ArgminAdd<P, P> + ArgminMul<F, P>,
F: ArgminFloat + Sum<F>,
impl<O, P, F> Solver<O, IterState<P, (), (), (), F>> for NelderMead<P, F> where
O: CostFunction<Param = P, Output = F>,
P: Clone + SerializeAlias + ArgminSub<P, P> + ArgminAdd<P, P> + ArgminMul<F, P>,
F: ArgminFloat + Sum<F>,
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
sourcefn terminate(
&mut self,
_state: &IterState<P, (), (), (), F>
) -> TerminationReason
fn terminate(
&mut self,
_state: &IterState<P, (), (), (), F>
) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, P, F, R> Solver<O, IterState<P, (), (), (), F>> for SimulatedAnnealing<F, R> where
O: CostFunction<Param = P, Output = F> + Anneal<Param = P, Output = P, Float = F>,
P: Clone,
F: ArgminFloat,
R: Rng + SerializeAlias,
impl<O, P, F, R> Solver<O, IterState<P, (), (), (), F>> for SimulatedAnnealing<F, R> where
O: CostFunction<Param = P, Output = F> + Anneal<Param = P, Output = P, Float = F>,
P: Clone,
F: ArgminFloat,
R: Rng + SerializeAlias,
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
Perform one iteration of SA algorithm
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), F>
) -> Result<(IterState<P, (), (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate(
&mut self,
_state: &IterState<P, (), (), (), F>
) -> TerminationReason
fn terminate(
&mut self,
_state: &IterState<P, (), (), (), F>
) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, F, P, J, U> Solver<O, IterState<P, (), J, (), F>> for GaussNewton<F> where
O: Operator<Param = P, Output = U> + Jacobian<Param = P, Jacobian = J>,
P: Clone + ArgminSub<P, P> + ArgminMul<F, P>,
U: ArgminNorm<F>,
J: Clone + ArgminTranspose<J> + ArgminInv<J> + ArgminDot<J, J> + ArgminDot<U, P> + ArgminDot<P, P>,
F: ArgminFloat,
impl<O, F, P, J, U> Solver<O, IterState<P, (), J, (), F>> for GaussNewton<F> where
O: Operator<Param = P, Output = U> + Jacobian<Param = P, Jacobian = J>,
P: Clone + ArgminSub<P, P> + ArgminMul<F, P>,
U: ArgminNorm<F>,
J: Clone + ArgminTranspose<J> + ArgminInv<J> + ArgminDot<J, J> + ArgminDot<U, P> + ArgminDot<P, P>,
F: ArgminFloat,
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), J, (), F>
) -> Result<(IterState<P, (), J, (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), J, (), F>
) -> Result<(IterState<P, (), J, (), F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, (), J, (), F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, (), J, (), F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, P, G, L, F> Solver<O, IterState<P, G, (), (), F>> for BacktrackingLineSearch<P, G, L, F> where
P: Clone + SerializeAlias + ArgminScaledAdd<P, F, P>,
G: SerializeAlias + ArgminScaledAdd<P, F, P>,
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
L: LineSearchCondition<P, G, F> + SerializeAlias,
F: ArgminFloat,
impl<O, P, G, L, F> Solver<O, IterState<P, G, (), (), F>> for BacktrackingLineSearch<P, G, L, F> where
P: Clone + SerializeAlias + ArgminScaledAdd<P, F, P>,
G: SerializeAlias + ArgminScaledAdd<P, F, P>,
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
L: LineSearchCondition<P, G, F> + SerializeAlias,
F: ArgminFloat,
sourceconst NAME: &'static str = "Backtracking line search"
const NAME: &'static str = "Backtracking line search"
Name of the solver. Mainly used in Observers.
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, G, (), (), F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, G, (), (), F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<P, G, O, F> Solver<O, IterState<P, G, (), (), F>> for HagerZhangLineSearch<P, G, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + ArgminDot<G, F> + ArgminScaledAdd<P, F, P>,
G: Clone + SerializeAlias + ArgminDot<P, F>,
F: ArgminFloat,
impl<P, G, O, F> Solver<O, IterState<P, G, (), (), F>> for HagerZhangLineSearch<P, G, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + ArgminDot<G, F> + ArgminScaledAdd<P, F, P>,
G: Clone + SerializeAlias + ArgminDot<P, F>,
F: ArgminFloat,
sourceconst NAME: &'static str = "Hager-Zhang line search"
const NAME: &'static str = "Hager-Zhang line search"
Name of the solver. Mainly used in Observers.
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
sourcefn terminate(&mut self, _state: &IterState<P, G, (), (), F>) -> TerminationReason
fn terminate(&mut self, _state: &IterState<P, G, (), (), F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, L, P, G, F> Solver<O, IterState<P, G, (), (), F>> for LBFGS<L, P, G, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminAdd<P, P> + ArgminDot<G, F> + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminSub<G, G> + ArgminDot<G, F> + ArgminDot<P, F> + ArgminMul<F, G> + ArgminMul<F, P>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
impl<O, L, P, G, F> Solver<O, IterState<P, G, (), (), F>> for LBFGS<L, P, G, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminAdd<P, P> + ArgminDot<G, F> + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminSub<G, G> + ArgminDot<G, F> + ArgminDot<P, F> + ArgminMul<F, G> + ArgminMul<F, P>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, G, (), (), F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, G, (), (), F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, F, P, G> Solver<O, IterState<P, G, (), (), F>> for Landweber<F> where
O: Gradient<Param = P, Gradient = G>,
P: Clone + ArgminScaledSub<G, F, P>,
F: ArgminFloat,
impl<O, F, P, G> Solver<O, IterState<P, G, (), (), F>> for Landweber<F> where
O: Gradient<Param = P, Gradient = G>,
P: Clone + ArgminScaledSub<G, F, P>,
F: ArgminFloat,
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &I) -> TerminationReason
fn terminate(&mut self, _state: &I) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourceimpl<P, G, O, F> Solver<O, IterState<P, G, (), (), F>> for MoreThuenteLineSearch<P, G, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + ArgminDot<G, F> + ArgminScaledAdd<P, F, P>,
G: Clone + SerializeAlias + ArgminDot<P, F>,
F: ArgminFloat,
impl<P, G, O, F> Solver<O, IterState<P, G, (), (), F>> for MoreThuenteLineSearch<P, G, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + ArgminDot<G, F> + ArgminScaledAdd<P, F, P>,
G: Clone + SerializeAlias + ArgminDot<P, F>,
F: ArgminFloat,
sourceconst NAME: &'static str = "More-Thuente Line search"
const NAME: &'static str = "More-Thuente Line search"
Name of the solver. Mainly used in Observers.
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &I) -> TerminationReason
fn terminate(&mut self, _state: &I) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourceimpl<O, P, G, L, B, F> Solver<O, IterState<P, G, (), (), F>> for NonlinearConjugateGradient<P, L, B, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminAdd<P, P> + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminMul<F, P> + ArgminDot<G, F> + ArgminNorm<F>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
B: NLCGBetaUpdate<G, P, F>,
F: ArgminFloat,
impl<O, P, G, L, B, F> Solver<O, IterState<P, G, (), (), F>> for NonlinearConjugateGradient<P, L, B, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminAdd<P, P> + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminMul<F, P> + ArgminDot<G, F> + ArgminNorm<F>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
B: NLCGBetaUpdate<G, P, F>,
F: ArgminFloat,
sourceconst NAME: &'static str = "Nonlinear Conjugate Gradient"
const NAME: &'static str = "Nonlinear Conjugate Gradient"
Name of the solver. Mainly used in Observers.
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &I) -> TerminationReason
fn terminate(&mut self, _state: &I) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourceimpl<O, L, P, G, F> Solver<O, IterState<P, G, (), (), F>> for SteepestDescent<L> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminMul<F, P>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
impl<O, L, P, G, F> Solver<O, IterState<P, G, (), (), F>> for SteepestDescent<L> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminMul<F, P>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), (), F>
) -> Result<(IterState<P, G, (), (), F>, Option<KV>), Error>
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &I) -> TerminationReason
fn terminate(&mut self, _state: &I) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourceimpl<O, R, P, G, B, F> Solver<O, IterState<P, G, (), B, F>> for SR1TrustRegion<R, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = B>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminAdd<P, P> + ArgminDot<P, F> + ArgminDot<P, B> + ArgminNorm<F> + ArgminZeroLike,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminDot<P, F> + ArgminSub<G, P>,
B: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminDot<P, P> + ArgminAdd<B, B> + ArgminMul<F, B>,
R: Clone + TrustRegionRadius<F> + Solver<O, IterState<P, G, (), B, F>>,
F: ArgminFloat + ArgminNorm<F>,
impl<O, R, P, G, B, F> Solver<O, IterState<P, G, (), B, F>> for SR1TrustRegion<R, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = B>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminAdd<P, P> + ArgminDot<P, F> + ArgminDot<P, B> + ArgminNorm<F> + ArgminZeroLike,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminDot<P, F> + ArgminSub<G, P>,
B: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminDot<P, P> + ArgminAdd<B, B> + ArgminMul<F, B>,
R: Clone + TrustRegionRadius<F> + Solver<O, IterState<P, G, (), B, F>>,
F: ArgminFloat + ArgminNorm<F>,
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), B, F>
) -> Result<(IterState<P, G, (), B, F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), B, F>
) -> Result<(IterState<P, G, (), B, F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), B, F>
) -> Result<(IterState<P, G, (), B, F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), B, F>
) -> Result<(IterState<P, G, (), B, F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, G, (), B, F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, G, (), B, F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, L, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for BFGS<L, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminDot<G, H> + ArgminDot<P, H>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminMul<F, P> + ArgminDot<P, F> + ArgminSub<G, G>,
H: SerializeAlias + DeserializeOwnedAlias + ArgminSub<H, H> + ArgminDot<G, G> + ArgminDot<H, H> + ArgminAdd<H, H> + ArgminMul<F, H> + ArgminTranspose<H> + ArgminEye,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
impl<O, L, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for BFGS<L, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminDot<G, H> + ArgminDot<P, H>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminMul<F, P> + ArgminDot<P, F> + ArgminSub<G, G>,
H: SerializeAlias + DeserializeOwnedAlias + ArgminSub<H, H> + ArgminDot<G, G> + ArgminDot<H, H> + ArgminAdd<H, H> + ArgminMul<F, H> + ArgminTranspose<H> + ArgminEye,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, F, P, G, H> Solver<O, IterState<P, G, (), H, F>> for CauchyPoint<F> where
O: Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = H>,
P: Clone + ArgminMul<F, P> + ArgminWeightedDot<P, F, H> + ArgminNorm<F>,
G: ArgminMul<F, P> + ArgminWeightedDot<G, F, H> + ArgminNorm<F>,
F: ArgminFloat,
impl<O, F, P, G, H> Solver<O, IterState<P, G, (), H, F>> for CauchyPoint<F> where
O: Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = H>,
P: Clone + ArgminMul<F, P> + ArgminWeightedDot<P, F, H> + ArgminNorm<F>,
G: ArgminMul<F, P> + ArgminWeightedDot<G, F, H> + ArgminNorm<F>,
F: ArgminFloat,
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, L, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for DFP<L, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminDot<G, F> + ArgminDot<P, H> + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<G, G> + ArgminNorm<F> + ArgminDot<P, F>,
H: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<H, H> + ArgminDot<G, P> + ArgminAdd<H, H> + ArgminMul<F, H>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
impl<O, L, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for DFP<L, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminDot<G, F> + ArgminDot<P, H> + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<G, G> + ArgminNorm<F> + ArgminDot<P, F>,
H: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<H, H> + ArgminDot<G, P> + ArgminAdd<H, H> + ArgminMul<F, H>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for Newton<F> where
O: Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = H>,
P: Clone + ArgminScaledSub<P, F, P>,
H: ArgminInv<H> + ArgminDot<G, P>,
F: ArgminFloat,
impl<O, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for Newton<F> where
O: Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = H>,
P: Clone + ArgminScaledSub<P, F, P>,
H: ArgminInv<H> + ArgminDot<G, P>,
F: ArgminFloat,
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &I) -> TerminationReason
fn terminate(&mut self, _state: &I) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourceimpl<O, L, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for NewtonCG<L, F> where
O: Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = H>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminDot<P, F> + ArgminScaledAdd<P, F, P> + ArgminMul<F, P> + ArgminConj + ArgminZeroLike,
G: SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminMul<F, P>,
H: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminDot<P, P>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat + ArgminNorm<F>,
impl<O, L, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for NewtonCG<L, F> where
O: Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = H>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminDot<P, F> + ArgminScaledAdd<P, F, P> + ArgminMul<F, P> + ArgminConj + ArgminZeroLike,
G: SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminMul<F, P>,
H: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminDot<P, P>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat + ArgminNorm<F>,
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, L, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for SR1<L, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminDot<G, F> + ArgminDot<P, F> + ArgminDot<P, H> + ArgminNorm<F> + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminNorm<F> + ArgminSub<G, G>,
H: SerializeAlias + DeserializeOwnedAlias + ArgminDot<G, P> + ArgminDot<P, P> + ArgminAdd<H, H> + ArgminMul<F, H>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
impl<O, L, P, G, H, F> Solver<O, IterState<P, G, (), H, F>> for SR1<L, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminDot<G, F> + ArgminDot<P, F> + ArgminDot<P, H> + ArgminNorm<F> + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminSub<P, P> + ArgminNorm<F> + ArgminSub<G, G>,
H: SerializeAlias + DeserializeOwnedAlias + ArgminDot<G, P> + ArgminDot<P, P> + ArgminAdd<H, H> + ArgminMul<F, H>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), F>>,
F: ArgminFloat,
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, G, (), H, F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, R, F, P, G, H> Solver<O, IterState<P, G, (), H, F>> for TrustRegion<R, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = H>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminDot<P, F> + ArgminDot<G, F> + ArgminAdd<P, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias,
H: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminDot<P, P>,
R: Clone + TrustRegionRadius<F> + Solver<O, IterState<P, G, (), H, F>>,
F: ArgminFloat,
impl<O, R, F, P, G, H> Solver<O, IterState<P, G, (), H, F>> for TrustRegion<R, F> where
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G> + Hessian<Param = P, Hessian = H>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminNorm<F> + ArgminDot<P, F> + ArgminDot<G, F> + ArgminAdd<P, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias,
H: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminDot<P, P>,
R: Clone + TrustRegionRadius<F> + Solver<O, IterState<P, G, (), H, F>>,
F: ArgminFloat,
sourcefn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, (), H, F>
) -> Result<(IterState<P, G, (), H, F>, Option<KV>), Error>
sourcefn terminate(&mut self, _state: &IterState<P, G, (), H, F>) -> TerminationReason
fn terminate(&mut self, _state: &IterState<P, G, (), H, F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, L, F, P, G, J, U> Solver<O, IterState<P, G, J, (), F>> for GaussNewtonLS<L, F> where
O: Operator<Param = P, Output = U> + Jacobian<Param = P, Jacobian = J>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias,
U: ArgminNorm<F>,
J: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminTranspose<J> + ArgminInv<J> + ArgminDot<J, J> + ArgminDot<G, P> + ArgminDot<U, G>,
L: Clone + LineSearch<P, F> + Solver<LineSearchProblem<O, F>, IterState<P, G, (), (), F>>,
F: ArgminFloat,
impl<O, L, F, P, G, J, U> Solver<O, IterState<P, G, J, (), F>> for GaussNewtonLS<L, F> where
O: Operator<Param = P, Output = U> + Jacobian<Param = P, Jacobian = J>,
P: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminMul<F, P>,
G: Clone + SerializeAlias + DeserializeOwnedAlias,
U: ArgminNorm<F>,
J: Clone + SerializeAlias + DeserializeOwnedAlias + ArgminTranspose<J> + ArgminInv<J> + ArgminDot<J, J> + ArgminDot<G, P> + ArgminDot<U, G>,
L: Clone + LineSearch<P, F> + Solver<LineSearchProblem<O, F>, IterState<P, G, (), (), F>>,
F: ArgminFloat,
sourceconst NAME: &'static str = "Gauss-Newton method with line search"
const NAME: &'static str = "Gauss-Newton method with line search"
Name of the solver. Mainly used in Observers.
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, J, (), F>
) -> Result<(IterState<P, G, J, (), F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, J, (), F>
) -> Result<(IterState<P, G, J, (), F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, G, J, (), F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, G, J, (), F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O, F, P, H> Solver<O, IterState<P, P, (), H, F>> for Dogleg<F> where
O: Gradient<Param = P, Gradient = P> + Hessian<Param = P, Hessian = H>,
P: Clone + ArgminMul<F, P> + ArgminNorm<F> + ArgminDot<P, F> + ArgminAdd<P, P> + ArgminSub<P, P>,
H: ArgminInv<H> + ArgminDot<P, P>,
F: ArgminFloat,
impl<O, F, P, H> Solver<O, IterState<P, P, (), H, F>> for Dogleg<F> where
O: Gradient<Param = P, Gradient = P> + Hessian<Param = P, Hessian = H>,
P: Clone + ArgminMul<F, P> + ArgminNorm<F> + ArgminDot<P, F> + ArgminAdd<P, P> + ArgminSub<P, P>,
H: ArgminInv<H> + ArgminDot<P, P>,
F: ArgminFloat,
sourcefn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, P, (), H, F>
) -> Result<(IterState<P, P, (), H, F>, Option<KV>), Error>
fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, P, (), H, F>
) -> Result<(IterState<P, P, (), H, F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, P, (), H, F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, P, (), H, F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<P, O, F, H> Solver<O, IterState<P, P, (), H, F>> for Steihaug<P, F> where
P: Clone + SerializeAlias + ArgminMul<F, P> + ArgminNorm<F> + ArgminDot<P, F> + ArgminAdd<P, P> + ArgminZeroLike,
H: ArgminDot<P, P>,
F: ArgminFloat,
impl<P, O, F, H> Solver<O, IterState<P, P, (), H, F>> for Steihaug<P, F> where
P: Clone + SerializeAlias + ArgminMul<F, P> + ArgminNorm<F> + ArgminDot<P, F> + ArgminAdd<P, P> + ArgminZeroLike,
H: ArgminDot<P, P>,
F: ArgminFloat,
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: IterState<P, P, (), H, F>
) -> Result<(IterState<P, P, (), H, F>, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: IterState<P, P, (), H, F>
) -> Result<(IterState<P, P, (), H, F>, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn next_iter(
&mut self,
_problem: &mut Problem<O>,
state: IterState<P, P, (), H, F>
) -> Result<(IterState<P, P, (), H, F>, Option<KV>), Error>
fn next_iter(
&mut self,
_problem: &mut Problem<O>,
state: IterState<P, P, (), H, F>
) -> Result<(IterState<P, P, (), H, F>, Option<KV>), Error>
sourcefn terminate(&mut self, state: &IterState<P, P, (), H, F>) -> TerminationReason
fn terminate(&mut self, state: &IterState<P, P, (), H, F>) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourceimpl<O> Solver<O, IterState<Vec<f64, Global>, (), (), (), f64>> for TestSolver
impl<O> Solver<O, IterState<Vec<f64, Global>, (), (), (), f64>> for TestSolver
sourcefn next_iter(
&mut self,
_problem: &mut Problem<O>,
state: IterState<Vec<f64>, (), (), (), f64>
) -> Result<(IterState<Vec<f64>, (), (), (), f64>, Option<KV>), Error>
fn next_iter(
&mut self,
_problem: &mut Problem<O>,
state: IterState<Vec<f64>, (), (), (), f64>
) -> Result<(IterState<Vec<f64>, (), (), (), f64>, Option<KV>), Error>
sourcefn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
fn init(
&mut self,
_problem: &mut Problem<O>,
state: I
) -> Result<(I, Option<KV>), Error>
Initializes the algorithm. Read more
sourcefn terminate_internal(&mut self, state: &I) -> TerminationReason
fn terminate_internal(&mut self, state: &I) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &I) -> TerminationReason
fn terminate(&mut self, _state: &I) -> TerminationReason
Used to implement stopping criteria, in particular criteria which are not covered by
(terminate_internal
. Read more
sourceimpl<P, G, J, H, F> State for IterState<P, G, J, H, F> where
P: Clone,
F: ArgminFloat,
impl<P, G, J, H, F> State for IterState<P, G, J, H, F> where
P: Clone,
F: ArgminFloat,
type Param = P
type Param = P
Type of parameter vector
type Float = F
type Float = F
Floating point precision
sourcefn new() -> Self
fn new() -> Self
Create a new IterState instance
Example
let state: IterState<Vec<f64>, Vec<f64>, Vec<Vec<f64>>, Vec<Vec<f64>>, f64> = IterState::new();
sourcefn update(&mut self)
fn update(&mut self)
Checks if the current parameter vector is better than the previous best parameter value. If a new best parameter vector was found, the state is updated accordingly.
Example
let mut state: IterState<Vec<f64>, (), (), (), f64> = IterState::new();
// Simulating a new, better parameter vector
state.best_param = Some(vec![1.0f64]);
state.best_cost = 10.0;
state.param = Some(vec![2.0f64]);
state.cost = 5.0;
// Calling update
state.update();
// Check if update was successful
assert_eq!(state.best_param.as_ref().unwrap()[0], 2.0f64);
assert_eq!(state.best_cost.to_ne_bytes(), state.best_cost.to_ne_bytes());
assert!(state.is_best());
For algorithms which do not compute the cost function, every new parameter vector will be the new best:
let mut state: IterState<Vec<f64>, (), (), (), f64> = IterState::new();
// Simulating a new, better parameter vector
state.best_param = Some(vec![1.0f64]);
state.param = Some(vec![2.0f64]);
// Calling update
state.update();
// Check if update was successful
assert_eq!(state.best_param.as_ref().unwrap()[0], 2.0f64);
assert_eq!(state.best_cost.to_ne_bytes(), state.best_cost.to_ne_bytes());
assert!(state.is_best());
sourcefn get_param(&self) -> Option<&P>
fn get_param(&self) -> Option<&P>
Returns a reference to the current parameter vector
Example
let param = state.get_param(); // Option<&P>
sourcefn get_best_param(&self) -> Option<&P>
fn get_best_param(&self) -> Option<&P>
Returns a reference to the current best parameter vector
Example
let best_param = state.get_best_param(); // Option<&P>
sourcefn terminate_with(self, reason: TerminationReason) -> Self
fn terminate_with(self, reason: TerminationReason) -> Self
Sets the termination reason (default: TerminationReason::NotTerminated
)
Example
let state = state.terminate_with(TerminationReason::MaxItersReached);
sourcefn get_best_cost(&self) -> Self::Float
fn get_best_cost(&self) -> Self::Float
sourcefn get_target_cost(&self) -> Self::Float
fn get_target_cost(&self) -> Self::Float
sourcefn get_last_best_iter(&self) -> u64
fn get_last_best_iter(&self) -> u64
Returns iteration number of last best parameter vector.
Example
let last_best_iter = state.get_last_best_iter();
sourcefn get_max_iters(&self) -> u64
fn get_max_iters(&self) -> u64
sourcefn get_termination_reason(&self) -> TerminationReason
fn get_termination_reason(&self) -> TerminationReason
sourcefn increment_iter(&mut self)
fn increment_iter(&mut self)
sourcefn func_counts<O>(&mut self, problem: &Problem<O>)
fn func_counts<O>(&mut self, problem: &Problem<O>)
Set all function evaluation counts to the evaluation counts of another Problem
.
state.func_counts(&problem);
sourcefn get_func_counts(&self) -> &HashMap<String, u64>
fn get_func_counts(&self) -> &HashMap<String, u64>
sourcefn is_best(&self) -> bool
fn is_best(&self) -> bool
Returns whether the current parameter vector is also the best parameter vector found so far.
Example
let is_best = state.is_best();
sourcefn terminated(&self) -> bool
fn terminated(&self) -> bool
Return whether the algorithm has terminated or not
impl<P: Eq, G: Eq, J: Eq, H: Eq, F: Eq> Eq for IterState<P, G, J, H, F>
impl<P, G, J, H, F> StructuralEq for IterState<P, G, J, H, F>
impl<P, G, J, H, F> StructuralPartialEq for IterState<P, G, J, H, F>
Auto Trait Implementations
impl<P, G, J, H, F> RefUnwindSafe for IterState<P, G, J, H, F> where
F: RefUnwindSafe,
G: RefUnwindSafe,
H: RefUnwindSafe,
J: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, G, J, H, F> Send for IterState<P, G, J, H, F> where
F: Send,
G: Send,
H: Send,
J: Send,
P: Send,
impl<P, G, J, H, F> Sync for IterState<P, G, J, H, F> where
F: Sync,
G: Sync,
H: Sync,
J: Sync,
P: Sync,
impl<P, G, J, H, F> Unpin for IterState<P, G, J, H, F> where
F: Unpin,
G: Unpin,
H: Unpin,
J: Unpin,
P: Unpin,
impl<P, G, J, H, F> UnwindSafe for IterState<P, G, J, H, F> where
F: UnwindSafe,
G: UnwindSafe,
H: UnwindSafe,
J: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more