3 #ifndef MYGSL_MULTIDIMENSIONAL_MINIMIZATION_H 4 #define MYGSL_MULTIDIMENSIONAL_MINIMIZATION_H 1 11 #include <gsl/gsl_multimin.h> 12 #include <gsl/gsl_vector.h> 13 #include <gsl/gsl_deriv.h> 39 int eval_f (
const double * x_ ,
double & f_);
41 int eval_df (
const double * x_ ,
double * gradient_);
48 size_t dimension_)
const;
54 bool use_numeric_eval_ =
false);
67 virtual double _eval(
double x_)
const;
78 void plot_f(
const std::string & prefix_,
int mode_ = 0)
const;
83 virtual int _eval_f (
double & f_) = 0;
87 virtual int _eval_df (
double * gradient_);
91 int _eval_f_MR_(
double & f_);
92 int _eval_df_MR_(
double * gradient_);
93 int _numerical_eval_df_MR_(
double * gradient_);
97 bool _numeric_eval_df_;
98 double _out_of_limit_slope_;
111 static double f(
const gsl_vector * v_,
void * params_);
113 static void df(
const gsl_vector * v_,
void * params_, gsl_vector * gradient_);
115 static void fdf(
const gsl_vector * v_,
void * params_,
double * f_, gsl_vector * gradient_);
134 virtual void action (
int status_ ,
146 action (status_, iter_, x_, dim_, f_);
154 virtual void action (
int status_ ,
170 const gsl_multimin_fdfminimizer_type * _algo_fdf_;
171 const gsl_multimin_fminimizer_type * _algo_f_;
172 gsl_multimin_fdfminimizer * _fdfmin_;
173 gsl_multimin_fminimizer * _fmin_;
174 gsl_multimin_function _f_;
175 gsl_multimin_function_fdf _fdf_;
180 double _fdf_step_size_;
184 size_t _modulo_iter_;
193 void _init_algorithm_ (
const std::string & name_);
195 void _set_mode_ (
int mode_);
223 void init (
const std::string & name_ ,
250 #endif // MYGSL_MULTIDIMENSIONAL_MINIMIZATION_H static void df(const gsl_vector *v_, void *params_, gsl_vector *gradient_)
virtual ~multidimensional_minimization_system()
System for multidimensional minimization algorithm.
Definition: multidimensional_minimization.h:24
static bool name_is_valid(const std::string &name_)
void to_double_star(double *pars_, size_t dimension_) const
size_t get_modulo_iter() const
void set_step_action(at_step_action &asd_)
static void fdf(const gsl_vector *v_, void *params_, double *f_, gsl_vector *gradient_)
int eval_f(const double *x_, double &f_)
datatools::logger::priority logging
Definition: multidimensional_minimization.h:165
static default_step_action __default_step_action
Definition: multidimensional_minimization.h:161
static double f(const gsl_vector *v_, void *params_)
multidimensional_minimization()
virtual void action(int status_, size_t iter_, double *x_, size_t dim_, double f_)=0
void set_max_iter(size_t max_)
void set_default_step_action()
static const size_t DEFAULT_MODULO_ITER
Definition: multidimensional_minimization.h:108
std::string get_name() const
virtual int _eval_f(double &f_)=0
double get_out_of_limit_slope() const
Definition: multidimensional_minimization.h:121
virtual void action(int status_, size_t iter_, double *x_, size_t dim_, double f_)
virtual double _eval(double x_) const
The function evaluation abstract method.
void devel_dump_x() const
Definition: multidimensional_minimization.h:129
double get_epsabs() const
void operator()(int status_, size_t iter_, double *x_, size_t dim_, double f_)
Definition: multidimensional_minimization.h:140
stopping_t
Definition: multidimensional_minimization.h:124
void plot_f(const std::string &prefix_, int mode_=0) const
int eval_df(const double *x_, double *gradient_)
multidimensional_minimization_system(double slope_=DEFAULT_OUT_OF_LIMIT_SLOPE, bool use_numeric_eval_=false)
static const size_t DEFAULT_MAX_ITER
Definition: multidimensional_minimization.h:107
multidimensional_minimization_system * sys
Definition: multidimensional_minimization.h:72
Abstract interface for unary functions : R -> R.
Definition: i_unary_function.h:44
int eval_fdf(const double *x_, double &f_, double *gradient_)
size_t get_n_iter() const
static double func_eval_f_MR(double x_, void *params_)
func_eval_f_param(int free_param_index_, multidimensional_minimization_system &sys_)
void set_numeric_eval_df(bool=true)
Multidimensional minimization algorithm.
Definition: multidimensional_minimization.h:103
virtual int _eval_df(double *gradient_)
static void print_types(std::ostream &)
virtual ~multidimensional_minimization()
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
Definition: multidimensional_minimization.h:58
Definition: multidimensional_minimization.h:120
int free_param_index
Definition: multidimensional_minimization.h:71
Utilities for logging information.
void from_double_star(const double *pars_, size_t dimension_)
Definition: multidimensional_minimization.h:125
void init(const std::string &name_, multidimensional_minimization_system &ms_)
void set_modulo_iter(size_t modulo_)
mode_t
Definition: multidimensional_minimization.h:119
static const double DEFAULT_EPSABS
Definition: multidimensional_minimization.h:109
void _at_step_hook(int status_, size_t iter_, double *x_, size_t dim_, double f_)
size_t get_max_iter() const
bool is_numeric_eval_df() const
Definition: multidimensional_minimization.h:151
int minimize(double epsabs_)
static const double DEFAULT_OUT_OF_LIMIT_SLOPE
Definition: multidimensional_minimization.h:29
Definition: multidimensional_minimization.h:126
System with several parameters.
Definition: multiparameter_system.h:16