25 #include <boost/integer_traits.hpp>
31 #include "../exceptions.h"
34 #include "luksan_vlcek_3.h"
36 static int __check__(
int N){
39 pagmo_throw(value_error,
"problem dimension N needs to be at least 8 and a multiple of 4");
44 namespace pagmo {
namespace problem {
64 pagmo_throw(value_error,
"constraints lower bound is higher than the upper bound");
68 m_clb = std::vector<double>(2,clb);
69 m_cub = std::vector<double>(2,cub);
82 for (decision_vector::size_type i=0; i<(x.size()-2)/2; i++)
84 double a1 = x[2*i]+10.*x[2*i+1];
85 double a2 = x[2*i+2] - x[2*i+3];
86 double a3 = x[2*i+1] - 2.*x[2*i+2];
87 double a4 = x[2*i] - x[2*i+3];
88 f[0] += a1*a1 + 5.*a2*a2 + std::pow(a3,4)+ 10.*std::pow(a4,4);
96 c[0] = 3.*std::pow(x[0],3) + 2.*x[1] - 5. + std::sin(x[0]-x[1])*std::sin(x[0]+x[1]) - m_cub[0];
97 c[1] = m_clb[0] - ( 3.*std::pow(x[0],3) + 2.*x[1] - 5. + std::sin(x[0]-x[1])*std::sin(x[0]+x[1]) );
98 c[2] = 4.*x[n-3] - x[n-4]*std::exp(x[n-4]-x[n-3]) - 3 - m_cub[1];
99 c[3] = m_clb[1] - ( 4.*x[n-3] - x[n-4]*std::exp(x[n-4]-x[n-3]) - 3 );
113 return "Luksan-Vlcek 3";
boost::shared_ptr< base > base_ptr
Alias for shared pointer to base problem.
std::vector< double > decision_vector
Decision vector type.
void set_sparsity(int &, std::vector< int > &, std::vector< int > &) const
Implementation of the sparsity structure.
size_type get_dimension() const
Return global dimension.
void set_lb(const decision_vector &)
Set lower bounds from pagmo::decision_vector.
std::string get_name() const
Get problem's name.
void compute_constraints_impl(constraint_vector &, const decision_vector &) const
Implementation of the constraint function.
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.
void estimate_sparsity(const decision_vector &, int &lenG, std::vector< int > &iGfun, std::vector< int > &jGvar) const
Heuristics to estimate the sparsity pattern of the problem.
std::vector< double > constraint_vector
Constraint vector type.
Test problem from the Luksan and Vlcek book.
luksan_vlcek_3(int=8, const double &=0, const double &=0)
Constructor.
base_ptr clone() const
Clone method.