#include <newton_search.h>
| Public Member Functions | |
| Line_Search () | |
| Default constructor. | |
| ~Line_Search () | |
| Destructor. | |
| 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) | 
The line search try to minimize the objective function  along the direction
 along the direction  from the current position
 from the current position  .
.
Hence we look at
![\[ \varphi(\alpha) = f(\mathbf{x} + \alpha \mathbf{h}) \]](form_330.png) 
 and try to find an  that minimizes
 that minimizes  .
.
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) \]](form_333.png) 
and
![\[ \varphi'(\alpha_s) \geq \beta \varphi'(0),\: \rho < \beta \]](form_334.png) 
 Default vales are  and
 and  .
.
The exact line search
![\[ \| \varphi(\alpha_s)\| \leq \rho \| \varphi'(0) \| \]](form_337.png) 
and
![\[ b-a \leq \beta b, \]](form_338.png) 
 where ![$\left[a,b\right]$](form_339.png) is the current interval for
 is the current interval for  . Default vales are
. Default vales are  and
 and  .
.
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.
| 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 
References it_warning.
 1.5.8
 1.5.8