[−][src]Trait argmin_core::ArgminLineSearch
Defines a common interface to line search methods. Requires that ArgminSolver
is implemented
for the line search method as well.
The cost function value and the gradient at the starting point can either be provided
(set_initial_cost
and set_initial_gradient
) or they can be computed using the operator from
the implementation of ArgminSolver
(see calc_initial_cost
and calc_initial_gradient
). The
former is convenient if cost and gradient at the starting point are already known for some
reason (i.e. the solver which uses the line search has already computed cost and gradient) and
avoids unneccessary computation of those values.
Required methods
fn set_initial_parameter(&mut self, param: Self::Param)
Set the initial parameter (starting point)
fn set_search_direction(&mut self, direction: Self::Param)
Set the search direction
fn set_initial_alpha(&mut self, step_length: f64) -> Result<(), Error>
Set the initial step length
fn set_initial_cost(&mut self, cost: f64)
Set the cost function value at the starting point as opposed to computing it (see
calc_initial_cost
)
fn set_initial_gradient(&mut self, grad: Self::Param)
Set the gradient at the starting point as opposed to computing it (see
calc_initial_gradient
)
fn calc_initial_cost(&mut self) -> Result<(), Error>
calculate the initial cost function value using an operator as opposed to setting it
manually (see set_initial_cost
)
fn calc_initial_gradient(&mut self) -> Result<(), Error>
calculate the initial gradient using an operator as opposed to setting it manually (see
set_initial_gradient
)