Rastrigin function functor (for testing global optimization). f(x) = A*n + sum(x[i]^2 - A*cos(2*pi*x[i])) for all i Default: A = 10 Global minimum at origin with f = 0. Highly multimodal - challenging for local optimizers.
More...
#include <MathUtils_FunctorVector.hxx>
Rastrigin function functor (for testing global optimization). f(x) = A*n + sum(x[i]^2 - A*cos(2*pi*x[i])) for all i Default: A = 10 Global minimum at origin with f = 0. Highly multimodal - challenging for local optimizers.
◆ Rastrigin()
| MathUtils::Rastrigin::Rastrigin |
( |
double | theA = 10.0 | ) |
|
|
inlineexplicit |
Constructor with parameter.
- Parameters
-
| theA | parameter A (default 10.0) |
◆ Gradient()
Evaluates the gradient of the Rastrigin function.
- Parameters
-
| [in] | theX | input vector |
| [out] | theG | gradient vector |
- Returns
- true (always succeeds)
◆ Value()
Evaluates the Rastrigin function.
- Parameters
-
| [in] | theX | input vector |
| [out] | theY | function value |
- Returns
- true (always succeeds)
◆ Values()
Evaluates both value and gradient.
- Parameters
-
| [in] | theX | input vector |
| [out] | theY | function value |
| [out] | theG | gradient vector |
- Returns
- true (always succeeds)
The documentation for this class was generated from the following file: