1 #ifndef SHARK_OBJECTIVEFUNCTIONS_BENCHMARK_FONSECA_H 2 #define SHARK_OBJECTIVEFUNCTIONS_BENCHMARK_FONSECA_H 90 const double d = 1. / std::sqrt( static_cast<double>( x.size() ) );
91 double sum1 = 0., sum2 = 0.;
92 for( std::size_t i = 0; i < x.size(); i++ ) {
93 sum1 +=
sqr( x( i ) - d );
94 sum2 +=
sqr( x( i ) + d );
97 value[0] = 1-std::exp( - sum1 );
98 value[1] = 1-std::exp( - sum2 );