[−][src]Trait optimization_engine::core::AlgorithmEngine
Engine supporting an algorithm
An engine is responsible for the allocation of memory for an algorithm, especially memory that is reuasble is multiple instances of the same algorithm (as in model predictive control).
It defines what the algorithm does at every step (see step
) and whether
the specified termination criterion is satisfied
Required methods
fn step(&mut self, _: &mut [f64]) -> bool
Take a step of the algorithm and return true
only if the iterations should continue
fn init(&mut self, _: &mut [f64])
Implementors
impl<'a, GradientType, ConstraintType, CostType> AlgorithmEngine for FBSEngine<'a, GradientType, ConstraintType, CostType> where
GradientType: Fn(&[f64], &mut [f64]) -> i32 + 'a,
CostType: Fn(&[f64], &mut f64) -> i32 + 'a,
ConstraintType: Constraint + 'a,
[src]
GradientType: Fn(&[f64], &mut [f64]) -> i32 + 'a,
CostType: Fn(&[f64], &mut f64) -> i32 + 'a,
ConstraintType: Constraint + 'a,
fn step(&mut self, u_current: &mut [f64]) -> bool
[src]
Take a forward-backward step and check whether the algorithm should terminate
Arguments
u_current
the current mutable
Returns
- A boolean flag which is
true
if and only if the algorith should not terminate
Panics
The method may panick if the computation of the gradient of the cost function or the cost function panics.
fn init(&mut self, _u_current: &mut [f64])
[src]
impl<'a, GradientType, ConstraintType, CostType> AlgorithmEngine for PANOCEngine<'a, GradientType, ConstraintType, CostType> where
GradientType: Fn(&[f64], &mut [f64]) -> i32,
CostType: Fn(&[f64], &mut f64) -> i32,
ConstraintType: Constraint,
[src]
GradientType: Fn(&[f64], &mut [f64]) -> i32,
CostType: Fn(&[f64], &mut f64) -> i32,
ConstraintType: Constraint,
Implementation of the step
and init
methods of [trait.AlgorithmEngine.html]
fn step(&mut self, u_current: &mut [f64]) -> bool
[src]
PANOC step
Performs a step of PANOC, including the line search
Arguments
u_current
on entry is the current iterate; on exit, it is updated with the next iterate of PANOC
fn init(&mut self, u_current: &mut [f64])
[src]
Initialization of PANOC
Computes a number of essential quantities before the start of PANOC iterations
There include the computation of the cost and gradient of the cost at the initial
point, the computation of an initial estimation of the Lipschitz constant of the
gradient of the cost at the initial point, initial estimates for gamma
and sigma
,
a gradient step and a half step (projected gradient step)