Restricted iterator. More...
#include <dense_iter.h>
Public Member Functions | |
DenseIterRestricted (std::array< Index, rank > const &dim_, std::array< Index, rank > const &ord_, std::array< Index, rank > const &fixed_) | |
Ctor for nontrivial ordering. More... | |
operator bool () const | |
False if we reached the last element. More... | |
std::array< Index, rank > const & | operator() () const |
Returns the set of the current indices. More... | |
void | operator++ () |
Increase the indices in the order specified by ord. More... | |
DenseIterRestricted | operator= (DenseIterRestricted &&)=delete |
Move assignment op deleted, would require pointer fiddling. More... | |
DenseIterRestricted | operator= (DenseIterRestricted const &)=delete |
Copy assignment op deleted, would require pointer fiddling. More... | |
Protected Attributes | |
bool | alive |
True if the iterator is within the range specified by the dimensions at construction. More... | |
std::array< Index, rank > | cur |
Current value of the array. More... | |
std::array< Index, rank > | dim |
Dimensions of individual indices, dim[i] is the dimension of the i-th increased index. More... | |
std::array< Index *, rank > | ptrs |
Pointer to indices, ptrs[i] points to i-th increased index. More... | |
Restricted iterator.
Behaves much like DenseIter, but can keep some indices fixed at a specified value.
This is achieved by a third argument fixed_
of the constructor.
Performance is worse than the plain DenseIter when iterating over the whole array, but much better if at least one (non-trivial) dimension is kept fixed.