SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::combigrid::IndexVectorIterator Class Reference

Iterator over the indices contained in a FullGrid. More...

#include <IndexVectorIterator.hpp>

Inheritance diagram for sgpp::combigrid::IndexVectorIterator:

Public Member Functions

size_t getSequenceNumber () const
 
double getStandardCoordinate (size_t d, bool hasBoundary)
 determines the coordinate of the current index in a given dimension "Standard" means no bounding box (i.e., the domain spanned by minIndex and maxIndex is the unit hypercube) and no stretching (i.e., the points have the standard locations \(i \cdot 2^{-\ell}\)).
 
void getStandardCoordinates (sgpp::base::DataVector &coordinates, bool hasBoundary=true)
 Sets the entries of DataVector coordinates to the coordinates of the gridpoint "Standard" means no bounding box (i.e., the domain spanned by minIndex and maxIndex is the unit hypercube) and no stretching (i.e., the points have the standard locations \(i \cdot 2^{-\ell}\)).
 
 IndexVectorIterator ()
 Default constructor, corresponds to the zero-dimensional case.
 
 IndexVectorIterator (const FullGrid &grid)
 Constructor, sets the iterator to the first grid point in the full grid.
 
 IndexVectorIterator (const IndexVector &minIndex, const IndexVector &maxIndex)
 Constructor, sets the iterator to the first grid point in the full grid.
 
 IndexVectorIterator (const IndexVectorIterator &)=default
 
bool isAtEnd ()
 check if iterator is at end of range – needed for swig interface
 
bool operator!= (const IndexVectorIterator &other) const
 
IndexVectoroperator* ()
 
IndexVectorIterator operator+ (size_t rhs) const
 
IndexVectorIteratoroperator++ ()
 
IndexVectorIterator operator++ (int)
 
IndexVectorIteratoroperator+= (size_t rhs)
 
size_t operator- (const IndexVectorIterator &other) const
 
IndexVectorIterator operator- (size_t rhs) const
 
IndexVectorIteratoroperator-- ()
 
IndexVectorIterator operator-- (int)
 
IndexVectorIteratoroperator-= (size_t rhs)
 
IndexVectoroperator-> ()
 
bool operator< (const IndexVectorIterator &other) const
 
bool operator<= (const IndexVectorIterator &other) const
 
IndexVectorIteratoroperator= (const IndexVectorIterator &)=default
 
bool operator== (const IndexVectorIterator &other) const
 
bool operator> (const IndexVectorIterator &other) const
 
bool operator>= (const IndexVectorIterator &other) const
 
IndexVectoroperator[] (size_t rhs)
 
void setSequenceNumber (size_t sequenceNumber)
 

Protected Attributes

size_t dim
 dimensionality
 
IndexVector indexVector
 temporary index vector, overwritten on read access
 
IndexVector maxIndex
 vector of maximum 1D indices
 
IndexVector minIndex
 vector of minimum 1D indices
 
IndexVector numberOfIndexVectors
 number of indices in 1D for all dimensions
 
size_t sequenceNumber
 current sequence number
 

Friends

IndexVectorIterator operator+ (size_t lhs, const IndexVectorIterator &rhs)
 

Detailed Description

Iterator over the indices contained in a FullGrid.

Constructor & Destructor Documentation

◆ IndexVectorIterator() [1/4]

sgpp::combigrid::IndexVectorIterator::IndexVectorIterator ( )
inline

Default constructor, corresponds to the zero-dimensional case.

◆ IndexVectorIterator() [2/4]

sgpp::combigrid::IndexVectorIterator::IndexVectorIterator ( const FullGrid grid)
inlineexplicit

Constructor, sets the iterator to the first grid point in the full grid.

Parameters
gridfull grid

References grid(), maxIndex, minIndex, and numberOfIndexVectors.

◆ IndexVectorIterator() [3/4]

sgpp::combigrid::IndexVectorIterator::IndexVectorIterator ( const IndexVector minIndex,
const IndexVector maxIndex 
)
inline

Constructor, sets the iterator to the first grid point in the full grid.

Parameters
minIndexvector of minimum 1D indices
maxIndexvector of maximum 1D indices

References dim, maxIndex, minIndex, and numberOfIndexVectors.

◆ IndexVectorIterator() [4/4]

sgpp::combigrid::IndexVectorIterator::IndexVectorIterator ( const IndexVectorIterator )
default

Member Function Documentation

◆ getSequenceNumber()

size_t sgpp::combigrid::IndexVectorIterator::getSequenceNumber ( ) const
inline
Returns
sequence number of current index

References sequenceNumber.

◆ getStandardCoordinate()

double sgpp::combigrid::IndexVectorIterator::getStandardCoordinate ( size_t  d,
bool  hasBoundary 
)
inline

determines the coordinate of the current index in a given dimension "Standard" means no bounding box (i.e., the domain spanned by minIndex and maxIndex is the unit hypercube) and no stretching (i.e., the points have the standard locations \(i \cdot 2^{-\ell}\)).

Parameters
dthe dimension in which the coordinate should be calculated
hasBoundarywhether the grid has boundary points
Returns
the coordinate in the given dimension

References maxIndex, minIndex, and operator*().

Referenced by getStandardCoordinates().

◆ getStandardCoordinates()

void sgpp::combigrid::IndexVectorIterator::getStandardCoordinates ( sgpp::base::DataVector coordinates,
bool  hasBoundary = true 
)
inline

Sets the entries of DataVector coordinates to the coordinates of the gridpoint "Standard" means no bounding box (i.e., the domain spanned by minIndex and maxIndex is the unit hypercube) and no stretching (i.e., the points have the standard locations \(i \cdot 2^{-\ell}\)).

Parameters
coordinatesthe DataVector that should be overwritten with the coordinates
hasBoundarywhether the grid has boundary points

References dim, getStandardCoordinate(), and sgpp::base::DataVector::set().

◆ isAtEnd()

bool sgpp::combigrid::IndexVectorIterator::isAtEnd ( )
inline

check if iterator is at end of range – needed for swig interface

References dim, numberOfIndexVectors, and sequenceNumber.

◆ operator!=()

bool sgpp::combigrid::IndexVectorIterator::operator!= ( const IndexVectorIterator other) const
inline
Parameters
otherother iterator
Returns
whether both instances are inequal (with respect to sequence numbers)

References sequenceNumber.

◆ operator*()

IndexVector & sgpp::combigrid::IndexVectorIterator::operator* ( )
inline
Returns
reference to current index

References operator[](), and sequenceNumber.

Referenced by getStandardCoordinate().

◆ operator+()

IndexVectorIterator sgpp::combigrid::IndexVectorIterator::operator+ ( size_t  rhs) const
inline
Parameters
rhsright-hand side
Returns
copy of iterator increased by the right-hand side (increase of sequence number)

◆ operator++() [1/2]

IndexVectorIterator & sgpp::combigrid::IndexVectorIterator::operator++ ( )
inline
Returns
iterator before incrementing (selecting the next index)

References sequenceNumber.

◆ operator++() [2/2]

IndexVectorIterator sgpp::combigrid::IndexVectorIterator::operator++ ( int  )
inline
Returns
iterator after incrementing (selecting the next index)

References sequenceNumber.

◆ operator+=()

IndexVectorIterator & sgpp::combigrid::IndexVectorIterator::operator+= ( size_t  rhs)
inline
Parameters
rhsright-hand side
Returns
iterator increased by the right-hand side (increase of sequence number)

References sequenceNumber.

◆ operator-() [1/2]

size_t sgpp::combigrid::IndexVectorIterator::operator- ( const IndexVectorIterator other) const
inline
Parameters
otherother iterator
Returns
difference between this iterator and other iterator (difference of sequence numbers)

References sequenceNumber.

◆ operator-() [2/2]

IndexVectorIterator sgpp::combigrid::IndexVectorIterator::operator- ( size_t  rhs) const
inline
Parameters
rhsright-hand side
Returns
copy of iterator deccreased by the right-hand side (decrease of sequence number)

◆ operator--() [1/2]

IndexVectorIterator & sgpp::combigrid::IndexVectorIterator::operator-- ( )
inline
Returns
iterator before decrementing (selecting the previous index)

References sequenceNumber.

◆ operator--() [2/2]

IndexVectorIterator sgpp::combigrid::IndexVectorIterator::operator-- ( int  )
inline
Returns
iterator after decrementing (selecting the previous index)

References sequenceNumber.

◆ operator-=()

IndexVectorIterator & sgpp::combigrid::IndexVectorIterator::operator-= ( size_t  rhs)
inline
Parameters
rhsright-hand side
Returns
iterator decreased by the right-hand side (decrease of sequence number)

References sequenceNumber.

◆ operator->()

IndexVector * sgpp::combigrid::IndexVectorIterator::operator-> ( )
inline
Returns
pointer to current index

References operator[](), and sequenceNumber.

◆ operator<()

bool sgpp::combigrid::IndexVectorIterator::operator< ( const IndexVectorIterator other) const
inline
Parameters
otherother iterator
Returns
whether this instance is smaller than the other instance (with respect to sequence numbers)

References sequenceNumber.

◆ operator<=()

bool sgpp::combigrid::IndexVectorIterator::operator<= ( const IndexVectorIterator other) const
inline
Parameters
otherother iterator
Returns
whether this instance is smaller than or equal to the other instance (with respect to sequence numbers)

References sequenceNumber.

◆ operator=()

IndexVectorIterator & sgpp::combigrid::IndexVectorIterator::operator= ( const IndexVectorIterator )
default

◆ operator==()

bool sgpp::combigrid::IndexVectorIterator::operator== ( const IndexVectorIterator other) const
inline
Parameters
otherother iterator
Returns
whether both instances are equal (with respect to sequence numbers)

References sequenceNumber.

◆ operator>()

bool sgpp::combigrid::IndexVectorIterator::operator> ( const IndexVectorIterator other) const
inline
Parameters
otherother iterator
Returns
whether this instance is greater than the other instance (with respect to sequence numbers)

References sequenceNumber.

◆ operator>=()

bool sgpp::combigrid::IndexVectorIterator::operator>= ( const IndexVectorIterator other) const
inline
Parameters
otherother iterator
Returns
whether this instance is larger than or equal to the other instance (with respect to sequence numbers)

References sequenceNumber.

◆ operator[]()

IndexVector & sgpp::combigrid::IndexVectorIterator::operator[] ( size_t  rhs)
inline
Parameters
rhsarbitrary sequence number
Returns
reference to index corresponding to given sequence number

References dim, indexVector, minIndex, and numberOfIndexVectors.

Referenced by operator*(), and operator->().

◆ setSequenceNumber()

void sgpp::combigrid::IndexVectorIterator::setSequenceNumber ( size_t  sequenceNumber)
inline
Parameters
sequenceNumbersequence number of current index

References sequenceNumber.

Referenced by sgpp::combigrid::IndexVectorRange::end().

Friends And Related Symbol Documentation

◆ operator+

IndexVectorIterator operator+ ( size_t  lhs,
const IndexVectorIterator rhs 
)
friend
Parameters
lhsleft-hand side
rhsright-hand side
Returns
copy of right-hand side iterator increased by the left-hand side (increase of sequence number)

Member Data Documentation

◆ dim

◆ indexVector

IndexVector sgpp::combigrid::IndexVectorIterator::indexVector
protected

temporary index vector, overwritten on read access

Referenced by operator[]().

◆ maxIndex

IndexVector sgpp::combigrid::IndexVectorIterator::maxIndex
protected

vector of maximum 1D indices

Referenced by getStandardCoordinate(), IndexVectorIterator(), and IndexVectorIterator().

◆ minIndex

IndexVector sgpp::combigrid::IndexVectorIterator::minIndex
protected

vector of minimum 1D indices

Referenced by getStandardCoordinate(), IndexVectorIterator(), IndexVectorIterator(), and operator[]().

◆ numberOfIndexVectors

IndexVector sgpp::combigrid::IndexVectorIterator::numberOfIndexVectors
protected

number of indices in 1D for all dimensions

Referenced by IndexVectorIterator(), IndexVectorIterator(), isAtEnd(), and operator[]().

◆ sequenceNumber

size_t sgpp::combigrid::IndexVectorIterator::sequenceNumber
protected

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