25 #include <boost/math/constants/constants.hpp>
29 #include "../exceptions.h"
32 #include "rastrigin.h"
34 namespace pagmo {
namespace problem {
60 pagmo_assert(f.size() == 1);
61 const double omega = 2.0 * boost::math::constants::pi<double>();
63 const decision_vector::size_type n = x.size();
64 for (decision_vector::size_type i = 0; i < n; ++i) {
65 f[0] += x[i] * x[i] - 10.0 * std::cos(omega * x[i]);
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base problem.
std::vector< double > decision_vector
Decision vector type.
base_ptr clone() const
Clone method.
void set_lb(const decision_vector &)
Set lower bounds from pagmo::decision_vector.
std::string get_name() const
Get problem's name.
void set_ub(const decision_vector &)
Set upper bounds from pagmo::decision_vector.
rastrigin(int=1)
Constructor from dimension.
std::vector< double > fitness_vector
Fitness vector type.
void objfun_impl(fitness_vector &, const decision_vector &) const
Implementation of the objective function.