Declaration grid_sm.
class that store the information of the grid like number of point on each direction and define the index linearization by stride
N | dimensionality |
T | type of object is going to store the grid |
Definition at line 71 of file grid_sm.hpp.
#include <grid_sm.hpp>
Public Member Functions | |
const Box< N, size_t > & | getBox () const |
Return the box enclosing the grid. More... | |
const Box< N, size_t > | getBoxKey () const |
Return the box enclosing the grid. More... | |
void | setDimensions (const size_t(&dims)[N]) |
Reset the dimension of the grid. More... | |
grid_sm () | |
Default constructor. More... | |
template<typename S > | |
grid_sm (const grid_sm< N, S > &g) | |
construct a grid from another grid More... | |
size_t | totalSize (const size_t sz) |
size_t | totalSize (const size_t(&sz)[N]) |
grid_sm (const size_t &sz) | |
Construct a grid of a specified size. More... | |
grid_sm (const size_t(&sz)[N]) | |
Construct a grid of a specified size. More... | |
template<typename check = NoCheck> | |
mem_id | LinId (const grid_key_dx< N > &gk, const char sum_id[N]) const |
Linearization of the grid_key_dx with a specified shift. More... | |
template<typename check = NoCheck> | |
mem_id | LinId (const grid_key_dx< N > &gk, const char sum_id[N], const size_t(&bc)[N]) const |
Linearization of the grid_key_dx with a specified shift. More... | |
mem_id | LinIdPtr (size_t *k) const |
Linearization of the set of indexes. More... | |
mem_id | LinId (const size_t(&k)[N]) const |
Linearization of the grid_key_dx. More... | |
mem_id | LinId (const grid_key_dx< N > &gk) const |
Linearization of the grid_key_dx. More... | |
template<typename a , typename... lT> | |
mem_id | Lin (a v, lT...t) const |
linearize an arbitrary set of index More... | |
template<typename a > | |
mem_id | Lin (a v) const |
Linearize a set of index. | |
grid_key_dx< N > | InvLinId (mem_id id) const |
Construct. More... | |
template<unsigned int dim, unsigned int p> | |
mem_id | LinId (const grid_key_d< dim, p > &gk) const |
Linearization of the grid_key_d. More... | |
mem_id | LinId (mem_id *id) const |
Linearization of an array of mem_id (long int) More... | |
~grid_sm () | |
Destructor. | |
size_t | size () const |
Return the size of the grid. More... | |
grid_sm< N, T > & | operator= (const grid_sm< N, T > &g) |
Copy the grid from another grid. More... | |
bool | operator== (const grid_sm< N, T > &g) |
Check if the two grid_sm are the same. More... | |
bool | operator!= (const grid_sm< N, T > &g) |
Check if the two grid_sm are the same. More... | |
size_t | size_s (unsigned int i) const |
size_t | size (unsigned int i) const |
const size_t(& | getSize () const)[N] |
Return the size of the grid as an array. More... | |
grid_key_dx_iterator_sub< N > | getSubIterator (grid_key_dx< N > &start, grid_key_dx< N > &stop) const |
Return a sub-grid iterator. More... | |
void | swap (grid_sm< N, T > &g) |
swap the grid_sm informations More... | |
std::string | toString () const |
Produce a string from the object. More... | |
Private Member Functions | |
void | Initialize (const size_t sz) |
Initialize the basic structure. More... | |
void | Initialize (const size_t(&sz)[N]) |
Initialize the basic structure. More... | |
void | Initialize () |
Initialize the basic structure. More... | |
Private Attributes | |
Box< N, size_t > | box |
Box enclosing the grid. | |
size_t | size_tot |
total number of the elements in the grid | |
size_t | sz [N] |
size of the grid | |
size_t | sz_s [N] |
size of the grid on each stride (used for linearization) | |
Friends | |
template<unsigned int, typename > | |
class | grid_sm |
It simply mean that all the classes grid are friend of all its specialization. | |
Default constructor.
It produce a grid of size 0 on each dimension
Definition at line 241 of file grid_sm.hpp.
|
inline |
construct a grid from another grid
g | grid info |
construct a grid from another grid, type can be different
Definition at line 259 of file grid_sm.hpp.
Construct a grid of a specified size.
Construct a grid of a specified size
sz | is an array that contain the size of the grid on each dimension |
Definition at line 308 of file grid_sm.hpp.
Construct a grid of a specified size.
Construct a grid of a specified size
sz | is an array that contain the size of the grid on each dimension |
Definition at line 322 of file grid_sm.hpp.
|
inline |
Return the box enclosing the grid.
While getBox return as P2 the size of the grid getBoxKey return the size - 1 equivalent to the maximum valid point that does not overflow the grid
Definition at line 211 of file grid_sm.hpp.
|
inline |
Return the size of the grid as an array.
Definition at line 677 of file grid_sm.hpp.
|
inline |
Return a sub-grid iterator.
Return a sub-grid iterator, to iterate through the grid
start | start point |
stop | stop point |
Definition at line 690 of file grid_sm.hpp.
|
inlineprivate |
Initialize the basic structure.
Initialize the basic structure
sz | vector that store the size of the grid on each dimensions |
Initialize the basic structure for each dimension
Definition at line 110 of file grid_sm.hpp.
|
inlineprivate |
Initialize the basic structure.
Initialize the basic structure
sz | vector that store the size of the grid on each dimensions |
Initialize the basic structure for each dimension
Definition at line 141 of file grid_sm.hpp.
|
inlineprivate |
Initialize the basic structure.
Produce a grid of size 0 on each dimension
Initialize the basic structure for each dimension
Definition at line 169 of file grid_sm.hpp.
|
inline |
Construct.
inversion of the linearization of the grid_key_dx
id | of the object |
Definition at line 503 of file grid_sm.hpp.
|
inline |
linearize an arbitrary set of index
linearize an arbitrary set of index
Definition at line 477 of file grid_sm.hpp.
|
inline |
Linearization of the grid_key_dx with a specified shift.
check | class that check the linearization, if this check fail the function return -1 |
gk | grid_key_dx to linearize |
sum_id | shift on each dimension |
Definition at line 337 of file grid_sm.hpp.
|
inline |
Linearization of the grid_key_dx with a specified shift.
check | class that check the linearization, if this check fail the function return -1 |
gk | grid_key_dx to linearize |
sum_id | shift on each dimension |
bc | boundary conditions |
Definition at line 372 of file grid_sm.hpp.
|
inline |
Linearization of the grid_key_dx.
Linearization of the grid_key_dx given a key, it spit out a number that is just the 1D linearization of the key. In this case is the linearization of N index
k | grid key to access the element on the grid |
Definition at line 439 of file grid_sm.hpp.
|
inline |
Linearization of the grid_key_dx.
Linearization of the grid_key_dx given a key, it spit out a number that is just the 1D linearization of the key. In this case is the linearization of N index
gk | grid key to access the element of the grid |
Definition at line 460 of file grid_sm.hpp.
|
inline |
Linearization of the grid_key_d.
Linearization of the grid_key_d given a key, it spit out a number that is just the 1D linearization of the key. In this case is the linearization of N index
gk | grid key to access the element on a key |
Definition at line 529 of file grid_sm.hpp.
|
inline |
Linearization of an array of mem_id (long int)
Linearization of an array of mem_id, it spit out a number that is just the 1D linearization of the key. In this case is the linearization of N index
id | an array of mem_id index |
Definition at line 550 of file grid_sm.hpp.
|
inline |
Linearization of the set of indexes.
Linearization of the set of indexes, it spit out a number that is just the 1D linearization. In this case is the linearization of N index
k | set of indexes to linearize |
Definition at line 419 of file grid_sm.hpp.
|
inline |
Check if the two grid_sm are the same.
g | element to check |
Definition at line 637 of file grid_sm.hpp.
|
inline |
Copy the grid from another grid.
g | grid from witch to copy |
Definition at line 583 of file grid_sm.hpp.
|
inline |
Check if the two grid_sm are the same.
g | element to check |
Definition at line 605 of file grid_sm.hpp.
|
inline |
Reset the dimension of the grid.
dims | store on each dimension the size of the grid |
Definition at line 229 of file grid_sm.hpp.
|
inline |
Return the size of the grid.
Return the size of the grid
Definition at line 572 of file grid_sm.hpp.
|
inline |
Get the size of the grid on the direction i
i | direction |
Definition at line 667 of file grid_sm.hpp.
|
inline |
Get the stride-size of the grid on the direction i
[Example] on a grid 16*16*16 it return 16,256
i | direction |
Definition at line 653 of file grid_sm.hpp.
|
inline |