25 #ifndef PAGMO_ALGORITHM_GSL_GRADIENT_H
26 #define PAGMO_ALGORITHM_GSL_GRADIENT_H
29 #include <gsl/gsl_multimin.h>
30 #include <gsl/gsl_vector.h>
33 #include "../config.h"
34 #include "../population.h"
35 #include "../problem/base.h"
36 #include "../serialization.h"
40 namespace pagmo {
namespace algorithm {
55 std::string human_readable_extra()
const;
57 gsl_gradient(
int,
const double &,
const double &,
const double &,
const double &);
64 virtual const gsl_multimin_fdfminimizer_type *get_gsl_minimiser_ptr()
const = 0;
67 struct objfun_numdiff_wrapper_params
78 static double objfun_numdiff_wrapper(
double,
void *);
80 static void d_objfun_wrapper(
const gsl_vector *,
void *, gsl_vector *);
81 static void fd_objfun_wrapper(
const gsl_vector *,
void *,
double *, gsl_vector *);
82 static void cleanup(gsl_vector *, gsl_multimin_fdfminimizer *);
83 static void check_allocs(gsl_vector *, gsl_multimin_fdfminimizer *);
85 friend class boost::serialization::access;
86 template <
class Archive>
87 void serialize(Archive &ar,
const unsigned int)
89 ar & boost::serialization::base_object<base_gsl>(*this);
90 ar &
const_cast<std::size_t &
>(m_max_iter);
91 ar &
const_cast<double &
>(m_grad_tol);
92 ar &
const_cast<double &
>(m_numdiff_step_size);
93 ar &
const_cast<double &
>(m_step_size);
94 ar &
const_cast<double &
>(m_tol);
96 const std::size_t m_max_iter;
97 const double m_grad_tol;
98 const double m_numdiff_step_size;
99 const double m_step_size;
std::vector< double > decision_vector
Decision vector type.
Base class for GSL algorithms.
std::vector< double > fitness_vector
Fitness vector type.
Wrapper for GSL minimisers with derivatives.
decision_vector::size_type size_type
Problem's size type: the same as pagmo::decision_vector's size type.