IT++ Logo Newcom Logo

itpp::Line_Search Class Reference
[Numerical Optimization Routines]

Line Search. More...

#include <itpp/base/newton_search.h>

List of all members.

Public Member Functions

 Line_Search ()
 ~Line_Search ()
void set_function (double(*function)(const vec &))
 Set function pointer.
void set_gradient (vec(*gradient)(const vec &))
 Set gradient function pointer.
void set_functions (double(*function)(const vec &), vec(*gradient)(const vec &))
 Set both function and gradient function pointers.
void set_start_point (const vec &x, double F, const vec &g, const vec &h)
 Set start point for search.
void get_solution (vec &xn, double &Fn, vec &gn)
 Get solution, function value and gradient at solution point.
bool search ()
 Do the line search.
bool search (vec &xn, double &Fn, vec &gn)
 Do the line search and return solution.
bool search (const vec &x, double F, const vec &g, const vec &h, vec &xn, double &Fn, vec &gn)
 Set starting point, do the line search, and return the solution.
double get_alpha ()
 return alpha at solution point, xn = x + alpha h
double get_slope_ratio ()
 return the slope ratio at solution poin, xn
int get_no_function_evaluations ()
 return number of function evaluations used in search
void set_stop_values (double rho, double beta)
 Set stop criterion values.
double get_rho ()
 Return stop value rho.
double get_beta ()
 Return stop value beta.
void set_max_iterations (int value)
 Set max number of iterations.
int get_max_iterations ()
 Return max number of iterations.
void set_max_stepsize (double value)
 Set max stepsize.
double get_max_stepsize ()
 Return max number of iterations.
void set_method (const Line_Search_Method &method)
 Set Line search method.
void enable_trace ()
 enable trace mode
void disable_trace ()
 disable trace
void get_trace (vec &alphavalues, vec &Fvalues, vec &dFvalues)


Detailed Description

Line Search.

The line search try to minimize the objective function $f(\mathbf{x})$ along the direction $\mathbf{h}$ from the current position $\mathbf{x}$.

Hence we look at

\[ \varphi(\alpha) = f(\mathbf{x} + \alpha \mathbf{h}) \]

and try to find an $\alpha_s$ that minimizes $f$.

Two variants are used. Either the soft line search (default) or the exact line search.

The soft line search stops when a point in the acceptable region is found, i.e.

\[ \phi(\alpha_s) \leq \varphi(0) + \alpha_s \rho \varphi'(0) \]

and

\[ \varphi'(\alpha_s) \geq \beta \varphi'(0),\: \rho < \beta \]

Default vales are $\rho = 10^{-3}$ and $\beta = 0.99$.

The exact line search

\[ \| \varphi(\alpha_s)\| \leq \rho \| \varphi'(0) \| \]

and

\[ b-a \leq \beta b, \]

where $\left[a,b\right]$ is the current interval for $\alpha_s$. Default vales are $\rho = 10^{-3}$ and $\beta = 10^{-3}$.

The exact line search can at least in theory give the exact resutl, but it may require many extra function evaluations compared to soft line search.

Definition at line 222 of file newton_search.h.


Member Function Documentation

void itpp::Line_Search::set_function double(*)(const vec &)  function  ) 
 

Set function pointer.

Definition at line 350 of file newton_search.cpp.

Referenced by set_functions().

void itpp::Line_Search::set_gradient vec(*)(const vec &)  gradient  ) 
 

Set gradient function pointer.

Definition at line 356 of file newton_search.cpp.

Referenced by set_functions().

void itpp::Line_Search::set_functions double(*)(const vec &)  function,
vec(*)(const vec &)  gradient
[inline]
 

Set both function and gradient function pointers.

Definition at line 234 of file newton_search.h.

References set_function(), and set_gradient().

Referenced by itpp::Newton_Search::search().

void itpp::Line_Search::set_start_point const vec x,
double  F,
const vec g,
const vec h
 

Set start point for search.

Definition at line 371 of file newton_search.cpp.

Referenced by search(), and itpp::Newton_Search::search().

void itpp::Line_Search::get_solution vec xn,
double &  Fn,
vec gn
 

Get solution, function value and gradient at solution point.

Definition at line 384 of file newton_search.cpp.

References it_assert.

Referenced by search().

bool itpp::Line_Search::search  ) 
 

Do the line search.

Definition at line 393 of file newton_search.cpp.

References itpp::abs(), itpp::dot(), itpp::eps, it_assert, max, min, itpp::norm(), and itpp::sqr().

Referenced by search(), and itpp::Newton_Search::search().

bool itpp::Line_Search::search vec xn,
double &  Fn,
vec gn
 

Do the line search and return solution.

Definition at line 571 of file newton_search.cpp.

References get_solution(), and search().

bool itpp::Line_Search::search const vec x,
double  F,
const vec g,
const vec h,
vec xn,
double &  Fn,
vec gn
 

Set starting point, do the line search, and return the solution.

Definition at line 578 of file newton_search.cpp.

References get_solution(), search(), and set_start_point().

double itpp::Line_Search::get_alpha  ) 
 

return alpha at solution point, xn = x + alpha h

Definition at line 588 of file newton_search.cpp.

References it_warning.

Referenced by itpp::Newton_Search::search().

double itpp::Line_Search::get_slope_ratio  ) 
 

return the slope ratio at solution poin, xn

Definition at line 598 of file newton_search.cpp.

References it_warning.

Referenced by itpp::Newton_Search::search().

int itpp::Line_Search::get_no_function_evaluations  ) 
 

return number of function evaluations used in search

Definition at line 608 of file newton_search.cpp.

References it_warning.

Referenced by itpp::Newton_Search::search().

void itpp::Line_Search::set_stop_values double  rho,
double  beta
 

Set stop criterion values.

Definition at line 363 of file newton_search.cpp.

Referenced by itpp::Newton_Search::search().

double itpp::Line_Search::get_rho  )  [inline]
 

Return stop value rho.

Definition at line 262 of file newton_search.h.

double itpp::Line_Search::get_beta  )  [inline]
 

Return stop value beta.

Definition at line 264 of file newton_search.h.

void itpp::Line_Search::set_max_iterations int  value  ) 
 

Set max number of iterations.

Definition at line 619 of file newton_search.cpp.

References it_assert.

Referenced by itpp::Newton_Search::search().

int itpp::Line_Search::get_max_iterations  )  [inline]
 

Return max number of iterations.

Definition at line 269 of file newton_search.h.

void itpp::Line_Search::set_max_stepsize double  value  ) 
 

Set max stepsize.

Definition at line 625 of file newton_search.cpp.

References it_assert.

Referenced by itpp::Newton_Search::search().

double itpp::Line_Search::get_max_stepsize  )  [inline]
 

Return max number of iterations.

Definition at line 274 of file newton_search.h.

void itpp::Line_Search::set_method const Line_Search_Method method  ) 
 

Set Line search method.

Definition at line 631 of file newton_search.cpp.

void itpp::Line_Search::enable_trace  )  [inline]
 

enable trace mode

Definition at line 280 of file newton_search.h.

void itpp::Line_Search::disable_trace  )  [inline]
 

disable trace

Definition at line 282 of file newton_search.h.

void itpp::Line_Search::get_trace vec alphavalues,
vec Fvalues,
vec dFvalues
 

get trace outputs alphavalues are the solutions of every iteration Fvalues are the function values dFvalues

Definition at line 646 of file newton_search.cpp.

References it_warning.


The documentation for this class was generated from the following files:
SourceForge Logo

Generated on Thu Apr 19 14:20:41 2007 for IT++ by Doxygen 1.4.6