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/tutorial/Lesson2/real_value.h
evomarc b8d4e7faef Initial version of the tutorial.
Warning: all Makefile's are hand-made, and will only work in Linux
2000-11-29 18:19:57 +00:00

18 lines
455 B
C++

#include <vector>
//-----------------------------------------------------------------------------
/** Just a simple function that takes an vector<double> and sets the fitnes
to the sphere function. Please use doubles not float!!!
@param _ind A floatingpoint vector
*/
// INIT
double real_value(const std::vector<double>& _ind)
{
double sum = 0;
for (unsigned i = 0; i < _ind.size(); i++)
sum += _ind[i] * _ind[i];
return -sum;
}