#include <itpp/base/newton_search.h>
Public Member Functions | |
Newton_Search () | |
~Newton_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, const mat &D) |
Set start point x for search and approx inverse Hessian at x . | |
void | set_start_point (const vec &x) |
Set start point x for search. | |
vec | get_solution () |
Get solution, function value and gradient at solution point. | |
bool | search () |
Do the line search. | |
bool | search (vec &xn) |
Do the line search and return solution. | |
bool | search (const vec &x0, vec &xn) |
Set starting point, do the Newton search, and return the solution. | |
void | set_stop_values (double epsilon_1, double epsilon_2) |
Set stop criterion values. | |
double | get_epsilon_1 () |
Return stop value rho. | |
double | get_epsilon_2 () |
Return stop value beta. | |
void | set_max_evaluations (int value) |
Set max number of function evaluations. | |
int | get_max_evaluations () |
Return max number of function evaluations. | |
void | set_initial_stepsize (double value) |
Set max stepsize. | |
double | get_initial_stepsize () |
Return max number of iterations. | |
void | set_method (const Newton_Search_Method &method) |
Set Line search method. | |
double | get_function_value () |
get function value at solution point | |
double | get_stop_1 () |
get value of stop criterion 1 at solution point | |
double | get_stop_2 () |
get value of stop criterion 2 at solution point | |
int | get_no_iterations () |
get number of iterations used to reach solution | |
int | get_no_function_evaluations () |
get number of function evaluations used to reach solution | |
void | enable_trace () |
enable trace mode | |
void | disable_trace () |
disable trace | |
void | get_trace (Array< vec > &xvalues, vec &Fvalues, vec &ngvalues, vec &dvalues) |
Newton or Quasi-Newton optimization method that try to minimize the objective function given an initial guess
.
The search is stopped when either criterion 1:
or criterion 2:
is fulfilled. Another possibility is that the search is stopped when the number of function evaluations exceeds a threshold (100 per default).
The default update rule for the inverse of the Hessian matrix is the BFGS algorithm with an
.
Definition at line 73 of file newton_search.h.
void itpp::Newton_Search::set_function | ( | double(*)(const vec &) | function | ) |
Set function pointer.
Definition at line 60 of file newton_search.cpp.
Referenced by set_functions().
void itpp::Newton_Search::set_gradient | ( | vec(*)(const vec &) | gradient | ) |
Set gradient function pointer.
Definition at line 66 of file newton_search.cpp.
Referenced by set_functions().
void itpp::Newton_Search::set_functions | ( | double(*)(const vec &) | function, | |
vec(*)(const vec &) | gradient | |||
) | [inline] |
Set both function and gradient function pointers.
Definition at line 85 of file newton_search.h.
References set_function(), and set_gradient().
Referenced by itpp::fminunc().
void itpp::Newton_Search::set_start_point | ( | const vec & | x, | |
const mat & | D | |||
) |
Set start point x
for search and approx inverse Hessian at x
.
Definition at line 72 of file newton_search.cpp.
Referenced by search().
void itpp::Newton_Search::set_start_point | ( | const vec & | x | ) |
Set start point x
for search.
Definition at line 83 of file newton_search.cpp.
References itpp::eye().
vec itpp::Newton_Search::get_solution | ( | ) |
Get solution, function value and gradient at solution point.
Definition at line 257 of file newton_search.cpp.
References it_assert.
Referenced by search().
bool itpp::Newton_Search::search | ( | ) |
Do the line search.
Definition at line 94 of file newton_search.cpp.
References itpp::abs(), itpp::dot(), itpp::eps, itpp::Line_Search::get_alpha(), itpp::Line_Search::get_no_function_evaluations(), itpp::Line_Search::get_slope_ratio(), it_assert, max, itpp::max(), itpp::norm(), itpp::outer_product(), itpp::Line_Search::search(), itpp::Line_Search::set_functions(), itpp::Line_Search::set_max_iterations(), itpp::Line_Search::set_max_stepsize(), itpp::Array< T >::set_size(), itpp::Line_Search::set_start_point(), itpp::Line_Search::set_stop_values(), itpp::sqrt(), and itpp::zeros().
Referenced by itpp::fminunc(), and search().
bool itpp::Newton_Search::search | ( | vec & | xn | ) |
Do the line search and return solution.
Definition at line 242 of file newton_search.cpp.
References get_solution(), and search().
bool itpp::Newton_Search::search | ( | const vec & | x0, | |
vec & | xn | |||
) |
Set starting point, do the Newton search, and return the solution.
Definition at line 249 of file newton_search.cpp.
References get_solution(), search(), and set_start_point().
void itpp::Newton_Search::set_stop_values | ( | double | epsilon_1, | |
double | epsilon_2 | |||
) |
Set stop criterion values.
double itpp::Newton_Search::get_epsilon_1 | ( | ) | [inline] |
double itpp::Newton_Search::get_epsilon_2 | ( | ) | [inline] |
void itpp::Newton_Search::set_max_evaluations | ( | int | value | ) |
Set max number of function evaluations.
int itpp::Newton_Search::get_max_evaluations | ( | ) | [inline] |
void itpp::Newton_Search::set_initial_stepsize | ( | double | value | ) |
Set max stepsize.
double itpp::Newton_Search::get_initial_stepsize | ( | ) | [inline] |
void itpp::Newton_Search::set_method | ( | const Newton_Search_Method & | method | ) |
Set Line search method.
double itpp::Newton_Search::get_function_value | ( | ) |
get function value at solution point
Definition at line 263 of file newton_search.cpp.
References it_warning.
double itpp::Newton_Search::get_stop_1 | ( | ) |
get value of stop criterion 1 at solution point
Definition at line 273 of file newton_search.cpp.
References it_warning.
double itpp::Newton_Search::get_stop_2 | ( | ) |
get value of stop criterion 2 at solution point
Definition at line 283 of file newton_search.cpp.
References it_warning.
int itpp::Newton_Search::get_no_iterations | ( | ) |
get number of iterations used to reach solution
Definition at line 293 of file newton_search.cpp.
References it_warning.
int itpp::Newton_Search::get_no_function_evaluations | ( | ) |
get number of function evaluations used to reach solution
Definition at line 303 of file newton_search.cpp.
References it_warning.
void itpp::Newton_Search::enable_trace | ( | ) | [inline] |
void itpp::Newton_Search::disable_trace | ( | ) | [inline] |
void itpp::Newton_Search::get_trace | ( | Array< vec > & | xvalues, | |
vec & | Fvalues, | |||
vec & | ngvalues, | |||
vec & | dvalues | |||
) |
get trace outputs xvalues
are the solutions of every iteration Fvalues
are the function values ngvalues
are the norm(gradient,inf) values dvalues
are the delta values
Definition at line 314 of file newton_search.cpp.
References it_warning.
Generated on Fri Jun 8 01:07:23 2007 for IT++ by Doxygen 1.5.2