SG++-Doxygen-Documentation
|
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>
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< AbstractPermutationIterator > | getSortedPermutationIterator (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 () |
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.
|
virtual |
|
pure virtual |
Converts a level-independent index into a corresponding level-dependent index in for the PointDistribution.
level | The level where the index is considered |
numPoints | The number of points at the level |
index | The index of the concrete point in the level |
Implemented in sgpp::combigrid::IdentityPointOrdering, sgpp::combigrid::ExponentialChebyshevPointOrdering, sgpp::combigrid::ExponentialLevelorderPointOrdering, and sgpp::combigrid::ExponentialNoBoundaryPointOrdering.
|
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.
|
pure virtual |
Returns the number of points in the given level.
Implemented in sgpp::combigrid::IdentityPointOrdering, sgpp::combigrid::ExponentialChebyshevPointOrdering, sgpp::combigrid::ExponentialLevelorderPointOrdering, and sgpp::combigrid::ExponentialNoBoundaryPointOrdering.