class that store the information of the grid like number of point on each direction and define the index linearization by stride More...
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 69 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... | |
void | setDimensions (std::vector< size_t > &dims) |
Reset the dimension of the grid. More... | |
void | setDimensions (const size_t(&dims)[N]) |
Reset the dimension of the grid. More... | |
bool | isLinearizeLinear () |
Is linearize additive. 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)[N]) |
size_t | totalSize (const std::vector< size_t > &sz) |
grid_sm (std::vector< 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... | |
grid_sm (std::vector< size_t > &&sz) | |
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 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 |
std::vector< size_t > | getVectorSize () |
Return the size of the grid as an std::vector. More... | |
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... | |
Private Member Functions | |
size_t | mulLin (size_t a, size_t b) |
It multiplicate two number and return the result. More... | |
void | Initialize (std::vector< 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 242 of file grid_sm.hpp.
|
inline |
construct a grid from another grid
construct a grid from another grid, type can be different
Definition at line 254 of file grid_sm.hpp.
Construct a grid of a specified size.
Construct a grid of a specified size
sz | is an std::vector that contain the size of the grid on each dimension |
Definition at line 304 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 318 of file grid_sm.hpp.
Construct a grid of a specified size.
Construct a grid of a specified size
sz | is an std::vector that contain the size of the grid on each dimension |
Definition at line 332 of file grid_sm.hpp.
Return the box enclosing the grid.
Definition at line 194 of file grid_sm.hpp.
|
inline |
Return the size of the grid as an array.
Definition at line 674 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 687 of file grid_sm.hpp.
|
inline |
Return the size of the grid as an std::vector.
Definition at line 657 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 |
Definition at line 118 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 142 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 483 of file grid_sm.hpp.
|
inline |
Is linearize additive.
Is linearize a linear function, in this case for stride return true because linearize respect the property
Linearize(key1 + key2) = Linearize(key1) + Linearize(key2)
Definition at line 231 of file grid_sm.hpp.
|
inline |
linearize an arbitrary set of index
linearize an arbitrary set of index
Definition at line 457 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 354 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 421 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 441 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 509 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 530 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 401 of file grid_sm.hpp.
|
inlineprivate |
It multiplicate two number and return the result.
It multiplicate two number and return the result, mainly used for LinId
a | operand 1 |
b | operand 2 |
Definition at line 104 of file grid_sm.hpp.
|
inline |
Check if the two grid_sm are the same.
g | element to check |
Definition at line 617 of file grid_sm.hpp.
|
inline |
Copy the grid from another grid.
g | grid from witch to copy |
Definition at line 563 of file grid_sm.hpp.
|
inline |
Check if the two grid_sm are the same.
g | element to check |
Definition at line 585 of file grid_sm.hpp.
|
inline |
Reset the dimension of the grid.
dims | std::vector that store on each dimension the size of the grid |
Definition at line 205 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 216 of file grid_sm.hpp.
|
inline |
Return the size of the grid.
Return the size of the grid
Definition at line 552 of file grid_sm.hpp.
|
inline |
Get the size of the grid on the direction i
i | direction |
Definition at line 647 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 633 of file grid_sm.hpp.