8 #ifndef OPENFPM_DATA_SRC_GRID_ITERATORS_GRID_KEY_DX_ITERATOR_HPP_
9 #define OPENFPM_DATA_SRC_GRID_ITERATORS_GRID_KEY_DX_ITERATOR_HPP_
26 template<
unsigned int dim>
32 bool initialized =
false;
74 : grid_base(g_it.grid_base)
78 for (
size_t i = 0 ; i < dim ; i++)
80 gk.set_d(i,g_it.
get_gk(i));
108 grid_base = key_it.grid_base;
112 for (
size_t i = 0 ; i < dim ; i++)
113 {gk.set_d(i,key_it.
get_gk(i));}
128 size_t id = gk.get(0);
134 for ( ; i < dim-1 ; i++)
136 size_t id = gk.get(i);
137 if (
id >= grid_base.
size(i))
162 void set(
int d,
size_t sz)
179 if (gk.get(dim-1) < (
long int)grid_base.
size(dim-1))
209 grid_base = key.grid_base;
220 for (
size_t i = 0 ; i < dim ; i++)
void reinitialize(const grid_key_dx_iterator< dim > &key)
Reinitialize the grid_key_dx_iterator.
grid_key_dx is the key to access any element in the grid
size_t size() const
Return the size of the grid.
size_t get_gk(size_t i) const
return the index i of the gk key
void set(int d, size_t sz)
Set the dimension.
void reset()
Reset the iterator (it restart from the beginning)
grid_key_dx_iterator()
Default constructor.
bool isNext()
Check if there is the next element.
grid_key_dx_iterator< dim > operator=(const grid_key_dx_iterator< dim > &key_it)
Constructor from another grid_key_dx_iterator.
This class is a trick to indicate the compiler a specific specialization pattern. ...
grid_key_dx_iterator< dim > & operator++()
Get the next element.
grid_key_dx_iterator(const grid_key_dx_iterator< dim > &g_it)
Constructor from a grid_key_dx_iterator<dim>
grid_key_dx_iterator(const grid_sm< dim, T > &g)
Constructor require a grid_sm<dim,T>