SG++-Doxygen-Documentation
sgpp::optimization::test_problems::TestVectorFunction Class Referenceabstract

Base class for analytical constraint function examples ("test functions"). More...

#include <TestVectorFunction.hpp>

Inheritance diagram for sgpp::optimization::test_problems::TestVectorFunction:
sgpp::optimization::VectorFunction sgpp::optimization::test_problems::FloudasEqualityConstraint sgpp::optimization::test_problems::FloudasInequalityConstraint sgpp::optimization::test_problems::G03EqualityConstraint sgpp::optimization::test_problems::G03InequalityConstraint sgpp::optimization::test_problems::G04EqualityConstraint sgpp::optimization::test_problems::G04InequalityConstraint sgpp::optimization::test_problems::G05EqualityConstraint sgpp::optimization::test_problems::G05InequalityConstraint sgpp::optimization::test_problems::G06EqualityConstraint sgpp::optimization::test_problems::G06InequalityConstraint sgpp::optimization::test_problems::G08EqualityConstraint sgpp::optimization::test_problems::G08InequalityConstraint sgpp::optimization::test_problems::G09EqualityConstraint sgpp::optimization::test_problems::G09InequalityConstraint sgpp::optimization::test_problems::G10EqualityConstraint sgpp::optimization::test_problems::G10InequalityConstraint sgpp::optimization::test_problems::G11EqualityConstraint sgpp::optimization::test_problems::G11InequalityConstraint sgpp::optimization::test_problems::G12EqualityConstraint sgpp::optimization::test_problems::G12InequalityConstraint sgpp::optimization::test_problems::G13EqualityConstraint sgpp::optimization::test_problems::G13InequalityConstraint sgpp::optimization::test_problems::SimionescuEqualityConstraint sgpp::optimization::test_problems::SimionescuInequalityConstraint sgpp::optimization::test_problems::SolandEqualityConstraint sgpp::optimization::test_problems::SolandInequalityConstraint

Public Member Functions

void eval (const base::DataVector &x, base::DataVector &value) override
 Evaluate displaced function. More...
 
virtual void evalUndisplaced (const base::DataVector &x, base::DataVector &value)=0
 Pure virtual method for evaluating the undisplaced function. More...
 
const base::DataVectorgetDisplacement () const
 
void setDisplacement (const base::DataVector &displacement)
 
 TestVectorFunction (size_t d, size_t m)
 Constructor. More...
 
 ~TestVectorFunction () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::optimization::VectorFunction
virtual void clone (std::unique_ptr< VectorFunction > &clone) const =0
 Pure virtual method for cloning the function. More...
 
size_t getNumberOfComponents () const
 
size_t getNumberOfParameters () const
 
 VectorFunction (size_t d, size_t m)
 Constructor. More...
 
virtual ~VectorFunction ()
 Destructor. More...
 

Protected Attributes

base::DataVector displacement
 displacement vector More...
 
base::DataVector xTmp
 temporary vector for displacing More...
 
- Protected Attributes inherited from sgpp::optimization::VectorFunction
size_t d
 dimension of the domain More...
 
size_t m
 number of components More...
 

Detailed Description

Base class for analytical constraint function examples ("test functions").

This class differs from VectorFunction in the way that evaluation point \(\vec{x}\) are pseudorandomly displaced when calling the eval() function. Evaluting the undisplaced function must be implemented in evalUndisplaced. The displaced function is \(\vec{x} \mapsto \vec{f}(\vec{x} + \vec{d})\) for a vector \(\vec{d}\) ("displacement").

Constructor & Destructor Documentation

◆ TestVectorFunction()

sgpp::optimization::test_problems::TestVectorFunction::TestVectorFunction ( size_t  d,
size_t  m 
)

Constructor.

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

Parameters
ddimension of the domain
mnumber of components

◆ ~TestVectorFunction()

sgpp::optimization::test_problems::TestVectorFunction::~TestVectorFunction ( )
override

Destructor.

Member Function Documentation

◆ eval()

void sgpp::optimization::test_problems::TestVectorFunction::eval ( const base::DataVector x,
base::DataVector value 
)
overridevirtual

Evaluate displaced function.

Parameters
xpoint \(\vec{x} \in \mathbb{R}^d\)
[out]value\(\vec{f}(\vec{x} + \vec{d})\) with displacement \(\vec{d}\)

Implements sgpp::optimization::VectorFunction.

References sgpp::optimization::VectorFunction::d, displacement, evalUndisplaced(), and xTmp.

◆ evalUndisplaced()

virtual void sgpp::optimization::test_problems::TestVectorFunction::evalUndisplaced ( const base::DataVector x,
base::DataVector value 
)
pure virtual

Pure virtual method for evaluating the undisplaced function.

Parameters
xpoint \(\vec{x} \in \mathbb{R}^d\)
[out]value\(\vec{f}(\vec{x})\)

Implemented in sgpp::optimization::test_problems::G04EqualityConstraint, sgpp::optimization::test_problems::G05EqualityConstraint, sgpp::optimization::test_problems::G09EqualityConstraint, sgpp::optimization::test_problems::G10EqualityConstraint, sgpp::optimization::test_problems::G03EqualityConstraint, sgpp::optimization::test_problems::FloudasEqualityConstraint, sgpp::optimization::test_problems::G08EqualityConstraint, sgpp::optimization::test_problems::G13EqualityConstraint, sgpp::optimization::test_problems::G06EqualityConstraint, sgpp::optimization::test_problems::G12EqualityConstraint, sgpp::optimization::test_problems::SimionescuEqualityConstraint, sgpp::optimization::test_problems::G11EqualityConstraint, sgpp::optimization::test_problems::SolandEqualityConstraint, sgpp::optimization::test_problems::G04InequalityConstraint, sgpp::optimization::test_problems::G09InequalityConstraint, sgpp::optimization::test_problems::G10InequalityConstraint, sgpp::optimization::test_problems::FloudasInequalityConstraint, sgpp::optimization::test_problems::G05InequalityConstraint, sgpp::optimization::test_problems::G08InequalityConstraint, sgpp::optimization::test_problems::G06InequalityConstraint, sgpp::optimization::test_problems::G03InequalityConstraint, sgpp::optimization::test_problems::G12InequalityConstraint, sgpp::optimization::test_problems::SimionescuInequalityConstraint, sgpp::optimization::test_problems::G11InequalityConstraint, sgpp::optimization::test_problems::G13InequalityConstraint, and sgpp::optimization::test_problems::SolandInequalityConstraint.

Referenced by eval().

◆ getDisplacement()

const base::DataVector & sgpp::optimization::test_problems::TestVectorFunction::getDisplacement ( ) const
Returns
currently used displacement

References displacement.

◆ setDisplacement()

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

Member Data Documentation

◆ displacement

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

displacement vector

Referenced by eval(), getDisplacement(), and setDisplacement().

◆ xTmp

base::DataVector sgpp::optimization::test_problems::TestVectorFunction::xTmp
protected

temporary vector for displacing

Referenced by eval().


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