25 #ifndef PAGMO_ALGORITHM_BASE_NLOPT_H
26 #define PAGMO_ALGORITHM_BASE_NLOPT_H
32 #include "../config.h"
33 #include "../population.h"
34 #include "../problem/base.h"
35 #include "../serialization.h"
39 namespace pagmo {
namespace algorithm {
61 base_nlopt(nlopt::algorithm,
bool,
bool,
int,
const double &,
const double &);
63 std::string human_readable_extra()
const;
65 struct nlopt_wrapper_data
74 int get_last_status()
const;
75 static double objfun_wrapper(
const std::vector<double> &, std::vector<double> &,
void*);
76 static double constraints_wrapper(
const std::vector<double> &, std::vector<double> &,
void*);
77 virtual void set_local(
size_t d)
const;
79 friend class boost::serialization::access;
80 template <
class Archive>
81 void serialize(Archive &ar,
const unsigned int)
83 ar & boost::serialization::base_object<base>(*this);
84 ar &
const_cast<nlopt::algorithm &
>(m_algo);
85 ar &
const_cast<bool &
>(m_constrained);
86 ar &
const_cast<bool &
>(m_only_ineq);
87 ar &
const_cast<std::size_t &
>(m_max_iter);
88 ar &
const_cast<double &
>(m_ftol);
89 ar &
const_cast<double &
>(m_xtol);
91 const nlopt::algorithm m_algo;
96 const bool m_constrained;
97 const bool m_only_ineq;
std::vector< double > decision_vector
Decision vector type.
nlopt::opt m_opt
NLOPT optimization method.
const double m_xtol
Tolerance on the decision_vector variation function (stopping criteria)
Base class for wrapping NLopt's algorithms.
const std::size_t m_max_iter
Maximum number of iterations.
const double m_ftol
Tolerance on the fitness function variation (stopping criteria)
std::vector< double > fitness_vector
Fitness vector type.
std::vector< double > constraint_vector
Constraint vector type.
constraint_vector::size_type c_size_type
Constraints' size type: the same as pagmo::constraint_vector's size type.