7 virtual double fun(double *w) = 0 ;
8 virtual void grad(double *w, double *g) = 0 ;
9 virtual void Hv(double *s, double *Hs) = 0 ;
10 virtual int get_nr_variable(void) = 0 ;
11 virtual void get_diag_preconditioner(double *M) = 0 ;
12 virtual ~function(void){}
14 // base implementation in newton.cpp
15 virtual double linesearch_and_update(double *w, double *s, double *f, double *g, double alpha);
21 NEWTON(const function *fun_obj, double eps = 0.1, double eps_cg = 0.5, int max_iter = 1000);
24 void newton(double *w);
25 void set_print_string(void (*i_print) (const char *buf));
28 int pcg(double *g, double *M, double *s, double *r);
34 void info(const char *fmt,...);
35 void (*newton_print_string)(const char *buf);