SG++-Doxygen-Documentation
sgpp::combigrid::IterationPolicy Class Reference

With the IterationPolicy class, an AbstractMultiStorage can be configured to traverse its entries in a different order than the identity order. More...

#include <IterationPolicy.hpp>

Public Member Functions

std::shared_ptr< AbstractPermutationIteratorgetIterator (size_t d) const
 
bool hasCustomIterator (size_t d) const
 
 IterationPolicy ()
 
size_t moveAndGetValue (size_t d, size_t defaultValue)
 Advances the iterator in dimension d, if available, to the next position and returns the permuted index at this position. More...
 
void moveToNext (size_t d)
 Advances the iterator in dimension d, if available, to the next position. More...
 
void reset (size_t d)
 Resets the iterator in dimension d to the start, if available. More...
 
size_t resetAndGetValue (size_t d, size_t defaultValue)
 Resets the iterator in dimension d and returns its value, if available. More...
 
void setIterator (size_t d, std::shared_ptr< AbstractPermutationIterator > iterator)
 Stores a custom iterator in the given dimension. More...
 
size_t value (size_t d, size_t defaultValue)
 

Static Public Attributes

static IterationPolicy Default
 Default Iteration policy (no custom iterators). More...
 

Detailed Description

With the IterationPolicy class, an AbstractMultiStorage can be configured to traverse its entries in a different order than the identity order.

Therefore, an IterationPolicy can store a AbstractPermutationIterator for each dimension, which, if available, may define an other order in this dimension.

Constructor & Destructor Documentation

◆ IterationPolicy()

sgpp::combigrid::IterationPolicy::IterationPolicy ( )
inline

Member Function Documentation

◆ getIterator()

std::shared_ptr<AbstractPermutationIterator> sgpp::combigrid::IterationPolicy::getIterator ( size_t  d) const
inline
Returns
Returns an iterator if there is one and nullptr if there is no custom iterator for this dimension.

◆ hasCustomIterator()

bool sgpp::combigrid::IterationPolicy::hasCustomIterator ( size_t  d) const
inline
Returns
Returns true iff there is a custom iterator in the given dimension.

◆ moveAndGetValue()

size_t sgpp::combigrid::IterationPolicy::moveAndGetValue ( size_t  d,
size_t  defaultValue 
)
inline

Advances the iterator in dimension d, if available, to the next position and returns the permuted index at this position.

If there is no custom iterator in dimension d, it returns the default value.

Referenced by sgpp::combigrid::TreeStorageGuidedIterator< T >::moveToNext().

◆ moveToNext()

void sgpp::combigrid::IterationPolicy::moveToNext ( size_t  d)
inline

Advances the iterator in dimension d, if available, to the next position.

Referenced by sgpp::combigrid::TreeStorageGuidedIterator< T >::moveToNext().

◆ reset()

void sgpp::combigrid::IterationPolicy::reset ( size_t  d)
inline

Resets the iterator in dimension d to the start, if available.

Referenced by sgpp::combigrid::TreeStorageGuidedIterator< T >::moveToNext().

◆ resetAndGetValue()

size_t sgpp::combigrid::IterationPolicy::resetAndGetValue ( size_t  d,
size_t  defaultValue 
)
inline

Resets the iterator in dimension d and returns its value, if available.

Returns the default value otherwise.

Referenced by sgpp::combigrid::TreeStorageGuidedIterator< T >::moveToNext().

◆ setIterator()

void sgpp::combigrid::IterationPolicy::setIterator ( size_t  d,
std::shared_ptr< AbstractPermutationIterator iterator 
)
inline

Stores a custom iterator in the given dimension.

Referenced by sgpp::combigrid::CombigridTreeStorage::getGuidedIterator().

◆ value()

Member Data Documentation

◆ Default

IterationPolicy sgpp::combigrid::IterationPolicy::Default
static

Default Iteration policy (no custom iterators).

Referenced by sgpp::combigrid::AbstractMultiStorage< T >::~AbstractMultiStorage().


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