SG++-Doxygen-Documentation
sgpp::combigrid::InternalTreeStorageNode< T > Class Template Reference

Each inner node of the storage contains a vector of other nodes. More...

#include <InternalTreeStorageNode.hpp>

Inheritance diagram for sgpp::combigrid::InternalTreeStorageNode< T >:
sgpp::combigrid::AbstractTreeStorageNode< T >

Public Member Functions

virtual bool containsIndex (MultiIndex const &index, size_t depth=0) const
 
virtual T & get (MultiIndex const &index, size_t depth=0)
 
 InternalTreeStorageNode (TreeStorageContext< T > &context, size_t remainingDimensions)
 
virtual bool isLeaf () const
 
virtual size_t numChildren () const
 
virtual void set (MultiIndex const &index, T const &value, size_t depth=0)
 
virtual ~InternalTreeStorageNode ()
 
- Public Member Functions inherited from sgpp::combigrid::AbstractTreeStorageNode< T >
virtual ~AbstractTreeStorageNode ()
 

Public Attributes

std::vector< std::unique_ptr< AbstractTreeStorageNode< T > > > children
 
TreeStorageContext< T > & context
 

Detailed Description

template<typename T>
class sgpp::combigrid::InternalTreeStorageNode< T >

Each inner node of the storage contains a vector of other nodes.

For a d-dimensional multi-index, to find a storage entry, the components of the multi-index are iterated over. Each component defines the index of the next child to be traversed. Because traversal would be slower if each leaf only contained one number, the nodes for the last dimension contain a vector of numbers (or Ts) instead of having children which themselves have one number. These nodes are represented by LowestTreeStorageNode objects, all other nodes are InternalTreeStorageNode objects. Each InternalTreeStorageNode contains at least one child, even if the final LowestTreeStorageNode contains no value. This is guaranteed by the constructor.

Constructor & Destructor Documentation

◆ InternalTreeStorageNode()

template<typename T>
sgpp::combigrid::InternalTreeStorageNode< T >::InternalTreeStorageNode ( TreeStorageContext< T > &  context,
size_t  remainingDimensions 
)
inline
Parameters
contextTreeStorageContext<T>-object containing information about the storage.
remainingDimensionsNumber of dimensions that come after this node (at least 1, since this is an internal node).

◆ ~InternalTreeStorageNode()

template<typename T>
virtual sgpp::combigrid::InternalTreeStorageNode< T >::~InternalTreeStorageNode ( )
inlinevirtual

Member Function Documentation

◆ containsIndex()

template<typename T>
virtual bool sgpp::combigrid::InternalTreeStorageNode< T >::containsIndex ( MultiIndex const &  index,
size_t  depth = 0 
) const
inlinevirtual
Parameters
indexMulti-index indicating the storage position.
depthLevel of the node in the tree, starting from zero.
Returns
true iff the storage contains data at the given index.

Implements sgpp::combigrid::AbstractTreeStorageNode< T >.

◆ get()

template<typename T>
virtual T& sgpp::combigrid::InternalTreeStorageNode< T >::get ( MultiIndex const &  index,
size_t  depth = 0 
)
inlinevirtual
Parameters
indexIndex of the value to get.
depthDepth of the node, starting from zero.

Implements sgpp::combigrid::AbstractTreeStorageNode< T >.

References sgpp::combigrid::TreeStorageContext< T >::numDimensions.

◆ isLeaf()

template<typename T>
virtual bool sgpp::combigrid::InternalTreeStorageNode< T >::isLeaf ( ) const
inlinevirtual
Returns
Returns true iff the node is a leaf

Implements sgpp::combigrid::AbstractTreeStorageNode< T >.

◆ numChildren()

template<typename T>
virtual size_t sgpp::combigrid::InternalTreeStorageNode< T >::numChildren ( ) const
inlinevirtual
Returns
Returns the number of children of this node.

Implements sgpp::combigrid::AbstractTreeStorageNode< T >.

◆ set()

template<typename T>
virtual void sgpp::combigrid::InternalTreeStorageNode< T >::set ( MultiIndex const &  index,
T const &  value,
size_t  depth = 0 
)
inlinevirtual
Parameters
indexIndex of the value to set.
valueValue to set.
depthDepth of the node, starting from zero.

Implements sgpp::combigrid::AbstractTreeStorageNode< T >.

References sgpp::combigrid::TreeStorageContext< T >::numDimensions.

Member Data Documentation

◆ children

◆ context

template<typename T>
TreeStorageContext<T>& sgpp::combigrid::InternalTreeStorageNode< T >::context

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