SG++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sgpp::optimization::IterativeGridGenerator Class Referenceabstract

Abstract base class for iterative grid generation methods. More...

#include <IterativeGridGenerator.hpp>

Inheritance diagram for sgpp::optimization::IterativeGridGenerator:
sgpp::optimization::IterativeGridGeneratorLinearSurplus sgpp::optimization::IterativeGridGeneratorRitterNovak sgpp::optimization::IterativeGridGeneratorSOO

Public Member Functions

virtual bool generate ()=0
 Pure virtual method for iterative grid generation. More...
 
const base::DataVectorgetFunctionValues () const
 
base::GridgetGrid () const
 
 IterativeGridGenerator (ScalarFunction &f, base::Grid &grid, size_t N)
 Constructor. More...
 
virtual ~IterativeGridGenerator ()
 Destructor. More...
 

Protected Member Functions

void evalFunction (size_t oldGridSize=0)
 Evaluates the objective function at grid points with indices [oldGridSize, oldGridSize + 1, ..., grid.getSize() - 1] and saves values in functionValues. More...
 
void undoRefinement (size_t oldGridSize)
 Removes grid points with indices [oldGridSize, oldGridSize + 1, ..., grid.getSize() - 1] from the grid. More...
 

Protected Attributes

ScalarFunctionf
 objective function More...
 
base::DataVector functionValues
 vector of function values at the grid points More...
 
base::Gridgrid
 underlying grid More...
 
size_t N
 maximal number of grid points More...
 

Detailed Description

Abstract base class for iterative grid generation methods.

Constructor & Destructor Documentation

sgpp::optimization::IterativeGridGenerator::IterativeGridGenerator ( ScalarFunction f,
base::Grid grid,
size_t  N 
)

Constructor.

Do not destruct the grid before this object!

Parameters
fobjective function
gridgrid (should be empty)
Nmaximal number of grid points
sgpp::optimization::IterativeGridGenerator::~IterativeGridGenerator ( )
virtual

Destructor.

Member Function Documentation

void sgpp::optimization::IterativeGridGenerator::evalFunction ( size_t  oldGridSize = 0)
protected
virtual bool sgpp::optimization::IterativeGridGenerator::generate ( )
pure virtual

Pure virtual method for iterative grid generation.

Returns
true on success, otherwise false

Implemented in sgpp::optimization::IterativeGridGeneratorRitterNovak, sgpp::optimization::IterativeGridGeneratorLinearSurplus, and sgpp::optimization::IterativeGridGeneratorSOO.

const base::DataVector & sgpp::optimization::IterativeGridGenerator::getFunctionValues ( ) const
Returns
vector of function values at the grid points

References functionValues.

Referenced by sgpp::optimization::Printer::printIterativeGridGenerator().

base::Grid & sgpp::optimization::IterativeGridGenerator::getGrid ( ) const
Returns
underlying grid

References grid.

Referenced by sgpp::optimization::Printer::printIterativeGridGenerator().

void sgpp::optimization::IterativeGridGenerator::undoRefinement ( size_t  oldGridSize)
protected

Removes grid points with indices [oldGridSize, oldGridSize + 1, ..., grid.getSize() - 1] from the grid.

Parameters
oldGridSizenumber of grid points after removal

References sgpp::base::HashGridStorage::deletePoints(), sgpp::base::HashGridStorage::getSize(), sgpp::base::Grid::getStorage(), and grid.

Referenced by sgpp::optimization::IterativeGridGeneratorSOO::generate(), sgpp::optimization::IterativeGridGeneratorLinearSurplus::generate(), and sgpp::optimization::IterativeGridGeneratorRitterNovak::generate().

Member Data Documentation

ScalarFunction& sgpp::optimization::IterativeGridGenerator::f
protected

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