RastriginFunction Class Reference

The Rastrigin function, defined by. More...

Public Member Functions

 RastriginFunction (const size_t n)
 
double Evaluate (const arma::mat &coordinates, const size_t begin, const size_t batchSize) const
 
double Evaluate (const arma::mat &coordinates) const
 
arma::mat GetInitialPoint () const
 Get the starting point. More...

 
void Gradient (const arma::mat &coordinates, const size_t begin, arma::mat &gradient, const size_t batchSize) const
 
void Gradient (const arma::mat &coordinates, arma::mat &gradient)
 
size_t NumFunctions () const
 Return 1 (the number of functions). More...

 
void Shuffle ()
 Shuffle the order of function visitation. More...

 

Detailed Description

The Rastrigin function, defined by.

\[ f(x) = 10 * d * \sum_{i=1}^{d} x_i^2 - 10 * \cos(2 * \pi * x_i) \]

This should optimize to f(x) = 0 at x = [0, ..., 0].

For more information, please refer to:

@article{Jamil2013,
title = {Systems of extremal control},
author = {Rastrigin, L. A.},
journal = {Mir},
year = {1974}
}

Definition at line 42 of file rastrigin_function.hpp.

Constructor & Destructor Documentation

◆ RastriginFunction()

RastriginFunction ( const size_t  n)

Member Function Documentation

◆ Evaluate() [1/2]

double Evaluate ( const arma::mat &  coordinates,
const size_t  begin,
const size_t  batchSize 
) const

◆ Evaluate() [2/2]

double Evaluate ( const arma::mat &  coordinates) const

◆ GetInitialPoint()

arma::mat GetInitialPoint ( ) const
inline

Get the starting point.

Definition at line 62 of file rastrigin_function.hpp.

References RastriginFunction::Evaluate(), and RastriginFunction::Gradient().

◆ Gradient() [1/2]

void Gradient ( const arma::mat &  coordinates,
const size_t  begin,
arma::mat &  gradient,
const size_t  batchSize 
) const

◆ Gradient() [2/2]

void Gradient ( const arma::mat &  coordinates,
arma::mat &  gradient 
)

◆ NumFunctions()

size_t NumFunctions ( ) const
inline

Return 1 (the number of functions).

Definition at line 59 of file rastrigin_function.hpp.

◆ Shuffle()

void Shuffle ( )

Shuffle the order of function visitation.

This may be called by the optimizer.


The documentation for this class was generated from the following file: