OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
grid_key_sparse_dx_iterator< dim, n_ele > Class Template Reference

Grid key sparse iterator. More...

Detailed Description

template<unsigned dim, unsigned int n_ele>
class grid_key_sparse_dx_iterator< dim, n_ele >

Grid key sparse iterator.

Definition at line 425 of file SparseGrid_iterator.hpp.

#include <SparseGrid_iterator.hpp>

Public Member Functions

 grid_key_sparse_dx_iterator ()
 Default constructor.
 
 grid_key_sparse_dx_iterator (const openfpm::vector< mheader< n_ele > > *header_mask, const openfpm::vector< cheader< dim > > *header_inf, const grid_key_dx< dim >(*lin_id_pos)[n_ele])
 
grid_key_sparse_dx_iterator< dim, n_ele > & operator++ ()
 
void reinitialize (const grid_key_sparse_dx_iterator< dim, n_ele > &g_s_it)
 Reinitialize the iterator.
 
void reinitialize (const grid_key_sparse_dx_iterator_sub< dim, n_ele > &g_s_it)
 Reinitialize the iterator.
 
grid_key_sparse_lin_dx getKeyF ()
 Return the actual point.
 
grid_key_dx< dim > get () const
 Return the position of the actual point in coordinates.
 
bool isNext ()
 Return true if there is a next grid point.
 

Private Member Functions

void SelectValidAndFill_mask_it ()
 Everytime we move to a new chunk we calculate on which indexes we have to iterate.
 

Private Attributes

const openfpm::vector< mheader< n_ele > > * header_mask
 It store the information of each chunk.
 
const openfpm::vector< cheader< dim > > * header_inf
 It store the information of each chunk.
 
const grid_key_dx< dim >(* lin_id_pos )[n_ele]
 linearized id to position in coordinates conversion
 
size_t chunk_id
 point to the actual chunk
 
int mask_nele
 Number of points in mask_it.
 
size_t mask_it_pnt
 Actual point in mask it.
 
short unsigned int mask_it [n_ele]
 set of index in the chunk on which we have to iterate
 

Constructor & Destructor Documentation

◆ grid_key_sparse_dx_iterator() [1/2]

template<unsigned dim, unsigned int n_ele>
grid_key_sparse_dx_iterator< dim, n_ele >::grid_key_sparse_dx_iterator ( )
inline

Default constructor.

Warning
extremely unsafe If you use this constructor before use the iterator you should call reinitialize first

Definition at line 476 of file SparseGrid_iterator.hpp.

◆ grid_key_sparse_dx_iterator() [2/2]

template<unsigned dim, unsigned int n_ele>
grid_key_sparse_dx_iterator< dim, n_ele >::grid_key_sparse_dx_iterator ( const openfpm::vector< mheader< n_ele > > *  header_mask,
const openfpm::vector< cheader< dim > > *  header_inf,
const grid_key_dx< dim >(*)  lin_id_pos[n_ele] 
)
inline

Definition at line 478 of file SparseGrid_iterator.hpp.

Member Function Documentation

◆ get()

template<unsigned dim, unsigned int n_ele>
grid_key_dx< dim > grid_key_sparse_dx_iterator< dim, n_ele >::get ( ) const
inline

Return the position of the actual point in coordinates.

Returns
the position

Definition at line 561 of file SparseGrid_iterator.hpp.

◆ getKeyF()

template<unsigned dim, unsigned int n_ele>
grid_key_sparse_lin_dx grid_key_sparse_dx_iterator< dim, n_ele >::getKeyF ( )
inline

Return the actual point.

Warning
the key that this function return cannot be used with function like move
Returns
the actual point

Definition at line 551 of file SparseGrid_iterator.hpp.

◆ isNext()

template<unsigned dim, unsigned int n_ele>
bool grid_key_sparse_dx_iterator< dim, n_ele >::isNext ( )
inline

Return true if there is a next grid point.

Returns
true if there is the next grid point

Definition at line 580 of file SparseGrid_iterator.hpp.

◆ operator++()

template<unsigned dim, unsigned int n_ele>
grid_key_sparse_dx_iterator< dim, n_ele > & grid_key_sparse_dx_iterator< dim, n_ele >::operator++ ( )
inline

Definition at line 486 of file SparseGrid_iterator.hpp.

◆ reinitialize() [1/2]

template<unsigned dim, unsigned int n_ele>
void grid_key_sparse_dx_iterator< dim, n_ele >::reinitialize ( const grid_key_sparse_dx_iterator< dim, n_ele > &  g_s_it)
inline

Reinitialize the iterator.

it re-initialize the iterator with the passed grid_key_dx_iterator_sub the actual position of the grid_key_dx_iterator_sub is ignored

Parameters
g_s_itgrid_key_dx_iterator

Definition at line 514 of file SparseGrid_iterator.hpp.

◆ reinitialize() [2/2]

template<unsigned dim, unsigned int n_ele>
void grid_key_sparse_dx_iterator< dim, n_ele >::reinitialize ( const grid_key_sparse_dx_iterator_sub< dim, n_ele > &  g_s_it)
inline

Reinitialize the iterator.

it re-initialize the iterator with the passed grid_key_dx_iterator_sub the actual position of the grid_key_dx_iterator_sub is ignored

Parameters
g_s_itgrid_key_dx_iterator

Definition at line 534 of file SparseGrid_iterator.hpp.

◆ SelectValidAndFill_mask_it()

template<unsigned dim, unsigned int n_ele>
void grid_key_sparse_dx_iterator< dim, n_ele >::SelectValidAndFill_mask_it ( )
inlineprivate

Everytime we move to a new chunk we calculate on which indexes we have to iterate.

Definition at line 452 of file SparseGrid_iterator.hpp.

Field Documentation

◆ chunk_id

template<unsigned dim, unsigned int n_ele>
size_t grid_key_sparse_dx_iterator< dim, n_ele >::chunk_id
private

point to the actual chunk

Definition at line 437 of file SparseGrid_iterator.hpp.

◆ header_inf

template<unsigned dim, unsigned int n_ele>
const openfpm::vector<cheader<dim> >* grid_key_sparse_dx_iterator< dim, n_ele >::header_inf
private

It store the information of each chunk.

Definition at line 431 of file SparseGrid_iterator.hpp.

◆ header_mask

template<unsigned dim, unsigned int n_ele>
const openfpm::vector<mheader<n_ele> >* grid_key_sparse_dx_iterator< dim, n_ele >::header_mask
private

It store the information of each chunk.

Definition at line 428 of file SparseGrid_iterator.hpp.

◆ lin_id_pos

template<unsigned dim, unsigned int n_ele>
const grid_key_dx<dim>(* grid_key_sparse_dx_iterator< dim, n_ele >::lin_id_pos)[n_ele]
private

linearized id to position in coordinates conversion

Definition at line 434 of file SparseGrid_iterator.hpp.

◆ mask_it

template<unsigned dim, unsigned int n_ele>
short unsigned int grid_key_sparse_dx_iterator< dim, n_ele >::mask_it[n_ele]
private

set of index in the chunk on which we have to iterate

Definition at line 446 of file SparseGrid_iterator.hpp.

◆ mask_it_pnt

template<unsigned dim, unsigned int n_ele>
size_t grid_key_sparse_dx_iterator< dim, n_ele >::mask_it_pnt
private

Actual point in mask it.

Definition at line 443 of file SparseGrid_iterator.hpp.

◆ mask_nele

template<unsigned dim, unsigned int n_ele>
int grid_key_sparse_dx_iterator< dim, n_ele >::mask_nele
private

Number of points in mask_it.

Definition at line 440 of file SparseGrid_iterator.hpp.


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