Doxygen 1.9.1
Toolkit for Adaptive Stochastic Modeling and Non-Intrusive ApproximatioN: Tasmanian v8.2 (development)
Hierarchical multi-Index manipulation algorithms
Collaboration diagram for Hierarchical multi-Index manipulation algorithms:

Files

file  tsgHierarchyManipulator.hpp
 Algorithms for manipulating multi-indexes defined by hierarchy rules.
 

Classes

class  TasGrid::HierarchyManipulations::SplitDirections
 Reorganize the points into sets of nodes that align in one-dimension, used for directional localp refinement. More...
 

Functions

template<RuleLocal::erule effrule>
Data2D< int > TasGrid::HierarchyManipulations::computeDAGup (MultiIndexSet const &mset)
 Cache the indexes slot numbers of the parents of the multi-indexes in mset. More...
 
Data2D< int > TasGrid::HierarchyManipulations::computeDAGup (MultiIndexSet const &mset, RuleLocal::erule effrule)
 Cache the indexes slot numbers of the parents of the multi-indexes in mset. More...
 
template<RuleLocal::erule effrule>
Data2D< int > TasGrid::HierarchyManipulations::computeDAGup (MultiIndexSet const &mset, bool &is_complete)
 Variant that also check if all points have all parents. More...
 
template<RuleLocal::erule effrule>
Data2D< int > TasGrid::HierarchyManipulations::computeDAGDown (MultiIndexSet const &mset)
 Cache the indexes slot numbers of the children of the multi-indexes in mset. More...
 
template<RuleLocal::erule effrule>
std::vector< int > TasGrid::HierarchyManipulations::computeLevels (MultiIndexSet const &mset)
 Returns a vector that is the sum of the one dimensional levels of each multi-index in the set.. More...
 
std::vector< int > TasGrid::HierarchyManipulations::computeLevels (MultiIndexSet const &mset, RuleLocal::erule effrule)
 Overload that turns switch statement into template instantiations. More...
 
template<RuleLocal::erule effrule>
void TasGrid::HierarchyManipulations::completeToLower (MultiIndexSet const &mset, MultiIndexSet &refined)
 Complete refined so that the union of refined and mset is lower w.r.t. the rule. . More...
 
template<RuleLocal::erule effrule, typename callable_method >
void TasGrid::HierarchyManipulations::touchAllImmediateRelatives (std::vector< int > &point, MultiIndexSet const &mset, callable_method apply)
 Will call apply() with the slot index in mset of each parent/child of point.. More...
 
template<RuleLocal::erule effrule>
MultiIndexSet TasGrid::HierarchyManipulations::getLevelZeroPoints (size_t num_dimensions)
 Return the tensor set of all points that sit on level zero (i.e., have no parents). More...
 
template<RuleLocal::erule effrule>
MultiIndexSet TasGrid::HierarchyManipulations::getLargestConnected (MultiIndexSet const &current, MultiIndexSet const &candidates)
 Return the largest subset of candidates such that adding it to current will result in a connected graph. More...
 
template<typename T >
std::vector< Data2D< T > > TasGrid::HierarchyManipulations::splitByLevels (size_t stride, typename std::vector< T >::const_iterator ibegin, typename std::vector< T >::const_iterator iend, std::vector< int >::const_iterator ilevels)
 Split the range between ibegin and iend into strips of stride and orders those by levels according to the level index in ilevels. More...
 
std::vector< Data2D< int > > TasGrid::HierarchyManipulations::splitByLevels (MultiIndexSet const &mset, std::vector< int > const &levels)
 Overload that operates on an entire multi-index set.
 
template<typename T >
std::vector< Data2D< T > > TasGrid::HierarchyManipulations::splitByLevels (Data2D< T > const &data, std::vector< int > const &levels)
 Overload that operates on an entire Data2D structure set.
 
std::vector< Data2D< double > > TasGrid::HierarchyManipulations::splitByLevels (StorageSet const &stortage, std::vector< int > const &levels)
 Overload that operates on an entire StorageSet structure set.
 

Detailed Description

One Dimensional Hierarchy
The construction of Global, Sequence and Fourier grids the multi-index hierarchy is associated with tensors and has very simple structure, in one dimension there is only one parent and one child indicated by the previous and next index. The Local-Polynomial and Wavelet girds use more complex hierarchies that have multiple children and (in some cases) parents. Many of the associated manipulation algorithms require a rule object that describes the hierarchy, and additional algorithms are needed to handle the more complex parent-child relations.

Function Documentation

◆ computeDAGup() [1/3]

template<RuleLocal::erule effrule>
Data2D<int> TasGrid::HierarchyManipulations::computeDAGup ( MultiIndexSet const &  mset)

Cache the indexes slot numbers of the parents of the multi-indexes in mset.

Each node defined by a multi-index in mset can have one or more parents in each direction, where the parent-offspring relation is defined by the rule. For each index in mset, the Data2D structure parents will hold a strip with the location of each parent in mset (or -1 if the parent is missing from mset).

◆ computeDAGup() [2/3]

Data2D<int> TasGrid::HierarchyManipulations::computeDAGup ( MultiIndexSet const &  mset,
RuleLocal::erule  effrule 
)

Cache the indexes slot numbers of the parents of the multi-indexes in mset.

The effective rule is passed in at runtime and a switch statement finds the correct template.

◆ computeDAGup() [3/3]

template<RuleLocal::erule effrule>
Data2D<int> TasGrid::HierarchyManipulations::computeDAGup ( MultiIndexSet const &  mset,
bool &  is_complete 
)

Variant that also check if all points have all parents.

This is merged together so it will do only one pass over the data.

On exit, is_complete will indicate whether there are points with missing parents.

◆ computeDAGDown()

template<RuleLocal::erule effrule>
Data2D<int> TasGrid::HierarchyManipulations::computeDAGDown ( MultiIndexSet const &  mset)

Cache the indexes slot numbers of the children of the multi-indexes in mset.

Each node defined by a multi-index in mset can have one or more children in each direction, where the parent-offspring relation is defined by the rule. For each index in mset, the returned Data2D structure will hold a strip with the location of each child in mset (or -1 if the kid is missing from mset).

◆ computeLevels() [1/2]

template<RuleLocal::erule effrule>
std::vector<int> TasGrid::HierarchyManipulations::computeLevels ( MultiIndexSet const &  mset)

Returns a vector that is the sum of the one dimensional levels of each multi-index in the set..

◆ computeLevels() [2/2]

std::vector<int> TasGrid::HierarchyManipulations::computeLevels ( MultiIndexSet const &  mset,
RuleLocal::erule  effrule 
)

Overload that turns switch statement into template instantiations.

◆ completeToLower()

template<RuleLocal::erule effrule>
void TasGrid::HierarchyManipulations::completeToLower ( MultiIndexSet const &  mset,
MultiIndexSet refined 
)

Complete refined so that the union of refined and mset is lower w.r.t. the rule. .

◆ touchAllImmediateRelatives()

template<RuleLocal::erule effrule, typename callable_method >
void TasGrid::HierarchyManipulations::touchAllImmediateRelatives ( std::vector< int > &  point,
MultiIndexSet const &  mset,
callable_method  apply 
)

Will call apply() with the slot index in mset of each parent/child of point..

◆ getLevelZeroPoints()

template<RuleLocal::erule effrule>
MultiIndexSet TasGrid::HierarchyManipulations::getLevelZeroPoints ( size_t  num_dimensions)

Return the tensor set of all points that sit on level zero (i.e., have no parents).

◆ getLargestConnected()

template<RuleLocal::erule effrule>
MultiIndexSet TasGrid::HierarchyManipulations::getLargestConnected ( MultiIndexSet const &  current,
MultiIndexSet const &  candidates 
)

Return the largest subset of candidates such that adding it to current will result in a connected graph.

◆ splitByLevels()

template<typename T >
std::vector<Data2D<T> > TasGrid::HierarchyManipulations::splitByLevels ( size_t  stride,
typename std::vector< T >::const_iterator  ibegin,
typename std::vector< T >::const_iterator  iend,
std::vector< int >::const_iterator  ilevels 
)

Split the range between ibegin and iend into strips of stride and orders those by levels according to the level index in ilevels.