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

Iterator class that travels "along" a MultiIndexIterator through a TreeStorage. More...

#include <TreeStorageGuidedIterator.hpp>

Inheritance diagram for sgpp::combigrid::TreeStorageGuidedIterator< T >:
sgpp::combigrid::AbstractMultiStorageIterator< T >

Public Member Functions

virtual bool computationRequested ()
 
virtual MultiIndex getMultiIndex () const
 
virtual size_t indexAt (size_t d) const
 
virtual bool isValid ()
 
virtual int moveToNext ()
 
virtual std::function< T()> requestComputationTask ()
 
virtual void setValue (T const &input)
 Sets a value at the current entry. More...
 
 TreeStorageGuidedIterator (IterationPolicy const &policy, AbstractTreeStorageNode< T > *root, size_t numDimensions, MultiIndexIterator &iterator)
 The number of dimensions is also contained in the iterator, but it is passed separately, so the casts below can't fail because of an iterator with a wrong number of dimensions. More...
 
virtual T & value ()
 
virtual ~TreeStorageGuidedIterator ()
 
- Public Member Functions inherited from sgpp::combigrid::AbstractMultiStorageIterator< T >
virtual ~AbstractMultiStorageIterator ()
 

Detailed Description

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

Iterator class that travels "along" a MultiIndexIterator through a TreeStorage.

If entries are not already contained, they are created during iteration. For a detailed method description, see AbstractMultiStorageIterator.

Constructor & Destructor Documentation

◆ TreeStorageGuidedIterator()

template<typename T >
sgpp::combigrid::TreeStorageGuidedIterator< T >::TreeStorageGuidedIterator ( IterationPolicy const &  policy,
AbstractTreeStorageNode< T > *  root,
size_t  numDimensions,
MultiIndexIterator iterator 
)
inline

The number of dimensions is also contained in the iterator, but it is passed separately, so the casts below can't fail because of an iterator with a wrong number of dimensions.

References CGLOG, and sgpp::combigrid::IterationPolicy::value().

◆ ~TreeStorageGuidedIterator()

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

Member Function Documentation

◆ computationRequested()

template<typename T >
virtual bool sgpp::combigrid::TreeStorageGuidedIterator< T >::computationRequested ( )
inlinevirtual
Returns
True iff the value the iterator points to has already been computed or the computation has been requested (in case of parallel evaluation, using requestComputationTask()).

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

References sgpp::combigrid::MultiIndexIterator::indexAt(), sgpp::combigrid::REQUESTED, sgpp::combigrid::LowestTreeStorageNode< T >::statusVector, and sgpp::combigrid::IterationPolicy::value().

◆ getMultiIndex()

template<typename T >
virtual MultiIndex sgpp::combigrid::TreeStorageGuidedIterator< T >::getMultiIndex ( ) const
inlinevirtual
Returns
Returns the MultiIndex containing the components that can be retrieved using indexAt().

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

References sgpp::combigrid::MultiIndexIterator::getMultiIndex().

◆ indexAt()

template<typename T >
virtual size_t sgpp::combigrid::TreeStorageGuidedIterator< T >::indexAt ( size_t  d) const
inlinevirtual
Returns
Returns the index in the given dimension that the iterator points to. If this iterator was configured with a certain policy to permute the indices it accesses, this does not affect the index returned. For example, in the beginning, indexAt(0) will always return 0, even if the index is 5 after the permutation.

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

References sgpp::combigrid::MultiIndexIterator::indexAt().

◆ isValid()

template<typename T >
virtual bool sgpp::combigrid::TreeStorageGuidedIterator< T >::isValid ( )
inlinevirtual
Returns
returns true if the iterator points to a valid position.

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

References sgpp::combigrid::MultiIndexIterator::isValid().

◆ moveToNext()

template<typename T >
virtual int sgpp::combigrid::TreeStorageGuidedIterator< T >::moveToNext ( )
inlinevirtual
Returns
Returns the difference of the greatest dimension and the lowest updated dimension, i. e. the lowest dimension where the corresponding multi-index changed. This will be mostly be zero, if the last dimension has many points. Returns -1 if the next entry is invalid.

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

References chess::dim, h, sgpp::combigrid::MultiIndexIterator::indexAt(), sgpp::combigrid::IterationPolicy::moveAndGetValue(), sgpp::combigrid::MultiIndexIterator::moveToNext(), sgpp::combigrid::IterationPolicy::moveToNext(), sgpp::combigrid::IterationPolicy::reset(), and sgpp::combigrid::IterationPolicy::resetAndGetValue().

◆ requestComputationTask()

template<typename T >
virtual std::function<T()> sgpp::combigrid::TreeStorageGuidedIterator< T >::requestComputationTask ( )
inlinevirtual

◆ setValue()

template<typename T >
virtual void sgpp::combigrid::TreeStorageGuidedIterator< T >::setValue ( T const &  input)
inlinevirtual

◆ value()

template<typename T >
virtual T& sgpp::combigrid::TreeStorageGuidedIterator< T >::value ( )
inlinevirtual

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