SG++-Doxygen-Documentation
sgpp::combigrid::AbstractPointOrdering Class Referenceabstract

An AbstractPointOrdering may (via convertIndex()) define a reordering of the points so that the same points in different levels have the same indices. More...

#include <AbstractPointOrdering.hpp>

Inheritance diagram for sgpp::combigrid::AbstractPointOrdering:
sgpp::combigrid::ExponentialChebyshevPointOrdering sgpp::combigrid::ExponentialLevelorderPointOrdering sgpp::combigrid::ExponentialNoBoundaryPointOrdering sgpp::combigrid::IdentityPointOrdering

Public Member Functions

virtual size_t convertIndex (size_t level, size_t numPoints, size_t index)=0
 Converts a level-independent index into a corresponding level-dependent index in for the PointDistribution. More...
 
virtual std::shared_ptr< AbstractPermutationIteratorgetSortedPermutationIterator (size_t level, std::vector< double > const &points, size_t numPoints)=0
 Returns a permutation iterator which first returns the level-independent index of the leftmost point, then the level-independent index of the second-leftmost point, etc. More...
 
virtual size_t numPoints (size_t level)=0
 Returns the number of points in the given level. More...
 
virtual ~AbstractPointOrdering ()
 

Detailed Description

An AbstractPointOrdering may (via convertIndex()) define a reordering of the points so that the same points in different levels have the same indices.

Furthermore, it provides a SortedPermutationIterator to traverse the points in ascending order.

Since the necessity of reordering depends on whether the points are nested and the nesting in turn may depend on the growth strategy, an AbstractPointOrdering also includes a method to compute the number of points for a level. This might be implemented using an AbstractGrowthStrategy-Object, but can also be fixed because the ordering depends on the growth strategy.

As an example, consider the UniformPointDistribution combined with an ExponentialLevelorderPointOrdering. In Level 0 there is one point: 0.5 In Level 1 there are three points: 0.0, 0.5, 1.0 In order to exploit nesting, 0.5 needs to have the same index in all levels. Thus, in level 1, the index mapping is 0 -> 1, 1 -> 0, 2 -> 2. In Level 2 with 5 points, it would be 0 -> 2, 1 -> 0, 2 -> 4, 3 -> 1, 4 -> 3 Since the original points were sorted but the remapped ones are not, the SortedPermutationIterator has to implement the inverse mapping.

Constructor & Destructor Documentation

◆ ~AbstractPointOrdering()

sgpp::combigrid::AbstractPointOrdering::~AbstractPointOrdering ( )
virtual

Member Function Documentation

◆ convertIndex()

virtual size_t sgpp::combigrid::AbstractPointOrdering::convertIndex ( size_t  level,
size_t  numPoints,
size_t  index 
)
pure virtual

Converts a level-independent index into a corresponding level-dependent index in for the PointDistribution.

Parameters
levelThe level where the index is considered
numPointsThe number of points at the level
indexThe index of the concrete point in the level

Implemented in sgpp::combigrid::IdentityPointOrdering, sgpp::combigrid::ExponentialChebyshevPointOrdering, sgpp::combigrid::ExponentialLevelorderPointOrdering, and sgpp::combigrid::ExponentialNoBoundaryPointOrdering.

◆ getSortedPermutationIterator()

virtual std::shared_ptr<AbstractPermutationIterator> sgpp::combigrid::AbstractPointOrdering::getSortedPermutationIterator ( size_t  level,
std::vector< double > const &  points,
size_t  numPoints 
)
pure virtual

Returns a permutation iterator which first returns the level-independent index of the leftmost point, then the level-independent index of the second-leftmost point, etc.

Implemented in sgpp::combigrid::IdentityPointOrdering, sgpp::combigrid::ExponentialChebyshevPointOrdering, sgpp::combigrid::ExponentialLevelorderPointOrdering, and sgpp::combigrid::ExponentialNoBoundaryPointOrdering.

◆ numPoints()

virtual size_t sgpp::combigrid::AbstractPointOrdering::numPoints ( size_t  level)
pure virtual

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