27 #include "../exceptions.h"
31 #include "lavor_maculan.h"
33 namespace pagmo {
namespace problem {
45 if (atoms <= 0 || atoms < 4) {
46 pagmo_throw(value_error,
"number of atoms for lavor-maculan problem must be positive and greater than 3");
53 std::vector<decision_vector> best_x(1);
56 double rep[] = {1.039195303, 3.141592654};
57 for(
int i = 0; i < atoms - 3; ++i) {
58 best_x[0].push_back(rep[i % 2]);
73 const decision_vector::size_type n = x.size();
75 for (decision_vector::size_type i = 0 ; i < n ; ++i) {
76 f[0] += 1 + cos(3 * x[i]) + (((i % 2 == 1) ? 1 : -1) / (sqrt(10.60099896 - 4.141720682 * cos(x[i]))));
82 return "Lavor Maculan";
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base problem.
std::vector< double > decision_vector
Decision vector type.
void set_best_x(const std::vector< decision_vector > &)
Sets the best known decision vectors.
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.
The Potential Energy of Molecules problem as proposed by Lavor and Maculan.
lavor_maculan(int=4)
Constructor from dimension.
void set_ub(const decision_vector &)
Set upper bounds from pagmo::decision_vector.
std::vector< double > fitness_vector
Fitness vector type.
void objfun_impl(fitness_vector &, const decision_vector &) const
Implementation of the objective function.