SG++-Doxygen-Documentation
|
Base class for analytical constraint function examples ("test functions"). More...
#include <TestVectorFunction.hpp>
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::DataVector & | getDisplacement () 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... | |
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").
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.
d | dimension of the domain |
m | number of components |
|
override |
Destructor.
|
overridevirtual |
Evaluate displaced function.
x | point \(\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.
|
pure virtual |
Pure virtual method for evaluating the undisplaced function.
x | point \(\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().
const base::DataVector & sgpp::optimization::test_problems::TestVectorFunction::getDisplacement | ( | ) | const |
References displacement.
void sgpp::optimization::test_problems::TestVectorFunction::setDisplacement | ( | const base::DataVector & | displacement | ) |
displacement | currently used displacement |
References displacement.
Referenced by sgpp::optimization::test_problems::ConstrainedTestProblem::generateDisplacement(), and sgpp::optimization::test_problems::ConstrainedTestProblem::setDisplacement().
|
protected |
displacement vector
Referenced by eval(), getDisplacement(), and setDisplacement().
|
protected |
temporary vector for displacing
Referenced by eval().