SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::combigrid::LevelVectorTools Class Reference

Various tools for LevelVectors, mainly for generating specific vectors of LevelVectors. More...

#include <LevelVectorTools.hpp>

Classes

class  Hash
 

Public Member Functions

 LevelVectorTools ()=delete
 

Static Public Member Functions

static bool compareLower (const LevelVector &a, const LevelVector &b)
 
static std::vector< LevelVectorgenerateDiagonal (const LevelVector &minLevel, level_t levelSum)
 Enumerate all levels \(\vec{\ell} \in \mathbb{N}_{\ge 0}^{dim}\) with \(\sum_{d=1}^{dim} \ell_d = \mathrm{levelSum}\) and \(\ell_d \ge \textrm{minLevel}_d\) for all \(d\).
 
static std::vector< LevelVectorgenerateDiagonalWithBoundary (size_t dim, level_t levelSum)
 Enumerate all levels \(\vec{\ell} \in \mathbb{N}_{\ge 0}^{dim}\) with \(\sum_{d=1}^{dim} \ell_d = n\).
 
static std::vector< LevelVectorgenerateDiagonalWithoutBoundary (size_t dim, level_t levelSum)
 Enumerate all levels \(\vec{\ell} \in \mathbb{N}_{\ge 1}^{dim}\) with \(\sum_{d=1}^{dim} \ell_d = n\).
 
static std::vector< LevelVectorgenerateHyperCube (const LevelVector &minLevel, const LevelVector &maxLevel)
 Enumerate all levels in the hypercube between and including minLevel and maxLevel.
 
static std::vector< LevelVectorgenerateHyperCubeWithBoundary (const LevelVector &maxLevel)
 Enumerate all levels in the hypercube between and including \((0, \dotsc, 0)\) and maxLevel.
 
static std::vector< LevelVectorgenerateHyperCubeWithoutBoundary (const LevelVector &maxLevel)
 Enumerate all levels in the hypercube between and including \((1, \dotsc, 1)\) and maxLevel.
 
static std::vector< LevelVectormakeDownwardClosed (LevelVector minLevel, const std::vector< LevelVector > &subspaceLevels)
 Make any level set a downward closed one.
 
static void sort (std::vector< LevelVector > &levels)
 

Static Protected Member Functions

static void generateDiagonalRecursive (const LevelVector &minLevel, level_t minLevelSum, level_t levelSum, LevelVector &curLevel, size_t curDim, std::vector< LevelVector > &result)
 Enumerate all levels \(\vec{\ell} \in \mathbb{N}_{\ge 0}^{dim}\) with \(\sum_{d=1}^{dim} \ell_d = \mathrm{levelSum}\) and \(\ell_d \ge \textrm{minLevel}_d\) for all \(d\) (internal recursive function).
 
static void generateHyperCubeRecursive (const LevelVector &minLevel, const LevelVector &maxLevel, LevelVector &curLevel, size_t curDim, std::vector< LevelVector > &result)
 Enumerate all levels in the hypercube between and including minLevel and maxLevel (internal recursive function).
 

Detailed Description

Various tools for LevelVectors, mainly for generating specific vectors of LevelVectors.

Constructor & Destructor Documentation

◆ LevelVectorTools()

sgpp::combigrid::LevelVectorTools::LevelVectorTools ( )
delete

Member Function Documentation

◆ compareLower()

static bool sgpp::combigrid::LevelVectorTools::compareLower ( const LevelVector a,
const LevelVector b 
)
inlinestatic

Referenced by sort().

◆ generateDiagonal()

std::vector< LevelVector > sgpp::combigrid::LevelVectorTools::generateDiagonal ( const LevelVector minLevel,
level_t  levelSum 
)
static

Enumerate all levels \(\vec{\ell} \in \mathbb{N}_{\ge 0}^{dim}\) with \(\sum_{d=1}^{dim} \ell_d = \mathrm{levelSum}\) and \(\ell_d \ge \textrm{minLevel}_d\) for all \(d\).

Parameters
minLevelthe minimum level vector
levelSumlevel sum
Returns
a colexicographically ordered vector of levels of desired level sum

References generateDiagonalRecursive().

Referenced by generateDiagonalWithBoundary(), and generateDiagonalWithoutBoundary().

◆ generateDiagonalRecursive()

void sgpp::combigrid::LevelVectorTools::generateDiagonalRecursive ( const LevelVector minLevel,
level_t  minLevelSum,
level_t  levelSum,
LevelVector curLevel,
size_t  curDim,
std::vector< LevelVector > &  result 
)
staticprotected

Enumerate all levels \(\vec{\ell} \in \mathbb{N}_{\ge 0}^{dim}\) with \(\sum_{d=1}^{dim} \ell_d = \mathrm{levelSum}\) and \(\ell_d \ge \textrm{minLevel}_d\) for all \(d\) (internal recursive function).

Parameters
[in]minLevelthe minimum level vector
[in]minLevelSumlevel sum of minLevel
[in]levelSumlevel sum
[in]curLevelthe current level vector, curLevel[d] won't be modified anymore for \(d >= \mathrm{curDim}\)
[in]curDimthe dimension of the remaining diagonal
[out]resulta colexicographically ordered vector of levels of desired level sum

References generateDiagonalRecursive().

Referenced by generateDiagonal(), and generateDiagonalRecursive().

◆ generateDiagonalWithBoundary()

std::vector< LevelVector > sgpp::combigrid::LevelVectorTools::generateDiagonalWithBoundary ( size_t  dim,
level_t  levelSum 
)
static

Enumerate all levels \(\vec{\ell} \in \mathbb{N}_{\ge 0}^{dim}\) with \(\sum_{d=1}^{dim} \ell_d = n\).

Parameters
dimdimensionality
levelSumlevel sum
Returns
a colexicographically ordered vector of levels of desired level sum (with boundary)

References generateDiagonal().

Referenced by sgpp::combigrid::CombinationGrid::fromRegularSparseTruncated().

◆ generateDiagonalWithoutBoundary()

std::vector< LevelVector > sgpp::combigrid::LevelVectorTools::generateDiagonalWithoutBoundary ( size_t  dim,
level_t  levelSum 
)
static

Enumerate all levels \(\vec{\ell} \in \mathbb{N}_{\ge 1}^{dim}\) with \(\sum_{d=1}^{dim} \ell_d = n\).

Parameters
dimdimensionality
levelSumlevel sum
Returns
a colexicographically ordered vector of levels of desired level sum (without boundary)

References generateDiagonal().

Referenced by sgpp::combigrid::CombinationGrid::fromRegularSparseTruncated().

◆ generateHyperCube()

std::vector< LevelVector > sgpp::combigrid::LevelVectorTools::generateHyperCube ( const LevelVector minLevel,
const LevelVector maxLevel 
)
static

Enumerate all levels in the hypercube between and including minLevel and maxLevel.

Parameters
minLevelthe minimum level vector
maxLevelthe maximum level vector
Returns
a colexicographically ordered vector of level vectors in the hypercube

References generateHyperCubeRecursive().

Referenced by generateHyperCubeWithBoundary(), generateHyperCubeWithoutBoundary(), sgpp::combigrid::AdaptiveCombinationGridGenerator::getDelta(), and makeDownwardClosed().

◆ generateHyperCubeRecursive()

void sgpp::combigrid::LevelVectorTools::generateHyperCubeRecursive ( const LevelVector minLevel,
const LevelVector maxLevel,
LevelVector curLevel,
size_t  curDim,
std::vector< LevelVector > &  result 
)
staticprotected

Enumerate all levels in the hypercube between and including minLevel and maxLevel (internal recursive function).

Parameters
[in]minLevelthe minimum level vector
[in]maxLevelthe maximum level vector
[in]curLevelthe current level vector, curLevel[d] won't be modified anymore for \(d >= \mathrm{curDim}\)
[in]curDimthe dimension of the remaining hypercube
[out]resulta colexicographically ordered vector of level vectors in the hypercube

References generateHyperCubeRecursive().

Referenced by generateHyperCube(), and generateHyperCubeRecursive().

◆ generateHyperCubeWithBoundary()

std::vector< LevelVector > sgpp::combigrid::LevelVectorTools::generateHyperCubeWithBoundary ( const LevelVector maxLevel)
static

Enumerate all levels in the hypercube between and including \((0, \dotsc, 0)\) and maxLevel.

Parameters
maxLevelthe maximum level vector
Returns
a colexicographically ordered vector of level vectors in the hypercube

References generateHyperCube().

◆ generateHyperCubeWithoutBoundary()

std::vector< LevelVector > sgpp::combigrid::LevelVectorTools::generateHyperCubeWithoutBoundary ( const LevelVector maxLevel)
static

Enumerate all levels in the hypercube between and including \((1, \dotsc, 1)\) and maxLevel.

Parameters
maxLevelthe maximum level vector
Returns
a colexicographically ordered vector of level vectors in the hypercube

References generateHyperCube().

◆ makeDownwardClosed()

std::vector< LevelVector > sgpp::combigrid::LevelVectorTools::makeDownwardClosed ( LevelVector  minLevel,
const std::vector< LevelVector > &  subspaceLevels 
)
static

Make any level set a downward closed one.

Parameters
minLevelthe minimum level vector, a vector of zeros or ones would be a standard choice
subspaceLevelsan arbitrary level set
Returns
the updated, downward closed level set containing subspaceLevels

References generateHyperCube(), level, and sort().

Referenced by sgpp::combigrid::AdaptiveCombinationGridGenerator::AdaptiveCombinationGridGenerator().

◆ sort()

void sgpp::combigrid::LevelVectorTools::sort ( std::vector< LevelVector > &  levels)
static

References compareLower().

Referenced by makeDownwardClosed().


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