Grid key class iterator, iterate through a starting linearized grid element to a stop linearized grid element in particular if linearize is the function that linearize all the grid_key_dx, it create an iterator that pass through Linearize^(-1)(start) Linearize^(-1)(start+1) ....... Linearize^(-1)(stop)
dim | dimensionality of the grid |
Usage: In general you never create object directly, but you get it from a grid_cpu or grid_gpu with getIteratorLinStartStop()
Definition at line 28 of file grid_key_dx_iterator_sp.hpp.
#include <grid_key_dx_iterator_sp.hpp>
Public Member Functions | |
template<typename T > | |
grid_key_dx_iterator_sp (grid_sm< dim, T > &g, mem_id from, mem_id to) | |
Constructor require a grid grid<dim,T> More... | |
bool | isNext () |
Check if there is the next element. More... | |
Public Member Functions inherited from grid_key_dx_iterator< dim > | |
grid_key_dx_iterator () | |
Default constructor. More... | |
grid_key_dx_iterator (const grid_key_dx_iterator< dim > &g_it) | |
Constructor from a grid_key_dx_iterator<dim> More... | |
template<typename T > | |
grid_key_dx_iterator (const grid_sm< dim, T > &g) | |
Constructor require a grid_sm<dim,T> More... | |
grid_key_dx_iterator< dim > | operator= (const grid_key_dx_iterator< dim > &key_it) |
Constructor from another grid_key_dx_iterator. More... | |
grid_key_dx_iterator< dim > & | operator++ () |
Get the next element. More... | |
void | set (int d, size_t sz) |
Set the dimension. More... | |
bool | isNext () |
Check if there is the next element. More... | |
const grid_key_dx< dim > & | get () |
Get the actual key. More... | |
void | reinitialize (const grid_key_dx_iterator< dim > &key) |
Reinitialize the grid_key_dx_iterator. More... | |
void | reset () |
Reset the iterator (it restart from the beginning) More... | |
Private Attributes | |
grid_key_dx< dim > | gk_stop |
stop point | |
Additional Inherited Members | |
Protected Attributes inherited from grid_key_dx_iterator< dim > | |
grid_key_dx< dim > | gk |
|
inline |
Constructor require a grid grid<dim,T>
It construct an iterator from one index to another, in particular if linearize is the function that linearize all the grid_key, it create an iterator that pass through Linearize^(-1)(start) Linearize^(-1)(start+1) ....... Linearize^(-1)(stop)
For example for start (1,1) and stop (3,3) the point indicated with # are explored by the iterator
* +-----+-----+-----+-----+-----+-----+ (6,5) | | | | | | | | | | | | | | | | | | | | | +-----+-----+-----+-----+-----+-----+ | | | | | | | | | | | | | | | | | | | | | #-----#-----#-----#-----+-----+-----+ | | | | | | | | | | | | | | | | | | | | | #-----#-----#-----#-----#-----#-----# | | | | | | | | | | | | | | +-----#-----#-----#-----#-----#-----# | | | | | | | | | | | | | | | | | | | | | +-----+-----+-----+-----+-----+-----+ (0,0) * * *
T | type of object that the grid store |
g | Grid on which iterate |
from | starting point |
to | end point |
Convert to a grid_key
Convert to a grid_key
Definition at line 80 of file grid_key_dx_iterator_sp.hpp.
|
inline |
Check if there is the next element.
Check if there is the next element
for all dimensions
check if we still have points
(Final point) we we still have one point
Definition at line 98 of file grid_key_dx_iterator_sp.hpp.