G+Smo
25.01.0
Geometry + Simulation Modules
|
Iterator over a Cartesian product of points, which is given by coordinate-wise point sets.
The iteration is done in lexicographic order. Usage:
gsGridIterator<T,CWISE> grid(a,b);
or
gsGridIterator<T,CWISE,d> grid(a,b);
T | type of the numeric coordinates of the index vector |
d | statically known dimension, or dynamic dimension if d = -1 (default value) |
Public Member Functions | |
template<class CwiseContainer > | |
gsGridIterator (const CwiseContainer &cwise) | |
Constructor using references to the coordinate vectors. | |
index_t | index (const index_t i) const |
Returns the i-th index of the current point. | |
const integer_iterator & | index_iterator () const |
Returns a reference to the underlying integer lattice iterator. | |
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. | |
index_t | numPoints () const |
Returns the total number of points that are iterated. | |
point_index | numPointsCwise () const |
Returns the total number of points per coordinate which are iterated. | |
const gsMatrix< T > | operator[] (const point_index &ti) const |
Returns the point corresponding to tensor index ti. | |
void | reset () |
Resets the iterator, so that a new iteration over the points may start. | |
const point_index & | tensorIndex () const |
Returns the tensor index of the current point. | |
Private Attributes | |
gsMatrix< T > | m_cur |
Current point pointed at by the iterator. | |
CwiseData | m_cwise |
List of coordinate-wise values. | |
integer_iterator | m_iter |
Underlying integer lattice iterator. | |
|
inlineexplicit |
Constructor using references to the coordinate vectors.
cwise | A container of matrices or vectors, each containing the sample points in the respective coordinate |
Returns the point corresponding to tensor index ti.
ti | a valid tensor index of a point in the iteration sequence |