This repository has been archived on 2026-03-28. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
eodev/eo/test/real_value.h

19 lines
464 B
C++

#include <vector>
//-----------------------------------------------------------------------------
/** Just a simple function that takes an eoEsBase<float> and sets the fitnes
to sphere
@param _ind A floatingpoint vector
*/
double real_value(const std::vector<double>& _ind)
{
double sum = 0; /* compute in double format, even if return a float */
for (unsigned i = 0; i < _ind.size(); i++)
sum += _ind[i] * _ind[i];
return sum;
}