OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
grid_key_dx< dim > Class Template Reference

grid_key_dx is the key to access any element in the grid More...

Detailed Description

template<unsigned int dim>
class grid_key_dx< dim >

grid_key_dx is the key to access any element in the grid

Given a grid in general a set of indexes define one element in the grid For example 2 indexes identify one element on a two dimensional grid, 3 indexes on a 3 dimensional grid ...

Template Parameters
dimdimensionality of the grid

Definition at line 18 of file grid_key.hpp.

#include <grid_key.hpp>

Public Member Functions

template<typename exp1 >
 grid_key_dx (const grid_key_dx_expression< dim, exp1 > &exp)
 Constructor from expression. More...
 
 grid_key_dx ()
 Constructor.
 
 grid_key_dx (std::initializer_list< long int > p1)
 Constructor from initializer list. More...
 
 grid_key_dx (const grid_key_dx< dim > &key)
 Constructor from an other key. More...
 
 grid_key_dx (const size_t(&k)[dim])
 Constructor from buffer reference. More...
 
 grid_key_dx (const long int(&k)[dim])
 Constructor from buffer reference. More...
 
template<typename... T>
 grid_key_dx (const comb< dim > &cmb)
 Construct a grid key from a list of numbers. More...
 
template<typename... T>
 grid_key_dx (const size_t v, const T...t)
 Construct a grid key from a list of numbers. More...
 
void zero ()
 Set to zero the key. More...
 
void one ()
 Set to one the key. More...
 
void invalid ()
 Set to invalid the key. More...
 
bool isValid ()
 Check if the key is invalid (all components set to -1) More...
 
grid_key_dx< dim > & operator+= (const grid_key_dx< dim > &p)
 sum a grid_key More...
 
grid_key_dx< dim > & operator-= (const grid_key_dx< dim > &p)
 sum a grid_key More...
 
grid_key_dx_sum< dim,
grid_key_dx< dim >
, grid_key_dx< dim > > 
operator+ (const grid_key_dx< dim > &p) const
 sum a grid_key to the grid_key More...
 
grid_key_dx_sum< dim,
grid_key_dx< dim >, Point< dim,
long int > > 
operator+ (const Point< dim, long int > &p) const
 sum a point to the grid_key More...
 
grid_key_dx_sum< dim,
grid_key_dx< dim >, comb< dim > > 
operator+ (const comb< dim > &cmb) const
 sum an a combination to the grid_key More...
 
grid_key_dx_sub< dim,
grid_key_dx< dim >
, grid_key_dx< dim > > 
operator- (const grid_key_dx< dim > &cmb) const
 sum an a combination to the grid_key More...
 
template<typename T >
grid_key_dx_sub< dim,
grid_key_dx< dim >
, grid_key_dx_expression< dim,
T > > 
operator- (const grid_key_dx_expression< dim, T > &cmb) const
 sum this key to another grid expression More...
 
template<unsigned int dim_t>
bool operator== (const grid_key_dx< dim_t > &key_t) const
 Check if two key are the same. More...
 
template<unsigned int dim_t>
bool operator!= (const grid_key_dx< dim_t > &key_t)
 Check if two key are the same. More...
 
template<typename a , typename... T>
void set (a v, T...t)
 set the Key from a list of numbers More...
 
const long int(& get_k () const)[dim]
 Return the internal k structure. More...
 
Point< dim, long int > toPointS () const
 Convert to a point the grid_key_dx. More...
 
std::string to_string ()
 convert the information into a string More...
 
Point< dim, size_t > toPoint () const
 Convert to a point the grid_key_dx. More...
 
mem_id value (size_t i) const
 Get the i index. More...
 
mem_id get (size_t i) const
 Get the i index. More...
 
void set_d (size_t i, mem_id id)
 Set the i index. More...
 
template<typename a , typename... T>
 grid_key_dx (a v, T...t)
 
template<typename a , typename... T>
void set (a v, T...t)
 

Private Member Functions

template<typename a , typename... T>
void invert_assign (a v, T...t)
 Recursively invert the assignment. More...
 
template<typename a , typename... T>
void invert_assign (a v)
 assignment More...
 
void invert_assign ()
 Constructor.
 
template<typename a , typename... T>
void invert_assign (a v, T...t)
 
template<typename a , typename... T>
void invert_assign (a v)
 

Private Attributes

mem_id k [dim]
 structure that store all the index
 

Constructor & Destructor Documentation

template<unsigned int dim>
template<typename exp1 >
grid_key_dx< dim >::grid_key_dx ( const grid_key_dx_expression< dim, exp1 > &  exp)
inline

Constructor from expression.

Parameters
expgrid_key_dx expression

Definition at line 27 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx< dim >::grid_key_dx ( std::initializer_list< long int >  p1)
inline

Constructor from initializer list.

Parameters
p1initializer list

Definition at line 42 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx< dim >::grid_key_dx ( const grid_key_dx< dim > &  key)
inline

Constructor from an other key.

Parameters
keycopy constructor

Definition at line 59 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx< dim >::grid_key_dx ( const size_t(&)  k[dim])
inline

Constructor from buffer reference.

Parameters
kreference buffer

Definition at line 69 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx< dim >::grid_key_dx ( const long int(&)  k[dim])
inline

Constructor from buffer reference.

Parameters
kreference buffer

Definition at line 80 of file grid_key.hpp.

template<unsigned int dim>
template<typename... T>
grid_key_dx< dim >::grid_key_dx ( const comb< dim > &  cmb)
inline

Construct a grid key from a list of numbers.

Parameters
cmbcombination

Definition at line 91 of file grid_key.hpp.

template<unsigned int dim>
template<typename... T>
grid_key_dx< dim >::grid_key_dx ( const size_t  v,
const T...  t 
)
inline

Construct a grid key from a list of numbers.

Parameters
vnumber
tthe other numbers

Definition at line 103 of file grid_key.hpp.

Member Function Documentation

template<unsigned int dim>
mem_id grid_key_dx< dim >::get ( size_t  i) const
inline

Get the i index.

Parameters
iindex to get
Returns
the index value

Definition at line 394 of file grid_key.hpp.

template<unsigned int dim>
const long int(& grid_key_dx< dim >::get_k ( ) )[dim]
inline

Return the internal k structure.

Returns
k

Definition at line 320 of file grid_key.hpp.

template<unsigned int dim>
void grid_key_dx< dim >::invalid ( )
inline

Set to invalid the key.

Definition at line 134 of file grid_key.hpp.

template<unsigned int dim>
template<typename a , typename... T>
void grid_key_dx< dim >::invert_assign ( v,
T...  t 
)
inlineprivate

Recursively invert the assignment.

Recursively invert the assignment at compile-time (hopefully)

Parameters
vlist of numbers
tlist of numbers

Definition at line 431 of file grid_key.hpp.

template<unsigned int dim>
template<typename a , typename... T>
void grid_key_dx< dim >::invert_assign ( v)
inlineprivate

assignment

Parameters
vlist of number

Definition at line 442 of file grid_key.hpp.

template<unsigned int dim>
bool grid_key_dx< dim >::isValid ( )
inline

Check if the key is invalid (all components set to -1)

Returns
true if it is valid

Definition at line 145 of file grid_key.hpp.

template<unsigned int dim>
void grid_key_dx< dim >::one ( )
inline

Set to one the key.

Definition at line 125 of file grid_key.hpp.

template<unsigned int dim>
template<unsigned int dim_t>
bool grid_key_dx< dim >::operator!= ( const grid_key_dx< dim_t > &  key_t)
inline

Check if two key are the same.

Parameters
key_tkey to check
Returns
true if the two key are equal

Definition at line 292 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx_sum<dim,grid_key_dx<dim>,grid_key_dx<dim> > grid_key_dx< dim >::operator+ ( const grid_key_dx< dim > &  p) const
inline

sum a grid_key to the grid_key

Parameters
pgrid_key to sum
Returns
a grid_key_dx_expression that encapsulate the expression

Definition at line 193 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx_sum<dim,grid_key_dx<dim>,Point<dim,long int> > grid_key_dx< dim >::operator+ ( const Point< dim, long int > &  p) const
inline

sum a point to the grid_key

Parameters
ppoint (or relative movement)
Returns
a grid_key_dx_expression that encapsulate the expression

Definition at line 207 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx_sum<dim,grid_key_dx<dim>,comb<dim> > grid_key_dx< dim >::operator+ ( const comb< dim > &  cmb) const
inline

sum an a combination to the grid_key

Parameters
cmbcombination (or relative movement)
Returns
a grid_key_dx_expression that encapsulate the expression

Definition at line 221 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx<dim>& grid_key_dx< dim >::operator+= ( const grid_key_dx< dim > &  p)
inline

sum a grid_key

Parameters
pcomb combination (or relative movement)
Returns
a grid_key_dx_expression that encapsulate the expression

Definition at line 163 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx_sub<dim,grid_key_dx<dim>,grid_key_dx<dim> > grid_key_dx< dim >::operator- ( const grid_key_dx< dim > &  cmb) const
inline

sum an a combination to the grid_key

Parameters
cmbcombination (or relative movement)
Returns
a grid_key_dx_expression that encapsulate the expression

Definition at line 235 of file grid_key.hpp.

template<unsigned int dim>
template<typename T >
grid_key_dx_sub<dim,grid_key_dx<dim>,grid_key_dx_expression<dim,T> > grid_key_dx< dim >::operator- ( const grid_key_dx_expression< dim, T > &  cmb) const
inline

sum this key to another grid expression

Parameters
cmbexpression
Returns
a grid_key_dx_expression that encapsulate the expression

Definition at line 249 of file grid_key.hpp.

template<unsigned int dim>
grid_key_dx<dim>& grid_key_dx< dim >::operator-= ( const grid_key_dx< dim > &  p)
inline

sum a grid_key

Parameters
pcomb combination (or relative movement)
Returns
a grid_key_dx_expression that encapsulate the expression

Definition at line 178 of file grid_key.hpp.

template<unsigned int dim>
template<unsigned int dim_t>
bool grid_key_dx< dim >::operator== ( const grid_key_dx< dim_t > &  key_t) const
inline

Check if two key are the same.

Parameters
key_tkey to check
Returns
true if the two key are equal

Definition at line 263 of file grid_key.hpp.

template<unsigned int dim>
template<typename a , typename... T>
void grid_key_dx< dim >::set ( v,
T...  t 
)
inline

set the Key from a list of numbers

Parameters
vlist of number
tlist of number

Definition at line 305 of file grid_key.hpp.

template<unsigned int dim>
void grid_key_dx< dim >::set_d ( size_t  i,
mem_id  id 
)
inline

Set the i index.

Set the i index

Parameters
iindex to set
idvalue to set

Definition at line 407 of file grid_key.hpp.

template<unsigned int dim>
std::string grid_key_dx< dim >::to_string ( )
inline

convert the information into a string

Returns
a string

Definition at line 349 of file grid_key.hpp.

template<unsigned int dim>
Point<dim,size_t> grid_key_dx< dim >::toPoint ( ) const
inline

Convert to a point the grid_key_dx.

See Also
toPointS
Returns
a point unsigned long int

Definition at line 361 of file grid_key.hpp.

template<unsigned int dim>
Point<dim,long int> grid_key_dx< dim >::toPointS ( ) const
inline

Convert to a point the grid_key_dx.

See Also
toPoint
Returns
a point long int

Definition at line 332 of file grid_key.hpp.

template<unsigned int dim>
mem_id grid_key_dx< dim >::value ( size_t  i) const
inline

Get the i index.

Parameters
iindex to get
Returns
the index value

Definition at line 381 of file grid_key.hpp.

template<unsigned int dim>
void grid_key_dx< dim >::zero ( )
inline

Set to zero the key.

Definition at line 116 of file grid_key.hpp.


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