SG++
sgpp::optimization::test_problems::ConstrainedTestProblem Class Referenceabstract

Base class for analytical, constrained test problems. More...

#include <ConstrainedTestProblem.hpp>

Inheritance diagram for sgpp::optimization::test_problems::ConstrainedTestProblem:

## Public Member Functions

ConstrainedTestProblem (size_t d)
Constructor. More...

void generateDisplacement ()
Generate normally distributed pseudorandom displacement with default standard deviation. More...

void generateDisplacement (double stdDev)
Generate normally distributed pseudorandom displacement. More...

const base::DataVectorgetDisplacement () const

virtual TestVectorFunctiongetEqualityConstraintFunction ()=0

virtual TestVectorFunctiongetInequalityConstraintFunction ()=0

virtual TestScalarFunctiongetObjectiveFunction ()=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)
Returns the displacement vector. More...

virtual ~ConstrainedTestProblem ()
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...

## Detailed Description

Base class for analytical, constrained test problems.

This class essentially manages an objective function and two constraint functions (one inequality and one equality constraint function), generates a Gaussian displacement vector, and contains the location of the optimal point.

## Constructor & Destructor Documentation

 sgpp::optimization::test_problems::ConstrainedTestProblem::ConstrainedTestProblem ( size_t d )
explicit

Constructor.

The displacement is set to all zeros, so to displace the function call generateDisplacement() afterwards.

Parameters
 d dimension of the domain
 sgpp::optimization::test_problems::ConstrainedTestProblem::~ConstrainedTestProblem ( )
virtual

Destructor.

## Member Function Documentation

 void sgpp::optimization::test_problems::ConstrainedTestProblem::generateDisplacement ( )

Generate normally distributed pseudorandom displacement with default standard deviation.

This method also sets the new displacement in the objective function and the constraint functions.

References DEFAULT_STANDARD_DEVIATION.

 void sgpp::optimization::test_problems::ConstrainedTestProblem::generateDisplacement ( double stdDev )

Generate normally distributed pseudorandom displacement.

This method also sets the new displacement in the objective function and the constraint functions.

Parameters
 stdDev standard deviation of the displacement coordinates
 const base::DataVector & sgpp::optimization::test_problems::ConstrainedTestProblem::getDisplacement ( ) const
Returns
currently used displacement

References displacement.

 virtual TestVectorFunction& sgpp::optimization::test_problems::ConstrainedTestProblem::getEqualityConstraintFunction ( )
pure virtual
 virtual TestVectorFunction& sgpp::optimization::test_problems::ConstrainedTestProblem::getInequalityConstraintFunction ( )
pure virtual
 virtual TestScalarFunction& sgpp::optimization::test_problems::ConstrainedTestProblem::getObjectiveFunction ( )
pure virtual
 double sgpp::optimization::test_problems::ConstrainedTestProblem::getOptimalPoint ( base::DataVector & x )

Returns the minimal point of the displaced function.

Parameters
 [out] x reverse displaced minimal point $$\vec{x}_\opt - \vec{d}$$
Returns
minimal function value $$f(\vec{x}_\opt)$$

Referenced by isDisplacementFeasible().

 virtual double sgpp::optimization::test_problems::ConstrainedTestProblem::getOptimalPointUndisplaced ( base::DataVector & x )
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.

Parameters
 [out] x minimal point $$\vec{x}_\opt$$
Returns
minimal function value $$f(\vec{x}_\opt)$$

Referenced by getOptimalPoint().

 bool sgpp::optimization::test_problems::ConstrainedTestProblem::isDisplacementFeasible ( )
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:

1. The optimal point is displaced out of $$[0, 1]^d$$.
2. Singularities, where the function is not well-defined, are displaced into $$[0, 1]^d$$.

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.

Returns
whether the current displacement is feasible

References d, and getOptimalPoint().

Referenced by generateDisplacement().

 void sgpp::optimization::test_problems::ConstrainedTestProblem::setDisplacement ( const base::DataVector & displacement )

Returns the displacement vector.

This method also sets the new displacement in the objective function and the constraint functions.

Parameters
 displacement currently used displacement

## Member Data Documentation

 size_t sgpp::optimization::test_problems::ConstrainedTestProblem::d
protected

number of parameters

 constexpr double sgpp::optimization::test_problems::ConstrainedTestProblem::DEFAULT_STANDARD_DEVIATION = 0.01
static

default standard deviation for the displacement vector

Referenced by generateDisplacement().

 base::DataVector sgpp::optimization::test_problems::ConstrainedTestProblem::displacement
protected

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