OpenFPM_data  0.1.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
 All Data Structures Namespaces Functions Variables Typedefs Friends
grid_key_dx_iterator_sp< dim > Class Template Reference

Detailed Description

template<unsigned int dim>
class grid_key_dx_iterator_sp< dim >

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)

Parameters
dimdimensionality 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>

+ Inheritance diagram for grid_key_dx_iterator_sp< dim >:

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
 

Constructor & Destructor Documentation

template<unsigned int dim>
template<typename T >
grid_key_dx_iterator_sp< dim >::grid_key_dx_iterator_sp ( grid_sm< dim, T > &  g,
mem_id  from,
mem_id  to 
)
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)
*
*
* 
Template Parameters
Ttype of object that the grid store
Parameters
gGrid on which iterate
fromstarting point
toend point

Convert to a grid_key

Convert to a grid_key

Definition at line 80 of file grid_key_dx_iterator_sp.hpp.

Member Function Documentation

template<unsigned int dim>
bool grid_key_dx_iterator_sp< dim >::isNext ( )
inline

Check if there is the next element.

Check if there is the next element

Returns
true if there is the next, false otherwise

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.


The documentation for this class was generated from the following file: