|
| | BoxIteratorND () noexcept=default |
| | Default constructor. Constructs an invalid iterator; call define() before use.
|
| |
| | BoxIteratorND (const BoxND< dim > &a_bx) noexcept |
| | Construct a BoxIteratorND associated with Box a_bx.
|
| |
| void | setBox (const BoxND< dim > &a_bx) noexcept |
| | Associate this iterator with Box a_bx (equivalent to define()).
|
| |
| void | define (const BoxND< dim > &a_bx) noexcept |
| | Associate this iterator with Box a_bx.
|
| |
| BoxIteratorND | begin () noexcept |
| | Reset to the first IntVect (smallEnd) and return *this for range-based for.
|
| |
| BoxIteratorND | end () const noexcept |
| | Return a past-the-end sentinel for use by range-based for loops.
|
| |
| void | reset () noexcept |
| | Reset to the first IntVect (smallEnd) of the Box.
|
| |
| BoxIteratorND & | operator++ () noexcept |
| | Advance to the next IntVect in the Box (pre-increment).
|
| |
| void | next () noexcept |
| | Advance to the next IntVect in the Box.
|
| |
| const IntVectND< dim > & | operator() () const noexcept |
| | Return the current IntVect.
|
| |
| IntVectND< dim > | operator* () const noexcept |
| | Dereference: return the current IntVect by value.
|
| |
| bool | ok () const noexcept |
| | Return true if the iterator is within the Box.
|
| |
template<
int dim>
class amrex::BoxIteratorND< dim >
Iterator over all IntVects in a Box.
Iterates through the IntVects of a Box in the same order as a series of nested for loops, with the innermost loop over the first dimension.
Typical usage with a range-based for loop:
Using a traditional for loop:
...
BoxIterator bit (b);
for (bit.begin(); bit.ok(); ++bit)
{
}
Note that while regular iteration of the range-based version is reasonably performant, neither version is compatible with omp parallel for or simd autovectorization.
- Template Parameters
-