40 #ifndef SHARK_OBJECTIVEFUNCTIONS_BENCHMARK_LZ8_H 41 #define SHARK_OBJECTIVEFUNCTIONS_BENCHMARK_LZ8_H 92 std::size_t counter1 = 0, counter2 = 0;
93 for( std::size_t i = 1; i < x.size(); i++ ) {
94 double y = x(i) - ::pow( x(0), 0.5*(1.0 + 3*(i-1)/(x.size()-1) ) );
99 for( std::size_t j = 0; j < x.size(); j++ )
101 product *= ::cos( 20 * y * M_PI / ::sqrt( static_cast<double>( j ) ) );
102 value[1] -= product + 2.;
105 value[0] +=
sqr( y );
107 for( std::size_t j = 0; j < x.size(); j++ )
109 product *= ::cos( 20 * y * M_PI / ::sqrt( static_cast<double>( j ) ) );
110 value[0] -= product + 2.;
114 value[0] *= 8./counter1;
117 value[1] *= 8./counter2;
118 value[1] += 1 - ::sqrt( x( 0 ) );