SG++-Doxygen-Documentation
sgpp::base::StandardGridGenerator Class Reference

GridGenerator for standard grids without boundaries. More...

#include <StandardGridGenerator.hpp>

Inheritance diagram for sgpp::base::StandardGridGenerator:
sgpp::base::GridGenerator

Public Member Functions

void cliques (size_t level, size_t clique_size) override
 Creates a sparse grid with fully connected cliques. More...
 
void cliques (size_t level, size_t clique_size, double T) override
 Creates a sparse grid with fully connected cliques. More...
 
void coarsen (CoarseningFunctor &func, DataVector &alpha) override
 Coarsens a grid according to the settings of the CoarseningFunctor func. More...
 
void coarsenNFirstOnly (CoarseningFunctor &func, DataVector &alpha, size_t numFirstOnly) override
 Coarsens a grid according to the settings of the CoarseningFunctor func. More...
 
void full (size_t level) override
 Creates a full grid for a certain level \( n \), i.e., \( V_n = \bigoplus_{|\vec{l}|_\infty *\leq n} W_{\vec{l}}\). More...
 
size_t getNumberOfRefinablePoints () override
 Returns the number of points on the grid that can be refined in the next iteration. More...
 
size_t getNumberOfRefinablePointsToMaxLevel (size_t maxLevel) override
 Returns the number of points on the grid that can be refined in the next iteration additionally a maximum level for refinement is taken into account. More...
 
size_t getNumberOfRemovablePoints () override
 Returns the number of points on the grid that can be removed in the next iteration. More...
 
void refine (RefinementFunctor &func, std::vector< size_t > *addedPoints=0) override
 Refines a grid according to the settings of the RefinementFunctor func. More...
 
void refineInter (RefinementFunctor &func, const std::unordered_set< std::vector< bool >> &interactions)
 
void refineInter (RefinementFunctor &func, const std::vector< std::vector< size_t >> &interactions) override
 Refines a grid according to the settings of the RefinementFunctor func. More...
 
void refineMaxLevel (RefinementFunctor &func, size_t maxLevel) override
 Refines a grid according to the settings of the RefinementFunctor func. More...
 
void regular (size_t level) override
 Creates a regular sparse grid for a certain level \( n \), i.e., \( V_n^{(1)} = *\bigoplus_{|\vec{l}|_1 \leq n+d-1} W_{\vec{l}}\). More...
 
void regular (size_t level, double T) override
 Creates a regular sparse grid for a certain level \( n \), i.e., \( V_n^{(1)} = *\bigoplus_{|\vec{l}|_1 \leq n+d-1} W_{\vec{l}}\). More...
 
void regularInter (size_t level, const std::vector< std::vector< size_t >> &terms, double T) override
 Creates a regular sparse grid for a certain level \( n \), i.e., \( V_n^{(1)} = *\bigoplus_{|\vec{l}|_1 \leq n+d-1} W_{\vec{l}}\). More...
 
 StandardGridGenerator (GridStorage &storage)
 Constructor. More...
 
 ~StandardGridGenerator () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::base::GridGenerator
 GridGenerator ()
 Constructor. More...
 
virtual void truncated (size_t level, size_t l_user)
 Creates a grid which doesn't contain the fullgrids with li<l_user, for any li level_t. More...
 
virtual ~GridGenerator ()
 Destructor. More...
 

Protected Attributes

GridStoragestorage
 reference to the storage object More...
 

Detailed Description

GridGenerator for standard grids without boundaries.

Constructor & Destructor Documentation

sgpp::base::StandardGridGenerator::StandardGridGenerator ( GridStorage storage)
explicit

Constructor.

Parameters
storagethe grid's storage object
sgpp::base::StandardGridGenerator::~StandardGridGenerator ( )
override

Destructor.

Member Function Documentation

void sgpp::base::StandardGridGenerator::cliques ( size_t  level,
size_t  clique_size 
)
overridevirtual

Creates a sparse grid with fully connected cliques.

Parameters
levelGrid level
clique_sizeclique size

Implements sgpp::base::GridGenerator.

References sgpp::base::HashGenerator::cliques(), and storage.

void sgpp::base::StandardGridGenerator::cliques ( size_t  level,
size_t  clique_size,
double  T 
)
overridevirtual

Creates a sparse grid with fully connected cliques.

Parameters
levelGrid level
clique_sizeclique size
Tmodifier for subgrid selection, T = 0 implies standard sparse grid. For further information see Griebel and Knapek's paper optimized tensor-product approximation spaces

Reimplemented from sgpp::base::GridGenerator.

References sgpp::base::HashGenerator::cliques(), and storage.

void sgpp::base::StandardGridGenerator::coarsen ( CoarseningFunctor func,
DataVector alpha 
)
overridevirtual

Coarsens a grid according to the settings of the CoarseningFunctor func.

Parameters
funcpointer to coarsening functor
alphaPointer to DataVector containing the grid's coefficients

Implements sgpp::base::GridGenerator.

References sgpp::base::HashCoarsening::free_coarsen(), and storage.

Referenced by coarsenNFirstOnly(), and getNumberOfRemovablePoints().

void sgpp::base::StandardGridGenerator::coarsenNFirstOnly ( CoarseningFunctor func,
DataVector alpha,
size_t  numFirstOnly 
)
overridevirtual

Coarsens a grid according to the settings of the CoarseningFunctor func.

Only numFirstOnly first grid points are checked for coarsening.

Parameters
funcpointer to coarsening functor
alphaPointer to DataVector containing the grid's coefficients
numFirstOnlymax. number grid points to be coarsened

Implements sgpp::base::GridGenerator.

References coarsen(), sgpp::base::HashCoarsening::free_coarsen_NFirstOnly(), and storage.

void sgpp::base::StandardGridGenerator::full ( size_t  level)
overridevirtual

Creates a full grid for a certain level \( n \), i.e., \( V_n = \bigoplus_{|\vec{l}|_\infty *\leq n} W_{\vec{l}}\).

Parameters
levelGrid level

Implements sgpp::base::GridGenerator.

References sgpp::base::HashGenerator::full(), and storage.

size_t sgpp::base::StandardGridGenerator::getNumberOfRefinablePoints ( )
overridevirtual

Returns the number of points on the grid that can be refined in the next iteration.

Returns
the number of points on the grid that can be refined

Implements sgpp::base::GridGenerator.

References sgpp::base::HashRefinement::getNumberOfRefinablePoints(), refine(), and storage.

size_t sgpp::base::StandardGridGenerator::getNumberOfRefinablePointsToMaxLevel ( size_t  maxLevel)
overridevirtual

Returns the number of points on the grid that can be refined in the next iteration additionally a maximum level for refinement is taken into account.

Parameters
maxLevelno points on higher levels than maxLevel will be created
Returns
the number of points on the grid that can be refined

Implements sgpp::base::GridGenerator.

size_t sgpp::base::StandardGridGenerator::getNumberOfRemovablePoints ( )
overridevirtual

Returns the number of points on the grid that can be removed in the next iteration.

Returns
the number of points on the grid that can be removed

Implements sgpp::base::GridGenerator.

References coarsen(), sgpp::base::HashCoarsening::getNumberOfRemovablePoints(), and storage.

void sgpp::base::StandardGridGenerator::refine ( RefinementFunctor func,
std::vector< size_t > *  addedPoints = 0 
)
overridevirtual

Refines a grid according to the settings of the RefinementFunctor func.

Parameters
funcreference to refinement functor
addedPointspointer to vector to add newly created grid points to

Implements sgpp::base::GridGenerator.

References sgpp::base::HashRefinement::free_refine(), and storage.

Referenced by getNumberOfRefinablePoints(), and refineInter().

void sgpp::base::StandardGridGenerator::refineInter ( RefinementFunctor func,
const std::unordered_set< std::vector< bool >> &  interactions 
)

References refine(), and storage.

Referenced by refineInter().

void sgpp::base::StandardGridGenerator::refineInter ( RefinementFunctor func,
const std::vector< std::vector< size_t >> &  interactions 
)
overridevirtual

Refines a grid according to the settings of the RefinementFunctor func.

Does not create any interactions, that are not in the list of allowed interactions.

Refines the grid, but only adds interactions that are contained in the set interactions, i.e. only desired interactions. Each desired interaction is encoded as a vector which contains all desired interactions. For example, if we want to include grid points that model an interaction between the first and the second predictor, we would include the vector [1,2] in interactions.

Parameters
funcpointer to refinement functor
interactionsallowed interactions

Reimplemented from sgpp::base::GridGenerator.

References chess::dim, sgpp::base::HashGridStorage::getDimension(), python.statsfileInfo::i, refineInter(), and storage.

void sgpp::base::StandardGridGenerator::refineMaxLevel ( RefinementFunctor func,
size_t  maxLevel 
)
overridevirtual

Refines a grid according to the settings of the RefinementFunctor func.

additionally a maximum level for refinement is taken into account

Parameters
funcpointer to refinement functor
maxLevelno points on higher levels than maxLevel will be created

Implements sgpp::base::GridGenerator.

void sgpp::base::StandardGridGenerator::regular ( size_t  level)
overridevirtual

Creates a regular sparse grid for a certain level \( n \), i.e., \( V_n^{(1)} = *\bigoplus_{|\vec{l}|_1 \leq n+d-1} W_{\vec{l}}\).

Parameters
levelGrid level

Implements sgpp::base::GridGenerator.

References sgpp::base::HashGenerator::regular(), and storage.

void sgpp::base::StandardGridGenerator::regular ( size_t  level,
double  T 
)
overridevirtual

Creates a regular sparse grid for a certain level \( n \), i.e., \( V_n^{(1)} = *\bigoplus_{|\vec{l}|_1 \leq n+d-1} W_{\vec{l}}\).

If the used grid doesn't support the parameter t, t = 0 is used instead.

Parameters
levelGrid level
Tmodifier for subgrid selection, T = 0 implies standard sparse grid. For further information see Griebel and Knapek's paper optimized tensor-product approximation spaces

Reimplemented from sgpp::base::GridGenerator.

References sgpp::base::HashGenerator::regular(), and storage.

void sgpp::base::StandardGridGenerator::regularInter ( size_t  level,
const std::vector< std::vector< size_t >> &  terms,
double  T 
)
overridevirtual

Creates a regular sparse grid for a certain level \( n \), i.e., \( V_n^{(1)} = *\bigoplus_{|\vec{l}|_1 \leq n+d-1} W_{\vec{l}}\).

If the used grid doesn't support the parameter t, t = 0 is used instead. This grid generator allows the creation of regular grids that only contain some interaction terms.

Parameters
levelGrid level
Tmodifier for subgrid selection, T = 0 implies standard sparse grid. For further information see Griebel and Knapek's paper optimized tensor-product approximation spaces
termsdetermines the included interaction terms.

Reimplemented from sgpp::base::GridGenerator.

References sgpp::base::HashGenerator::regularInter(), and storage.

Member Data Documentation

GridStorage& sgpp::base::StandardGridGenerator::storage
protected

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