Initial version of the tutorial.
Warning: all Makefile's are hand-made, and will only work in Linux
This commit is contained in:
parent
a27dc53ef0
commit
b8d4e7faef
48 changed files with 9174 additions and 0 deletions
18
eo/tutorial/Lesson2/real_value.h
Normal file
18
eo/tutorial/Lesson2/real_value.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in a new issue