G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsGridIterator< T, CWISE, d, false > Class Template Reference

Detailed Description

template<class T, short_t d>
class gismo::gsGridIterator< T, CWISE, d, false >

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);

Template Parameters
Ttype of the numeric coordinates of the index vector
dstatically known dimension, or dynamic dimension if d = -1 (default value)
+ Collaboration diagram for gsGridIterator< T, CWISE, d, false >:

Public Member Functions

template<class CwiseContainer >
 gsGridIterator (const CwiseContainer &cwise)
 Constructor using references to the coordinate vectors. More...
 
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. More...
 
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.
 

Constructor & Destructor Documentation

gsGridIterator ( const CwiseContainer &  cwise)
inlineexplicit

Constructor using references to the coordinate vectors.

Parameters
cwiseA container of matrices or vectors, each containing the sample points in the respective coordinate

Member Function Documentation

const gsMatrix<T> operator[] ( const point_index &  ti) const
inline

Returns the point corresponding to tensor index ti.

Note
Unlikely to std iterators, the position is not counted from the current position of this, but from the starting point of the iteration
Parameters
tia valid tensor index of a point in the iteration sequence