pub struct IterState<P, G, J, H, R, F> {Show 26 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 residuals: Option<R>,
pub prev_residuals: Option<R>,
pub iter: u64,
pub last_best_iter: u64,
pub max_iters: u64,
pub counts: HashMap<String, u64>,
pub counting_enabled: bool,
pub time: Option<Duration>,
pub termination_status: TerminationStatus,
}
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 status
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
residuals: Option<R>
Value of residuals from recent call to apply
prev_residuals: Option<R>
Value of residuals from previous call to apply
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
counting_enabled: bool
Update evaluation counts?
time: Option<Duration>
Time required so far
termination_status: TerminationStatus
Status of optimization execution
Implementations§
source§impl<P, G, J, H, R, F> IterState<P, G, J, H, R, F>where
Self: State<Float = F>,
F: ArgminFloat,
impl<P, G, J, H, R, F> IterState<P, G, J, H, R, 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 residuals(self, residuals: R) -> Self
pub fn residuals(self, residuals: R) -> Self
Set residuals. This shifts the stored residuals to the previous residuals.
§Example
let state = state.residuals(residuals);
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>
Returns a reference to the current Hessian
§Example
let hessian = state.get_hessian(); // 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>
sourcepub fn get_residuals(&self) -> Option<&R>
pub fn get_residuals(&self) -> Option<&R>
sourcepub fn take_residuals(&mut self) -> Option<R>
pub fn take_residuals(&mut self) -> Option<R>
Moves the residuals out and replaces it internally with None
§Example
let residuals = state.take_residuals(); // Option<R>
sourcepub fn get_prev_residuals(&self) -> Option<&R>
pub fn get_prev_residuals(&self) -> Option<&R>
Returns a reference to the previous residuals
§Example
let residuals = state.get_residuals(); // Option<&R>
sourcepub fn take_prev_residuals(&mut self) -> Option<R>
pub fn take_prev_residuals(&mut self) -> Option<R>
Moves the previous residuals out and replaces it internally with None
§Example
let residuals = state.take_residuals(); // Option<R>
Trait Implementations§
source§impl<P: Clone, G: Clone, J: Clone, H: Clone, R: Clone, F: Clone> Clone for IterState<P, G, J, H, R, F>
impl<P: Clone, G: Clone, J: Clone, H: Clone, R: Clone, F: Clone> Clone for IterState<P, G, J, H, R, F>
source§impl<P: Debug, G: Debug, J: Debug, H: Debug, R: Debug, F: Debug> Debug for IterState<P, G, J, H, R, F>
impl<P: Debug, G: Debug, J: Debug, H: Debug, R: Debug, F: Debug> Debug for IterState<P, G, J, H, R, F>
source§impl<P: Default, G: Default, J: Default, H: Default, R: Default, F: Default> Default for IterState<P, G, J, H, R, F>
impl<P: Default, G: Default, J: Default, H: Default, R: Default, F: Default> Default for IterState<P, G, J, H, R, F>
source§impl<'de, P, G, J, H, R, F> Deserialize<'de> for IterState<P, G, J, H, R, F>where
P: Deserialize<'de>,
G: Deserialize<'de>,
J: Deserialize<'de>,
H: Deserialize<'de>,
R: Deserialize<'de>,
F: Deserialize<'de>,
impl<'de, P, G, J, H, R, F> Deserialize<'de> for IterState<P, G, J, H, R, F>where
P: Deserialize<'de>,
G: Deserialize<'de>,
J: Deserialize<'de>,
H: Deserialize<'de>,
R: Deserialize<'de>,
F: Deserialize<'de>,
source§fn 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>,
source§impl<P: PartialEq, G: PartialEq, J: PartialEq, H: PartialEq, R: PartialEq, F: PartialEq> PartialEq for IterState<P, G, J, H, R, F>
impl<P: PartialEq, G: PartialEq, J: PartialEq, H: PartialEq, R: PartialEq, F: PartialEq> PartialEq for IterState<P, G, J, H, R, F>
source§impl<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,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
terminate_internal
. Read moresource§impl<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,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
terminate_internal
. Read moresource§impl<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,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
_state: &IterState<F, (), (), (), (), F>,
) -> TerminationStatus
fn terminate( &mut self, _state: &IterState<F, (), (), (), (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§impl<O, P, F> Solver<O, IterState<P, (), (), (), (), F>> for NelderMead<P, F>where
O: CostFunction<Param = P, Output = F>,
P: Clone + 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 + ArgminSub<P, P> + ArgminAdd<P, P> + ArgminMul<F, P>,
F: ArgminFloat + Sum<F>,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
_state: &IterState<P, (), (), (), (), F>,
) -> TerminationStatus
fn terminate( &mut self, _state: &IterState<P, (), (), (), (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§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,
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,
source§fn 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
source§fn 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>
source§fn terminate(
&mut self,
_state: &IterState<P, (), (), (), (), F>,
) -> TerminationStatus
fn terminate( &mut self, _state: &IterState<P, (), (), (), (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§impl<P, O, R, F> Solver<O, IterState<P, (), (), (), R, F>> for ConjugateGradient<P, F>where
O: Operator<Param = P, Output = P>,
P: Clone + ArgminDot<P, F> + ArgminSub<P, R> + ArgminScaledAdd<P, F, P> + ArgminConj,
R: ArgminMul<F, R> + ArgminMul<F, P> + ArgminConj + ArgminDot<R, F> + ArgminScaledAdd<P, F, R>,
F: ArgminFloat + ArgminL2Norm<F>,
impl<P, O, R, F> Solver<O, IterState<P, (), (), (), R, F>> for ConjugateGradient<P, F>where
O: Operator<Param = P, Output = P>,
P: Clone + ArgminDot<P, F> + ArgminSub<P, R> + ArgminScaledAdd<P, F, P> + ArgminConj,
R: ArgminMul<F, R> + ArgminMul<F, P> + ArgminConj + ArgminDot<R, F> + ArgminScaledAdd<P, F, R>,
F: ArgminFloat + ArgminL2Norm<F>,
source§fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), R, F>,
) -> Result<(IterState<P, (), (), (), R, F>, Option<KV>), Error>
fn next_iter( &mut self, problem: &mut Problem<O>, state: IterState<P, (), (), (), R, F>, ) -> Result<(IterState<P, (), (), (), R, F>, Option<KV>), Error>
Perform one iteration of CG algorithm
source§fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), (), (), R, F>,
) -> Result<(IterState<P, (), (), (), R, F>, Option<KV>), Error>
fn init( &mut self, problem: &mut Problem<O>, state: IterState<P, (), (), (), R, F>, ) -> Result<(IterState<P, (), (), (), R, F>, Option<KV>), Error>
source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
terminate_internal
. Read moresource§impl<O, P, J, R, F> Solver<O, IterState<P, (), J, (), R, F>> for GaussNewton<F>where
O: Operator<Param = P, Output = R> + Jacobian<Param = P, Jacobian = J>,
P: Clone + ArgminSub<P, P> + ArgminMul<F, P>,
R: ArgminL2Norm<F>,
J: Clone + ArgminTranspose<J> + ArgminInv<J> + ArgminDot<J, J> + ArgminDot<R, P> + ArgminDot<P, P>,
F: ArgminFloat,
impl<O, P, J, R, F> Solver<O, IterState<P, (), J, (), R, F>> for GaussNewton<F>where
O: Operator<Param = P, Output = R> + Jacobian<Param = P, Jacobian = J>,
P: Clone + ArgminSub<P, P> + ArgminMul<F, P>,
R: ArgminL2Norm<F>,
J: Clone + ArgminTranspose<J> + ArgminInv<J> + ArgminDot<J, J> + ArgminDot<R, P> + ArgminDot<P, P>,
F: ArgminFloat,
source§fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), J, (), R, F>,
) -> Result<(IterState<P, (), J, (), R, F>, Option<KV>), Error>
fn init( &mut self, problem: &mut Problem<O>, state: IterState<P, (), J, (), R, F>, ) -> Result<(IterState<P, (), J, (), R, F>, Option<KV>), Error>
source§fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, (), J, (), R, F>,
) -> Result<(IterState<P, (), J, (), R, F>, Option<KV>), Error>
fn next_iter( &mut self, problem: &mut Problem<O>, state: IterState<P, (), J, (), R, F>, ) -> Result<(IterState<P, (), J, (), R, F>, Option<KV>), Error>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, (), J, (), R, F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, (), J, (), R, F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§impl<O, P, G, L, F> Solver<O, IterState<P, G, (), (), (), F>> for BacktrackingLineSearch<P, G, L, F>where
P: Clone + ArgminScaledAdd<G, F, P>,
G: ArgminScaledAdd<G, F, G>,
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
L: LineSearchCondition<G, G, F>,
F: ArgminFloat,
impl<O, P, G, L, F> Solver<O, IterState<P, G, (), (), (), F>> for BacktrackingLineSearch<P, G, L, F>where
P: Clone + ArgminScaledAdd<G, F, P>,
G: ArgminScaledAdd<G, F, G>,
O: CostFunction<Param = P, Output = F> + Gradient<Param = P, Gradient = G>,
L: LineSearchCondition<G, G, F>,
F: ArgminFloat,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, G, (), (), (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, G, (), (), (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§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 + ArgminDot<G, F> + ArgminScaledAdd<G, F, P>,
G: Clone + ArgminDot<G, 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 + ArgminDot<G, F> + ArgminScaledAdd<G, F, P>,
G: Clone + ArgminDot<G, F>,
F: ArgminFloat,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
_state: &IterState<P, G, (), (), (), F>,
) -> TerminationStatus
fn terminate( &mut self, _state: &IterState<P, G, (), (), (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§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 + ArgminSub<P, P> + ArgminSub<F, P> + ArgminAdd<P, P> + ArgminAdd<F, P> + ArgminDot<G, F> + ArgminMul<F, P> + ArgminMul<P, P> + ArgminMul<G, P> + ArgminL1Norm<F> + ArgminSignum + ArgminZeroLike + ArgminMinMax,
G: Clone + ArgminL2Norm<F> + ArgminSub<G, G> + ArgminAdd<G, G> + ArgminAdd<P, G> + ArgminDot<G, F> + ArgminDot<P, F> + ArgminMul<F, G> + ArgminMul<F, P> + ArgminZeroLike + ArgminMinMax,
L: Clone + LineSearch<P, F> + Solver<LineSearchProblem<O, P, G, F>, 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 + ArgminSub<P, P> + ArgminSub<F, P> + ArgminAdd<P, P> + ArgminAdd<F, P> + ArgminDot<G, F> + ArgminMul<F, P> + ArgminMul<P, P> + ArgminMul<G, P> + ArgminL1Norm<F> + ArgminSignum + ArgminZeroLike + ArgminMinMax,
G: Clone + ArgminL2Norm<F> + ArgminSub<G, G> + ArgminAdd<G, G> + ArgminAdd<P, G> + ArgminDot<G, F> + ArgminDot<P, F> + ArgminMul<F, G> + ArgminMul<F, P> + ArgminZeroLike + ArgminMinMax,
L: Clone + LineSearch<P, F> + Solver<LineSearchProblem<O, P, G, F>, IterState<P, G, (), (), (), F>>,
F: ArgminFloat,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, G, (), (), (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, G, (), (), (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§impl<O, F, P, G> Solver<O, IterState<P, G, (), (), (), F>> for Landweber<F>
impl<O, F, P, G> Solver<O, IterState<P, G, (), (), (), F>> for Landweber<F>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn 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>
source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
terminate_internal
. Read moresource§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 + ArgminDot<G, F> + ArgminScaledAdd<G, F, P>,
G: Clone + ArgminDot<G, 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 + ArgminDot<G, F> + ArgminScaledAdd<G, F, P>,
G: Clone + ArgminDot<G, F>,
F: ArgminFloat,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
terminate_internal
. Read moresource§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 + ArgminAdd<P, P> + ArgminMul<F, P>,
G: Clone + ArgminMul<F, P> + ArgminDot<G, F> + ArgminL2Norm<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 + ArgminAdd<P, P> + ArgminMul<F, P>,
G: Clone + ArgminMul<F, P> + ArgminDot<G, F> + ArgminL2Norm<F>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), (), F>>,
B: NLCGBetaUpdate<G, P, F>,
F: ArgminFloat,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
terminate_internal
. Read moresource§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,
G: Clone + ArgminMul<F, G>,
L: Clone + LineSearch<G, 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,
G: Clone + ArgminMul<F, G>,
L: Clone + LineSearch<G, F> + Solver<O, IterState<P, G, (), (), (), F>>,
F: ArgminFloat,
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn 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>
source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
terminate_internal
. Read moresource§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 + ArgminSub<P, P> + ArgminAdd<P, P> + ArgminDot<P, F> + ArgminDot<P, B> + ArgminL2Norm<F> + ArgminZeroLike,
G: Clone + ArgminL2Norm<F> + ArgminDot<P, F> + ArgminSub<G, P>,
B: Clone + ArgminDot<P, P> + ArgminAdd<B, B> + ArgminMul<F, B>,
R: Clone + TrustRegionRadius<F> + Solver<O, IterState<P, G, (), B, (), F>>,
F: ArgminFloat + ArgminL2Norm<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 + ArgminSub<P, P> + ArgminAdd<P, P> + ArgminDot<P, F> + ArgminDot<P, B> + ArgminL2Norm<F> + ArgminZeroLike,
G: Clone + ArgminL2Norm<F> + ArgminDot<P, F> + ArgminSub<G, P>,
B: Clone + ArgminDot<P, P> + ArgminAdd<B, B> + ArgminMul<F, B>,
R: Clone + TrustRegionRadius<F> + Solver<O, IterState<P, G, (), B, (), F>>,
F: ArgminFloat + ArgminL2Norm<F>,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, G, (), B, (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, G, (), B, (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§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 + ArgminSub<P, P> + ArgminDot<G, H> + ArgminDot<P, H>,
G: Clone + ArgminL2Norm<F> + ArgminMul<F, P> + ArgminMul<F, G> + ArgminDot<P, F> + ArgminSub<G, G>,
H: ArgminSub<H, H> + ArgminDot<G, G> + ArgminDot<H, H> + ArgminAdd<H, H> + ArgminMul<F, H> + ArgminTranspose<H> + ArgminEye,
L: Clone + LineSearch<G, 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 + ArgminSub<P, P> + ArgminDot<G, H> + ArgminDot<P, H>,
G: Clone + ArgminL2Norm<F> + ArgminMul<F, P> + ArgminMul<F, G> + ArgminDot<P, F> + ArgminSub<G, G>,
H: ArgminSub<H, H> + ArgminDot<G, G> + ArgminDot<H, H> + ArgminAdd<H, H> + ArgminMul<F, H> + ArgminTranspose<H> + ArgminEye,
L: Clone + LineSearch<G, F> + Solver<O, IterState<P, G, (), (), (), F>>,
F: ArgminFloat,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, G, (), H, (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, G, (), H, (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§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>,
G: ArgminMul<F, P> + ArgminWeightedDot<G, F, H> + ArgminL2Norm<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>,
G: ArgminMul<F, P> + ArgminWeightedDot<G, F, H> + ArgminL2Norm<F>,
F: ArgminFloat,
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, G, (), H, (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, G, (), H, (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn 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>
source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§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 + ArgminSub<P, P> + ArgminDot<G, F> + ArgminDot<P, H> + ArgminMul<F, P>,
G: Clone + ArgminSub<G, G> + ArgminL2Norm<F> + ArgminDot<P, F>,
H: Clone + 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 + ArgminSub<P, P> + ArgminDot<G, F> + ArgminDot<P, H> + ArgminMul<F, P>,
G: Clone + ArgminSub<G, G> + ArgminL2Norm<F> + ArgminDot<P, F>,
H: Clone + 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,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, G, (), H, (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, G, (), H, (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§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,
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,
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn 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>
source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
terminate_internal
. Read moresource§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 + ArgminSub<P, P> + ArgminDot<P, F> + ArgminScaledAdd<P, F, P> + ArgminMul<F, P> + ArgminConj + ArgminZeroLike,
G: ArgminL2Norm<F> + ArgminMul<F, P>,
H: Clone + ArgminDot<P, P>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), (), F>>,
F: ArgminFloat + ArgminL2Norm<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 + ArgminSub<P, P> + ArgminDot<P, F> + ArgminScaledAdd<P, F, P> + ArgminMul<F, P> + ArgminConj + ArgminZeroLike,
G: ArgminL2Norm<F> + ArgminMul<F, P>,
H: Clone + ArgminDot<P, P>,
L: Clone + LineSearch<P, F> + Solver<O, IterState<P, G, (), (), (), F>>,
F: ArgminFloat + ArgminL2Norm<F>,
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, G, (), H, (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, G, (), H, (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn 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>
source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§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 + ArgminSub<P, P> + ArgminDot<G, F> + ArgminDot<P, F> + ArgminDot<P, H> + ArgminL2Norm<F> + ArgminMul<F, P>,
G: Clone + ArgminSub<P, P> + ArgminL2Norm<F> + ArgminSub<G, G>,
H: 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 + ArgminSub<P, P> + ArgminDot<G, F> + ArgminDot<P, F> + ArgminDot<P, H> + ArgminL2Norm<F> + ArgminMul<F, P>,
G: Clone + ArgminSub<P, P> + ArgminL2Norm<F> + ArgminSub<G, G>,
H: 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,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, G, (), H, (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, G, (), H, (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§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 + ArgminL2Norm<F> + ArgminDot<P, F> + ArgminDot<G, F> + ArgminAdd<P, P>,
G: Clone,
H: Clone + 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 + ArgminL2Norm<F> + ArgminDot<P, F> + ArgminDot<G, F> + ArgminAdd<P, P>,
G: Clone,
H: Clone + ArgminDot<P, P>,
R: Clone + TrustRegionRadius<F> + Solver<O, IterState<P, G, (), H, (), F>>,
F: ArgminFloat,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
_state: &IterState<P, G, (), H, (), F>,
) -> TerminationStatus
fn terminate( &mut self, _state: &IterState<P, G, (), H, (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§impl<O, L, F, P, G, J, U, R> Solver<O, IterState<P, G, J, (), R, F>> for GaussNewtonLS<L, F>where
O: Operator<Param = P, Output = U> + Jacobian<Param = P, Jacobian = J>,
P: Clone + ArgminMul<F, P>,
G: Clone,
U: ArgminL2Norm<F>,
J: Clone + 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, (), (), R, F>>,
F: ArgminFloat,
R: Clone,
impl<O, L, F, P, G, J, U, R> Solver<O, IterState<P, G, J, (), R, F>> for GaussNewtonLS<L, F>where
O: Operator<Param = P, Output = U> + Jacobian<Param = P, Jacobian = J>,
P: Clone + ArgminMul<F, P>,
G: Clone,
U: ArgminL2Norm<F>,
J: Clone + 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, (), (), R, F>>,
F: ArgminFloat,
R: Clone,
source§fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<P, G, J, (), R, F>,
) -> Result<(IterState<P, G, J, (), R, F>, Option<KV>), Error>
fn next_iter( &mut self, problem: &mut Problem<O>, state: IterState<P, G, J, (), R, F>, ) -> Result<(IterState<P, G, J, (), R, F>, Option<KV>), Error>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, G, J, (), R, F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, G, J, (), R, F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn 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>
source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§impl<O, F, P, H> Solver<O, IterState<P, P, (), H, (), F>> for Dogleg<F>
impl<O, F, P, H> Solver<O, IterState<P, P, (), H, (), F>> for Dogleg<F>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, P, (), H, (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, P, (), H, (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn 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>
source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§impl<P, O, F, H> Solver<O, IterState<P, P, (), H, (), F>> for Steihaug<P, F>where
P: Clone + ArgminMul<F, P> + ArgminL2Norm<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 + ArgminMul<F, P> + ArgminL2Norm<F> + ArgminDot<P, F> + ArgminAdd<P, P> + ArgminZeroLike,
H: ArgminDot<P, P>,
F: ArgminFloat,
source§fn 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>
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate(
&mut self,
state: &IterState<P, P, (), H, (), F>,
) -> TerminationStatus
fn terminate( &mut self, state: &IterState<P, P, (), H, (), F>, ) -> TerminationStatus
terminate_internal
. Read moresource§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§impl<O> Solver<O, IterState<Vec<f64>, (), (), (), (), f64>> for TestSolver
impl<O> Solver<O, IterState<Vec<f64>, (), (), (), (), f64>> for TestSolver
source§fn 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>
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn 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>
source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
terminate_internal
. Read moresource§impl<P, G, J, H, R, F> State for IterState<P, G, J, H, R, F>where
P: Clone,
F: ArgminFloat,
impl<P, G, J, H, R, F> State for IterState<P, G, J, H, R, F>where
P: Clone,
F: ArgminFloat,
source§fn new() -> Self
fn new() -> Self
Create a new IterState instance
§Example
let state: IterState<Vec<f64>, Vec<f64>, Vec<Vec<f64>>, Vec<Vec<f64>>, Vec<f64>, f64> = IterState::new();
source§fn 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());
source§fn 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>
source§fn 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>
source§fn terminate_with(self, reason: TerminationReason) -> Self
fn terminate_with(self, reason: TerminationReason) -> Self
Sets the termination status to Terminated
with the given reason
§Example
let state = state.terminate_with(TerminationReason::MaxItersReached);
source§fn time(&mut self, time: Option<Duration>) -> &mut Self
fn time(&mut self, time: Option<Duration>) -> &mut Self
Sets the time required so far.
§Example
let state = state.time(Some(instant::Duration::new(0, 12)));
source§fn get_best_cost(&self) -> Self::Float
fn get_best_cost(&self) -> Self::Float
source§fn get_target_cost(&self) -> Self::Float
fn get_target_cost(&self) -> Self::Float
source§fn 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();
source§fn get_max_iters(&self) -> u64
fn get_max_iters(&self) -> u64
source§fn get_termination_status(&self) -> &TerminationStatus
fn get_termination_status(&self) -> &TerminationStatus
source§fn get_termination_reason(&self) -> Option<&TerminationReason>
fn get_termination_reason(&self) -> Option<&TerminationReason>
Returns the termination reason if terminated, otherwise None.
§Example
let termination_reason = state.get_termination_reason();
source§fn increment_iter(&mut self)
fn increment_iter(&mut self)
source§fn 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);
source§fn 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();
source§fn terminated(&self) -> bool
fn terminated(&self) -> bool
impl<P: Eq, G: Eq, J: Eq, H: Eq, R: Eq, F: Eq> Eq for IterState<P, G, J, H, R, F>
impl<P, G, J, H, R, F> StructuralPartialEq for IterState<P, G, J, H, R, F>
Auto Trait Implementations§
impl<P, G, J, H, R, F> Freeze for IterState<P, G, J, H, R, F>
impl<P, G, J, H, R, F> RefUnwindSafe for IterState<P, G, J, H, R, F>where
F: RefUnwindSafe,
P: RefUnwindSafe,
G: RefUnwindSafe,
H: RefUnwindSafe,
J: RefUnwindSafe,
R: RefUnwindSafe,
impl<P, G, J, H, R, F> Send for IterState<P, G, J, H, R, F>
impl<P, G, J, H, R, F> Sync for IterState<P, G, J, H, R, F>
impl<P, G, J, H, R, F> Unpin for IterState<P, G, J, H, R, F>
impl<P, G, J, H, R, F> UnwindSafe for IterState<P, G, J, H, R, F>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.