PaGMO  1.1.5
base_gsl.h
1 /*****************************************************************************
2  * Copyright (C) 2004-2015 The PaGMO development team, *
3  * Advanced Concepts Team (ACT), European Space Agency (ESA) *
4  * *
5  * https://github.com/esa/pagmo *
6  * *
7  * act@esa.int *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License *
20  * along with this program; if not, write to the *
21  * Free Software Foundation, Inc., *
22  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
23  *****************************************************************************/
24 
25 #ifndef PAGMO_ALGORITHM_BASE_GSL_H
26 #define PAGMO_ALGORITHM_BASE_GSL_H
27 
28 #include <boost/thread/mutex.hpp>
29 #include <gsl/gsl_vector.h>
30 
31 #include "../gsl_init.h"
32 #include "../problem/base.h"
33 #include "../serialization.h"
34 #include "../types.h"
35 #include "base.h"
36 
37 namespace pagmo { namespace algorithm {
38 
40 
56 class base_gsl: public base
57 {
58  public:
59  base_gsl();
60  protected:
63  {
65  problem::base const *p;
71  double step_size;
72  };
73  static double objfun_wrapper(const gsl_vector *, void *);
74  private:
75  friend class boost::serialization::access;
76  template <class Archive>
77  void serialize(Archive &ar, const unsigned int)
78  {
79  ar & boost::serialization::base_object<base>(*this);
80  }
81  static const gsl_init &get_init();
82  static boost::mutex m_mutex;
83 };
84 
85 }}
86 
87 #endif
Root PaGMO namespace.
std::vector< double > decision_vector
Decision vector type.
Definition: types.h:40
double step_size
Initial step size for the computation of the gradient.
Definition: base_gsl.h:71
Base algorithm class.
base_gsl()
Default constructor.
Definition: base_gsl.cpp:53
Base problem class.
Definition: problem/base.h:148
Base class for GSL algorithms.
Definition: base_gsl.h:56
fitness_vector f
Fitness vector.
Definition: base_gsl.h:69
std::vector< double > fitness_vector
Fitness vector type.
Definition: types.h:42
static double objfun_wrapper(const gsl_vector *, void *)
Objective function wrapper.
Definition: base_gsl.cpp:67
Structure to feed parameters to the wrappers for the objective function and its derivative.
Definition: base_gsl.h:62
decision_vector x
Decision vector.
Definition: base_gsl.h:67
problem::base const * p
Pointer to the problem.
Definition: base_gsl.h:65