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 166 of file grid_sm.hpp.
#include <grid_sm.hpp>
Public Member Functions | |
Box< N, size_t > | getBox () const |
Return the box enclosing the grid. | |
const Box< N, size_t > | getBoxKey () const |
Return the box enclosing the grid. | |
void | setDimensions (const size_t(&dims)[N]) |
Reset the dimension of the grid. | |
grid_sm () | |
Default constructor. | |
template<typename S > | |
__device__ __host__ | grid_sm (const grid_sm< N, S > &g) |
construct a grid from another grid | |
__device__ __host__ | grid_sm (const grid_sm< N, T > &g) |
copy constructor | |
size_t | totalSize (const size_t sz) |
__device__ __host__ size_t | totalSize (const size_t(&sz)[N]) |
grid_sm (const size_t &sz) | |
Construct a grid of a specified size. | |
__device__ __host__ | grid_sm (const size_t(&sz)[N]) |
Construct a grid of a specified size. | |
template<typename check = NoCheck, typename ids_type > | |
mem_id | LinId (const grid_key_dx< N, ids_type > &gk, const signed char sum_id[N]) const |
Linearization of the grid_key_dx with a specified shift. | |
template<typename check = NoCheck, typename ids_type > | |
mem_id | LinId (const grid_key_dx< N, ids_type > &gk, const signed char sum_id[N], const size_t(&bc)[N]) const |
Linearization of the grid_key_dx with a specified shift. | |
mem_id | LinIdPtr (size_t *k) const |
Linearization of the set of indexes. | |
__device__ __host__ mem_id | LinId (const size_t(&k)[N]) const |
Linearization of the grid_key_dx. | |
template<typename ids_type > | |
__device__ __host__ mem_id | LinId (const grid_key_dx< N, ids_type > &gk) const |
Linearization of the grid_key_dx. | |
template<typename a , typename ... lT, typename enabler = typename std::enable_if<sizeof...(lT) == N-1>::type> | |
__device__ __host__ mem_id | Lin (a v, lT...t) const |
linearize an arbitrary set of index | |
__device__ __host__ grid_key_dx< N > | InvLinId (mem_id id) const |
Construct. | |
mem_id | LinId (mem_id *id) const |
Linearization of an array of mem_id (long int) | |
__device__ __host__ | ~grid_sm () |
Destructor. | |
__device__ __host__ size_t | size () const |
Return the size of the grid. | |
__device__ __host__ grid_sm< N, T > & | operator= (const grid_sm< N, T > &g) |
Copy the grid from another grid. | |
bool | operator== (const grid_sm< N, T > &g) |
Check if the two grid_sm are the same. | |
bool | operator!= (const grid_sm< N, T > &g) |
Check if the two grid_sm are the same. | |
__device__ __host__ size_t | size_s (unsigned int i) const |
__device__ __host__ size_t | size (unsigned int i) const |
__device__ __host__ const size_t(& | getSize () const)[N] |
Return the size of the grid as an array. | |
__device__ __host__ void | getSize (size_t(&size)[N]) const |
Returns the size of the grid in the passed array. | |
grid_key_dx_iterator_sub< N > | getSubIterator (const grid_key_dx< N > &start, const grid_key_dx< N > &stop) const |
Return a sub-grid iterator. | |
void | swap (grid_sm< N, T > &g) |
swap the grid_sm informations | |
std::string | toString () const |
Produce a string from the object. | |
Private Member Functions | |
__device__ __host__ void | Initialize (const size_t sz) |
Initialize the basic structure. | |
__device__ __host__ void | Initialize (const size_t(&sz)[N]) |
Initialize the basic structure. | |
void | Initialize () |
Initialize the basic structure. | |
template<typename a , typename ... lT> | |
__device__ __host__ mem_id | Lin_impl (a v, lT...t) const |
linearize an arbitrary set of index | |
template<typename a > | |
__device__ __host__ mem_id | Lin_impl (a v) const |
Linearize a set of index. | |
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 338 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 357 of file grid_sm.hpp.
|
inline |
copy constructor
g | grid info |
construct a grid from another grid. As a copy constructor can't be template, the one above won't work for const grid_sm<N,S> & g, where S=T
Definition at line 376 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 424 of file grid_sm.hpp.
|
inline |
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 438 of file grid_sm.hpp.
Destructor.
Definition at line 648 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 308 of file grid_sm.hpp.
|
inline |
Return the size of the grid as an array.
Definition at line 760 of file grid_sm.hpp.
|
inline |
Returns the size of the grid in the passed array.
Definition at line 770 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 783 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 248 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 189 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 220 of file grid_sm.hpp.
|
inline |
Construct.
inversion of the linearization of the grid_key_dx
id | of the object |
Definition at line 609 of file grid_sm.hpp.
|
inline |
linearize an arbitrary set of index
linearize an arbitrary set of index
Definition at line 596 of file grid_sm.hpp.
|
inlineprivate |
Linearize a set of index.
Definition at line 281 of file grid_sm.hpp.
|
inlineprivate |
linearize an arbitrary set of index
linearize an arbitrary set of index
Definition at line 275 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 578 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 454 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 490 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 557 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 635 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 537 of file grid_sm.hpp.
|
inline |
Check if the two grid_sm are the same.
g | element to check |
Definition at line 720 of file grid_sm.hpp.
|
inline |
Copy the grid from another grid.
g | grid from witch to copy |
Definition at line 668 of file grid_sm.hpp.
|
inline |
Check if the two grid_sm are the same.
g | element to check |
Definition at line 691 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 326 of file grid_sm.hpp.
|
inline |
Return the size of the grid.
Return the size of the grid
Definition at line 657 of file grid_sm.hpp.
|
inline |
Get the size of the grid on the direction i
i | direction |
Definition at line 750 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 736 of file grid_sm.hpp.
|
inline |
|
inline |
Definition at line 389 of file grid_sm.hpp.
|
inline |
Definition at line 403 of file grid_sm.hpp.
|
friend |
It simply mean that all the classes grid are friend of all its specialization.
Definition at line 863 of file grid_sm.hpp.
Box enclosing the grid.
Definition at line 169 of file grid_sm.hpp.
|
private |
total number of the elements in the grid
Definition at line 172 of file grid_sm.hpp.
|
private |
size of the grid
Definition at line 175 of file grid_sm.hpp.
|
private |
size of the grid on each stride (used for linearization)
Definition at line 178 of file grid_sm.hpp.