QUGaR 0.0.4
|
Iterator class for tensor index ranges. More...
#include <tensor_index_tp.hpp>
Public Member Functions | |
Iterator (const TensorIndexTP< dim > &index, const TensorIndexTP< dim > &lower_bound, const TensorIndexTP< dim > &upper_bound) | |
Constructs a new iterator object given and index and its lower and upper bounds. | |
const TensorIndexTP< dim > & | operator* () const |
Dereference operator. | |
const TensorIndexTP< dim > * | operator-> () const |
Indirection operator. | |
int | flat () const |
Transforms the current tensor index into a flat one by considering the upper bound as associated size. | |
Iterator & | operator++ () |
Pre increments the iterator. | |
Iterator | operator++ (int) |
Post increments the iterator. | |
bool | operator== (const Iterator &rhs) const |
Compares if two iterators are equal. They are considered to be equal if their indices and bounds are equal for all the components. | |
bool | operator!= (const Iterator &rhs) const |
Compares if two iterators are different. They are considered to be different if at least one of the components of their indices or bounds are different. | |
Private Attributes | |
TensorIndexTP< dim > | index_ |
Iterator index. | |
TensorIndexTP< dim > | lower_bound_ |
Lower bound. | |
TensorIndexTP< dim > | upper_bound_ |
Upper bound. | |
Iterator class for tensor index ranges.
qugar::TensorIndexRangeTP< dim >::Iterator::Iterator | ( | const TensorIndexTP< dim > & | index, |
const TensorIndexTP< dim > & | lower_bound, | ||
const TensorIndexTP< dim > & | upper_bound ) |
Constructs a new iterator object given and index
and its lower and upper bounds.
index | Current index for the iterator. |
lower_bound | Lower bounds. |
upper_bound | Upper bounds. |
|
nodiscard |
Transforms the current tensor index into a flat one by considering the upper bound as associated size.
|
nodiscard |
Compares if two iterators are different. They are considered to be different if at least one of the components of their indices or bounds are different.
rhs | Iterator to compare to the current one. |
|
nodiscard |
Dereference operator.
Iterator & qugar::TensorIndexRangeTP< dim >::Iterator::operator++ | ( | ) |
Pre increments the iterator.
Iterator qugar::TensorIndexRangeTP< dim >::Iterator::operator++ | ( | int | ) |
Post increments the iterator.
|
nodiscard |
Indirection operator.
|
nodiscard |
Compares if two iterators are equal. They are considered to be equal if their indices and bounds are equal for all the components.
rhs | Iterator to compare to the current one. |
|
private |
Iterator index.
|
private |
Lower bound.
|
private |
Upper bound.