|
GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
|
Implementation of the Sphere function. More...
#include <SphereFunction.h>
Public Member Functions | |
| SphereFunction (const std::size_t dim, GeneType lb, GeneType ub) | |
| Constructs the Sphere function with given dimensions and bounds. | |
| double | evaluate (const std::vector< GeneType > &phenotype) const override |
| Evaluates the N-dimensional Sphere function. | |
| std::size_t | size () const override |
| Returns the dimensionality of the optimization problem. | |
| std::string | name () const override |
| Short identifier used to select a GPU evaluation kernel. | |
| GeneType | getLowerBound (std::size_t) const override |
| Gets the lower bound for a specific dimension. | |
| GeneType | getUpperBound (std::size_t) const override |
| Gets the upper bound for a specific dimension. | |
Public Member Functions inherited from galib::FitnessFunction< GeneType > | |
| virtual | ~FitnessFunction ()=default |
| GeneType | getLowerBound () const |
| Convenience method to get the lower bound of the first dimension. | |
| GeneType | getUpperBound () const |
| Convenience method to get the upper bound of the first dimension. | |
Implementation of the Sphere function.
A simple unimodal function representing an n-dimensional paraboloid. Global minimum: f(0, ..., 0) = 0.
| GeneType | The numeric type of the genes. |
Definition at line 28 of file SphereFunction.h.
|
inlineexplicit |
Constructs the Sphere function with given dimensions and bounds.
| dim | Problem dimensionality. |
| lb | Uniform lower bound. |
| ub | Uniform upper bound. |
Definition at line 40 of file SphereFunction.h.
|
inlineoverridevirtual |
Evaluates the N-dimensional Sphere function.
| phenotype | Input vector. |
Implements galib::FitnessFunction< GeneType >.
Definition at line 48 of file SphereFunction.h.
|
inlineoverridevirtual |
Gets the lower bound for a specific dimension.
| dimension | Index of the dimension. |
Implements galib::FitnessFunction< GeneType >.
Definition at line 59 of file SphereFunction.h.
|
inlineoverridevirtual |
Gets the upper bound for a specific dimension.
| dimension | Index of the dimension. |
Implements galib::FitnessFunction< GeneType >.
Definition at line 60 of file SphereFunction.h.
|
inlineoverridevirtual |
Short identifier used to select a GPU evaluation kernel.
Override in benchmark subclasses to enable GPU-side evaluation ("Sphere", "Rastrigin", "HeavyTrig"). Return empty string (default) to use the CPU callback path.
Reimplemented from galib::FitnessFunction< GeneType >.
Definition at line 57 of file SphereFunction.h.
|
inlineoverridevirtual |
Returns the dimensionality of the optimization problem.
Implements galib::FitnessFunction< GeneType >.
Definition at line 56 of file SphereFunction.h.