SG++-Doxygen-Documentation
|
Base class for analytical, unconstrained test problems. More...
#include <UnconstrainedTestProblem.hpp>
Public Member Functions | |
void | generateDisplacement () |
Generate normally distributed pseudorandom displacement with default standard deviation. More... | |
void | generateDisplacement (double stdDev) |
Generate normally distributed pseudorandom displacement. More... | |
const base::DataVector & | getDisplacement () const |
virtual TestScalarFunction & | getObjectiveFunction ()=0 |
double | getOptimalPoint (base::DataVector &x) |
Returns the minimal point of the displaced function. More... | |
virtual double | getOptimalPointUndisplaced (base::DataVector &x)=0 |
Pure virtual method returning the minimal point (or one of the minimal points, if there are multiple of them) of the test function. More... | |
void | setDisplacement (const base::DataVector &displacement) |
Sets the displacement vector. More... | |
UnconstrainedTestProblem (size_t d) | |
Constructor. More... | |
virtual | ~UnconstrainedTestProblem () |
Destructor. More... | |
Static Public Attributes | |
static constexpr double | DEFAULT_STANDARD_DEVIATION = 0.01 |
default standard deviation for the displacement vector More... | |
Protected Member Functions | |
virtual bool | isDisplacementFeasible () |
Checks if the current displacement is ok for the specific objective function. More... | |
Protected Attributes | |
size_t | d |
number of parameters More... | |
base::DataVector | displacement |
displacement vector More... | |
Base class for analytical, unconstrained test problems.
This class essentially manages an objective function, generates a Gaussian displacement vector, and contains the location of the optimal point.
|
explicit |
Constructor.
The displacement is set to all zeros, so to displace the function call generateDisplacement() afterwards.
d | dimension of the domain |
|
virtual |
Destructor.
void sgpp::optimization::test_problems::UnconstrainedTestProblem::generateDisplacement | ( | ) |
Generate normally distributed pseudorandom displacement with default standard deviation.
This method also sets the new displacement in the objective function.
References DEFAULT_STANDARD_DEVIATION.
void sgpp::optimization::test_problems::UnconstrainedTestProblem::generateDisplacement | ( | double | stdDev | ) |
Generate normally distributed pseudorandom displacement.
This method also sets the new displacement in the objective function.
stdDev | standard deviation of the displacement coordinates |
References d, displacement, sgpp::optimization::RandomNumberGenerator::getGaussianRN(), sgpp::optimization::RandomNumberGenerator::getInstance(), getObjectiveFunction(), isDisplacementFeasible(), and sgpp::optimization::test_problems::TestScalarFunction::setDisplacement().
const base::DataVector & sgpp::optimization::test_problems::UnconstrainedTestProblem::getDisplacement | ( | ) | const |
References displacement.
|
pure virtual |
Implemented in sgpp::optimization::test_problems::TremblingParabola, sgpp::optimization::test_problems::Hartman6, sgpp::optimization::test_problems::Hartman3, sgpp::optimization::test_problems::Eggholder, sgpp::optimization::test_problems::EasomYang, sgpp::optimization::test_problems::Griewank, sgpp::optimization::test_problems::Ackley, sgpp::optimization::test_problems::BubbleWrap, sgpp::optimization::test_problems::HoelderTable, sgpp::optimization::test_problems::IncreasingPower, sgpp::optimization::test_problems::Perm, sgpp::optimization::test_problems::Rastrigin, sgpp::optimization::test_problems::Rosenbrock, sgpp::optimization::test_problems::GoldsteinPrice, sgpp::optimization::test_problems::Schwefel, sgpp::optimization::test_problems::AbsoluteValue, sgpp::optimization::test_problems::Branin, sgpp::optimization::test_problems::Sphere, sgpp::optimization::test_problems::Beale, sgpp::optimization::test_problems::Mladineo, sgpp::optimization::test_problems::SHCB, sgpp::optimization::test_problems::Himmelblau, and sgpp::optimization::test_problems::Michalewicz.
Referenced by generateDisplacement(), and setDisplacement().
double sgpp::optimization::test_problems::UnconstrainedTestProblem::getOptimalPoint | ( | base::DataVector & | x | ) |
Returns the minimal point of the displaced function.
[out] | x | reverse displaced minimal point \(\vec{x}_\opt - \vec{d}\) |
References displacement, getOptimalPointUndisplaced(), and sgpp::base::DataVector::sub().
Referenced by isDisplacementFeasible().
|
pure virtual |
Pure virtual method returning the minimal point (or one of the minimal points, if there are multiple of them) of the test function.
[out] | x | minimal point \(\vec{x}_\opt\) |
Implemented in sgpp::optimization::test_problems::TremblingParabola, sgpp::optimization::test_problems::Hartman6, sgpp::optimization::test_problems::Hartman3, sgpp::optimization::test_problems::Eggholder, sgpp::optimization::test_problems::EasomYang, sgpp::optimization::test_problems::Griewank, sgpp::optimization::test_problems::Ackley, sgpp::optimization::test_problems::BubbleWrap, sgpp::optimization::test_problems::HoelderTable, sgpp::optimization::test_problems::IncreasingPower, sgpp::optimization::test_problems::Perm, sgpp::optimization::test_problems::Rastrigin, sgpp::optimization::test_problems::Rosenbrock, sgpp::optimization::test_problems::GoldsteinPrice, sgpp::optimization::test_problems::Schwefel, sgpp::optimization::test_problems::AbsoluteValue, sgpp::optimization::test_problems::Branin, sgpp::optimization::test_problems::Sphere, sgpp::optimization::test_problems::Beale, sgpp::optimization::test_problems::Mladineo, sgpp::optimization::test_problems::SHCB, sgpp::optimization::test_problems::Himmelblau, and sgpp::optimization::test_problems::Michalewicz.
Referenced by getOptimalPoint().
|
protectedvirtual |
Checks if the current displacement is ok for the specific objective function.
An infeasible displacement would be one for which one of the following happens:
This function is called by generateDisplacement to check the feasibility of the new displacement. Only 1. will be checked by default. For additional constraints on the displacement, override this function.
Reimplemented in sgpp::optimization::test_problems::Eggholder, sgpp::optimization::test_problems::HoelderTable, and sgpp::optimization::test_problems::Mladineo.
References d, and getOptimalPoint().
Referenced by generateDisplacement(), sgpp::optimization::test_problems::Mladineo::isDisplacementFeasible(), sgpp::optimization::test_problems::HoelderTable::isDisplacementFeasible(), and sgpp::optimization::test_problems::Eggholder::isDisplacementFeasible().
void sgpp::optimization::test_problems::UnconstrainedTestProblem::setDisplacement | ( | const base::DataVector & | displacement | ) |
Sets the displacement vector.
This method also sets the new displacement in the objective function.
displacement | currently used displacement |
References displacement, getObjectiveFunction(), and sgpp::optimization::test_problems::TestScalarFunction::setDisplacement().
|
protected |
number of parameters
Referenced by generateDisplacement(), sgpp::optimization::test_problems::Sphere::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::AbsoluteValue::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::Schwefel::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::Rastrigin::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::Rosenbrock::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::Ackley::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::IncreasingPower::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::Perm::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::BubbleWrap::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::Griewank::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::EasomYang::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::TremblingParabola::getOptimalPointUndisplaced(), and isDisplacementFeasible().
|
static |
default standard deviation for the displacement vector
Referenced by generateDisplacement().
|
protected |
displacement vector
Referenced by generateDisplacement(), getDisplacement(), getOptimalPoint(), sgpp::optimization::test_problems::Mladineo::isDisplacementFeasible(), sgpp::optimization::test_problems::HoelderTable::isDisplacementFeasible(), sgpp::optimization::test_problems::Eggholder::isDisplacementFeasible(), and setDisplacement().