Iterator class for iterating over multi-dimensional indices.
More...
#include <multi_index.hpp>
|
| std::ostream & | operator<< (std::ostream &os, const Iterator &it) |
| | Outputs the current multi-dimensional indices to the specified output stream.
|
| |
template<
size_t D>
class pfc::MultiIndex< D >::Iterator
Iterator class for iterating over multi-dimensional indices.
◆ Iterator() [1/2]
Constructs an Iterator object with the specified indices and MultiIndex object.
- Parameters
-
| indices | The initial multi-dimensional indices. |
| multi_index | Reference to the MultiIndex object. |
◆ Iterator() [2/2]
Constructs an Iterator object with the specified linear index and MultiIndex object.
- Parameters
-
| linear_index | The initial linear index. |
| multi_index | Reference to the MultiIndex object. |
◆ get_linear_index()
Returns the current linear index.
- Returns
- The current linear index.
◆ operator size_t()
Conversion operator to obtain the current linear index.
- Returns
- The current linear index.
◆ operator std::array< int, D >()
Conversion operator to obtain the current multi-dimensional indices.
- Returns
- The current multi-dimensional indices.
◆ operator!=()
Compares two iterators for inequality.
- Parameters
-
| other | The iterator to compare. |
- Returns
- True if the iterators are not equal, false otherwise.
◆ operator*()
Dereferences the iterator to obtain the current multi-dimensional indices.
- Returns
- A reference to the current multi-dimensional indices.
◆ operator++() [1/2]
Advances the iterator to the next position.
- Returns
- Reference to the updated iterator.
◆ operator++() [2/2]
Advances the iterator to the next position (post-increment).
- Returns
- A copy of the iterator before the increment.
◆ operator-()
Subtraction operator for the Iterator class.
This operator subtracts the specified number of positions from the current iterator position. It returns a new iterator pointing to the element at the updated position.
- Parameters
-
| n | The number of positions to subtract from the current iterator position. |
- Returns
- A new Iterator object pointing to the element at the updated position.
◆ operator==()
Compares two iterators for equality.
- Parameters
-
| other | The iterator to compare. |
- Returns
- True if the iterators are equal, false otherwise.
◆ operator<<
Outputs the current multi-dimensional indices to the specified output stream.
- Parameters
-
| os | The output stream. |
| it | The iterator to output. |
- Returns
- Reference to the output stream.
The documentation for this class was generated from the following file: