template<class Z, int mode, short_t d>
class gismo::gsGridIterator< Z, mode, d, true >
Iterator over the Cartesian product of integer points in a tensor-product grid.
The iteration is done in lexicographic order.
- mode = 0 : iteration over [a, b) or [a, b] gsGridIterator<T,CUBE> grid(a,b);
- mode = 1 : iteration over the boundry points of [a, b) or [a, b] gsGridIterator<T,BDR> grid(a,b);
- mode = 2 : iteration over the vertices of [a, b) or [a, b] gsGridIterator<T,VERTEX> grid(a,b);
The open or closed case is determined by a constructor flag. A third argument, eg. gsGridIterator<T,CUBE,d> grid(a,b); specifies fixed size dimension d
- Note
- Iteration over the boundary including offsets is possible using the free functions in gsUtils/gsCombinatorics.h
- Template Parameters
-
Z | type of the integer coordinates of the index vector |
d | statically known dimension, or dynamic dimension if d = -1 (default value) |
mode | 0: all integer points in [a,b], 1: all points in [a,b), 2: vertices of cube [a,b] |
|
| gsGridIterator () |
| Empty constructor.
|
|
| gsGridIterator (point const &a, point const &b, bool open=true) |
| Constructor using lower and upper limits. More...
|
|
| gsGridIterator (point const &b, bool open=true) |
| Constructor using upper limit. The iteration starts from zero. More...
|
|
| gsGridIterator (gsMatrix< Z, d, 2 > const &ab, bool open=true) |
| Constructor using lower and upper limits. More...
|
|
bool | isBoundary () const |
| Returns true if the current point lies on a boundary.
|
|
bool | isCeil (int i) const |
| Returns true if the i-th coordinate has maximal value.
|
|
bool | isFloor (int i) const |
| Returns true if the i-th coordinate has minimal value.
|
|
const point & | lower () const |
| Returns the first point in the iteration.
|
|
index_t | numPoints () const |
| Returns the total number of points that are iterated.
|
|
point | numPointsCwise () const |
| Returns the total number of points per coordinate which are iterated.
|
|
void | reset (point const &a, point const &b, bool open=true) |
| Resets the iterator using new lower and upper limits. More...
|
|
void | reset () |
| Resets the iterator, so that a new iteration over the points may start.
|
|
point | strides () const |
| Utility function which returns the vector of strides. More...
|
|
const point & | upper () const |
| Returns the last point in the iteration.
|
|