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&));
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);
124 double get_function_value();
130 int get_no_iterations();
132 int get_no_function_evaluations();
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&));
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);
296 vec(*df_dx)(
const vec&);
299 vec x_start, g_start, h_start;
307 vec alpha_values, F_values, dF_values;
336ITPP_EXPORT vec
fminunc(
double(*function)(
const vec&), vec(*gradient)(
const vec&),
const vec &x0);
Definition of Array class (container)
Import/Export definitions for some templates defined in base folder.
double get_max_stepsize()
Return max number of iterations.
~Line_Search()
Destructor.
void set_functions(double(*function)(const vec &), vec(*gradient)(const vec &))
Set both function and gradient function pointers.
void disable_trace()
disable trace
double get_rho()
Return stop value rho.
void enable_trace()
enable trace mode
int get_max_iterations()
Return max number of iterations.
double get_beta()
Return stop value beta.
void set_stop_values(double epsilon_1, double epsilon_2)
Set stop criterion values.
double get_epsilon_1()
Return stop value rho.
~Newton_Search()
Destructor.
double get_initial_stepsize()
Return max number of iterations.
void set_initial_stepsize(double value)
Set max stepsize.
void disable_trace()
disable trace
void set_functions(double(*function)(const vec &), vec(*gradient)(const vec &))
Set both function and gradient function pointers.
void set_max_evaluations(int value)
Set max number of function evaluations.
void enable_trace()
enable trace mode
int get_max_evaluations()
Return max number of function evaluations.
void set_method(const Newton_Search_Method &method)
Set Line search method.
double get_epsilon_2()
Return stop value beta.
T trace(const Mat< T > &m)
The trace of the matrix m, i.e. the sum of the diagonal elements.
Newton_Search_Method
Newton Search method.
Line_Search_Method
Line Search method.
vec fminunc(double(*function)(const vec &), vec(*gradient)(const vec &), const vec &x0)
Unconstrained minimization.
Templated Vector Class Definitions.