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

Iterative grid generation based on linear surplusses. More...

#include <IterativeGridGeneratorLinearSurplus.hpp>

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

Public Member Functions

bool generate () override
 Generate the grid. More...
 
double getAdaptivity () const
 
base::level_t getInitialLevel () const
 
 IterativeGridGeneratorLinearSurplus (ScalarFunction &f, base::Grid &grid, size_t N, double adaptivity=DEFAULT_ADAPTIVITY, base::level_t initialLevel=DEFAULT_INITIAL_LEVEL)
 Constructor. More...
 
void setAdaptivity (double adaptivity)
 
void setInitialLevel (base::level_t initialLevel)
 
 ~IterativeGridGeneratorLinearSurplus () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::optimization::IterativeGridGenerator
const base::DataVectorgetFunctionValues () const
 
base::GridgetGrid () const
 
 IterativeGridGenerator (ScalarFunction &f, base::Grid &grid, size_t N)
 Constructor. More...
 
virtual ~IterativeGridGenerator ()
 Destructor. More...
 

Static Public Attributes

static constexpr double DEFAULT_ADAPTIVITY = 0.2
 default adaptivity More...
 
static const base::level_t DEFAULT_INITIAL_LEVEL = 3
 default level of initial regular sparse grid More...
 

Protected Attributes

double gamma
 adaptivity More...
 
base::level_t initialLevel
 level of initial regular sparse grid More...
 
std::unique_ptr< base::GridlinearGrid
 pointer to a linear grid (of the same type as the "real" grid) More...
 
- Protected Attributes inherited from sgpp::optimization::IterativeGridGenerator
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...
 

Additional Inherited Members

- Protected Member Functions inherited from sgpp::optimization::IterativeGridGenerator
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...
 

Detailed Description

Iterative grid generation based on linear surplusses.

In each iteration, the fraction of \(gamma\) (e.g. \(\gamma = 0.2\) means 20%) of the grid points with the largest hierarchical linear surplusses are refined.

Constructor & Destructor Documentation

sgpp::optimization::IterativeGridGeneratorLinearSurplus::IterativeGridGeneratorLinearSurplus ( ScalarFunction f,
base::Grid grid,
size_t  N,
double  adaptivity = DEFAULT_ADAPTIVITY,
base::level_t  initialLevel = DEFAULT_INITIAL_LEVEL 
)
sgpp::optimization::IterativeGridGeneratorLinearSurplus::~IterativeGridGeneratorLinearSurplus ( )
override

Destructor.

Member Function Documentation

double sgpp::optimization::IterativeGridGeneratorLinearSurplus::getAdaptivity ( ) const
Returns
adaptivity between 0 and 1

References gamma.

base::level_t sgpp::optimization::IterativeGridGeneratorLinearSurplus::getInitialLevel ( ) const
Returns
level of initial regular sparse grid

References initialLevel.

void sgpp::optimization::IterativeGridGeneratorLinearSurplus::setAdaptivity ( double  adaptivity)
Parameters
adaptivityadaptivity between 0 and 1

References gamma.

void sgpp::optimization::IterativeGridGeneratorLinearSurplus::setInitialLevel ( base::level_t  initialLevel)
Parameters
initialLevellevel of initial regular sparse grid

References initialLevel.

Member Data Documentation

constexpr double sgpp::optimization::IterativeGridGeneratorLinearSurplus::DEFAULT_ADAPTIVITY = 0.2
static

default adaptivity

const base::level_t sgpp::optimization::IterativeGridGeneratorLinearSurplus::DEFAULT_INITIAL_LEVEL = 3
static

default level of initial regular sparse grid

double sgpp::optimization::IterativeGridGeneratorLinearSurplus::gamma
protected

adaptivity

Referenced by generate(), getAdaptivity(), and setAdaptivity().

base::level_t sgpp::optimization::IterativeGridGeneratorLinearSurplus::initialLevel
protected

level of initial regular sparse grid

Referenced by generate(), getInitialLevel(), and setInitialLevel().

std::unique_ptr<base::Grid> sgpp::optimization::IterativeGridGeneratorLinearSurplus::linearGrid
protected

pointer to a linear grid (of the same type as the "real" grid)

Referenced by generate(), and IterativeGridGeneratorLinearSurplus().


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