29 #ifndef NEWTON_SEARCH_H
30 #define NEWTON_SEARCH_H
35 #include <itpp/itexports.h>
81 void set_function(
double(*
function)(
const vec&));
83 void set_gradient(vec(*gradient)(
const vec&));
85 void set_functions(
double(*
function)(
const vec&), vec(*gradient)(
const vec&)) { set_function(
function); set_gradient(gradient); }
88 void set_start_point(
const vec &x,
const mat &D);
91 void set_start_point(
const vec &x);
101 bool search(
const vec &x0, vec &xn);
104 void set_stop_values(
double epsilon_1,
double epsilon_2);
111 void set_max_evaluations(
int value);
116 void set_initial_stepsize(
double value);
124 double get_function_value();
130 int get_no_iterations();
132 int get_no_function_evaluations();
145 void get_trace(
Array<vec> & xvalues, vec &Fvalues, vec &ngvalues, vec &dvalues);
149 double(*f)(
const vec&);
150 vec(*df_dx)(
const vec&);
161 vec F_values, ng_values, Delta_values;
166 double initial_stepsize;
167 double stop_epsilon_1;
168 double stop_epsilon_2;
176 bool init, finished,
trace;
232 void set_function(
double(*
function)(
const vec&));
234 void set_gradient(vec(*gradient)(
const vec&));
236 void set_functions(
double(*
function)(
const vec&), vec(*gradient)(
const vec&)) { set_function(
function); set_gradient(gradient); }
239 void set_start_point(
const vec &x,
double F,
const vec &g,
const vec &h);
242 void get_solution(vec &xn,
double &Fn, vec &gn);
247 bool search(vec &xn,
double &Fn, vec &gn);
249 bool search(
const vec &x,
double F,
const vec &g,
const vec &h, vec &xn,
250 double &Fn, vec &gn);
256 double get_slope_ratio();
258 int get_no_function_evaluations();
262 void set_stop_values(
double rho,
double beta);
269 void set_max_iterations(
int value);
274 void set_max_stepsize(
double value);
291 void get_trace(vec &alphavalues, vec &Fvalues, vec &dFvalues);
295 double(*f)(
const vec&);
296 vec(*df_dx)(
const vec&);
299 vec x_start, g_start, h_start;
307 vec alpha_values, F_values, dF_values;
336 ITPP_EXPORT vec
fminunc(
double(*
function)(
const vec&), vec(*gradient)(
const vec&),
const vec &x0);
342 #endif // #ifndef NEWTON_SEARCH_H