Trait argmin_core::ArgminLineSearch
source · pub trait ArgminLineSearch: ArgminSolver {
fn set_initial_parameter(&mut self, _: <Self as ArgminNextIter>::Parameters);
fn set_search_direction(&mut self, _: <Self as ArgminNextIter>::Parameters);
fn set_initial_alpha(&mut self, _: f64) -> Result<(), Error>;
fn set_initial_cost(&mut self, _: f64);
fn set_initial_gradient(&mut self, _: <Self as ArgminNextIter>::Parameters);
fn calc_initial_cost(&mut self) -> Result<(), Error>;
fn calc_initial_gradient(&mut self) -> Result<(), Error>;
}
Expand description
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
sourcefn set_initial_parameter(&mut self, _: <Self as ArgminNextIter>::Parameters)
fn set_initial_parameter(&mut self, _: <Self as ArgminNextIter>::Parameters)
Set the initial parameter (starting point)
sourcefn set_search_direction(&mut self, _: <Self as ArgminNextIter>::Parameters)
fn set_search_direction(&mut self, _: <Self as ArgminNextIter>::Parameters)
Set the search direction
sourcefn set_initial_cost(&mut self, _: f64)
fn set_initial_cost(&mut self, _: f64)
Set the cost function value at the starting point as opposed to computing it (see
calc_initial_cost
)
sourcefn set_initial_gradient(&mut self, _: <Self as ArgminNextIter>::Parameters)
fn set_initial_gradient(&mut self, _: <Self as ArgminNextIter>::Parameters)
Set the gradient at the starting point as opposed to computing it (see
calc_initial_gradient
)
sourcefn calc_initial_cost(&mut self) -> Result<(), Error>
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
)
sourcefn calc_initial_gradient(&mut self) -> Result<(), Error>
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
)