This is an N-dimensional grid or an N-dimensional array with memory_traits_lin layout. More...
This is an N-dimensional grid or an N-dimensional array with memory_traits_lin layout.
it is basically an N-dimensional Cartesian grid
dim | Dimensionality of the grid |
T | type of object the grid store |
S | type of memory HeapMemory CudaMemory |
layout | memory layout |
Definition at line 102 of file map_grid.hpp.
#include <map_grid.hpp>
Public Types | |
typedef memory_traits_lin< T > ::type | layout |
type of layout of the structure | |
typedef grid_base_impl< dim, T, S, typename memory_traits_lin < T >::type, memory_traits_lin > ::container | container |
Object container for T, it is the return type of get_o it return a object type trough. | |
Public Types inherited from grid_base_impl< dim, T, S, memory_traits_lin< T >::type, memory_traits_lin > | |
typedef memory_traits_lin< T > ::type | layout_type |
memory layout | |
typedef grid_key_dx< dim > | access_key |
Access key. | |
typedef T::type | T_type |
boost::vector that describe the data type | |
typedef int | yes_i_am_grid |
it define that it is a grid | |
typedef memory_traits_lin < typename T::type >::type | memory_lin |
Definition of the layout. | |
typedef encapc< dim, T, layout > | container |
Object container for T, it is the return type of get_o it return a object type trough. | |
typedef T | value_type |
The object type the grid is storing. | |
Public Member Functions | |
grid_cpu () THROW | |
Default constructor. | |
grid_cpu (const grid_cpu< dim, T, S, typename memory_traits_lin< T >::type > &g) THROW | |
create a grid from another grid More... | |
grid_cpu (const size_t &sz) THROW | |
create a grid of size sz on each direction More... | |
grid_cpu (const size_t(&sz)[dim]) THROW | |
Constructor allocate memory and give them a representation. | |
grid_cpu< dim, T, S, typename memory_traits_lin< T >::type > & | operator= (const grid_base_impl< dim, T, S, layout, memory_traits_lin > &g) |
It copy a grid. More... | |
grid_cpu< dim, T, S, typename memory_traits_lin< T >::type > & | operator= (grid_base_impl< dim, T, S, layout, memory_traits_lin > &&g) |
It copy a grid. More... | |
Public Member Functions inherited from grid_base_impl< dim, T, S, memory_traits_lin< T >::type, memory_traits_lin > | |
void | pack (ExtPreAlloc< S > &mem, Pack_stat &sts) const |
pack a grid selecting the properties to pack More... | |
void | pack (ExtPreAlloc< S > &mem, grid_key_dx_iterator_sub< dims > &sub_it, Pack_stat &sts) |
Pack the object into the memory given an iterator. More... | |
void | packRequest (size_t &req) const |
Insert an allocation request into the vector. More... | |
void | packRequest (grid_key_dx_iterator_sub< dims > &sub, size_t &req) |
Insert an allocation request. More... | |
void | unpack (ExtPreAlloc< S > &mem, Unpack_stat &ps) |
unpack a grid More... | |
void | unpack (ExtPreAlloc< S > &mem, grid_key_dx_iterator_sub< dims > &sub_it, Unpack_stat &ps) |
unpack the sub-grid object More... | |
grid_base_impl () THROW | |
Default constructor. | |
grid_base_impl (const grid_base_impl &g) THROW | |
create a grid from another grid More... | |
grid_base_impl (const size_t &sz) THROW | |
create a grid of size sz on each direction More... | |
grid_base_impl (const size_t(&sz)[dim]) THROW | |
Constructor. More... | |
~grid_base_impl () THROW | |
Destructor. | |
grid_base_impl< dim, T, S, layout, memory_traits_lin > & | operator= (const grid_base_impl< dim, T, S, layout, memory_traits_lin > &g) |
It copy a grid. More... | |
grid_base_impl< dim, T, S, layout, memory_traits_lin > & | operator= (grid_base_impl< dim, T, S, layout, memory_traits_lin > &&g) |
It copy a grid. More... | |
bool | operator== (const grid_base_impl< dim, T, S, layout, memory_traits_lin > &g) |
Compare two grids. More... | |
grid_base_impl< dim, T, S, layout, memory_traits_lin > | duplicate () const THROW |
create a duplicated version of the grid More... | |
const grid_sm< dim, T > & | getGrid () const |
Return the internal grid information. More... | |
void | setMemory () |
Create the object that provide memory. More... | |
void | setMemory (S &m) |
Get the object that provide memory. More... | |
void * | getPointer () |
Return a plain pointer to the internal data. More... | |
const void * | getPointer () const |
Return a plain pointer to the internal data. More... | |
r_type | get (const grid_key_dx< dim > &v1) |
Get the reference of the selected element. More... | |
const r_type | get (const grid_key_dx< dim > &v1) const |
Get the const reference of the selected element. More... | |
r_type | get (const size_t lin_id) |
Get the reference of the selected element. More... | |
const r_type | get (size_t lin_id) const |
Get the const reference of the selected element. More... | |
encapc< dim, T, layout > | get_o (const grid_key_dx< dim > &v1) |
Get the of the selected element as a boost::fusion::vector. More... | |
const encapc< dim, T, layout > | get_o (const grid_key_dx< dim > &v1) const |
Get the of the selected element as a boost::fusion::vector. More... | |
encapc< dim, T, layout > | get_o (size_t v1) |
Get the of the selected element as a boost::fusion::vector. More... | |
const encapc< dim, T, layout > | get_o (size_t v1) const |
Get the of the selected element as a boost::fusion::vector. More... | |
void | fill (unsigned char fl) |
Fill the memory with the selected byte. More... | |
void | resize (const size_t(&sz)[dim]) |
Resize the space. More... | |
void | remove (size_t key) |
Remove one element valid only on 1D. More... | |
void | swap (grid_base_impl< dim, T, S, layout, memory_traits_lin > &grid) |
It move the allocated object from one grid to another. More... | |
void | swap (grid_base_impl< dim, T, S, layout, memory_traits_lin > &&grid) |
It move the allocated object from one grid to another. More... | |
void | set (grid_key_dx< dim > dx, const encapc< 1, T, Memory > &obj) |
set an element of the grid More... | |
void | set (grid_key_dx< dim > dx, const T &obj) |
set an element of the grid More... | |
void | set (const grid_key_dx< dim > &key1, const grid_base_impl< dim, T, S, layout, memory_traits_lin > &g, const grid_key_dx< dim > &key2) |
Set an element of the grid from another element of another grid. More... | |
void | set (const size_t key1, const grid_base_impl< dim, T, S, layout, memory_traits_lin > &g, const size_t key2) |
Set an element of the grid from another element of another grid. More... | |
void | set (const grid_key_dx< dim > &key1, const grid_base_impl< dim, T, Mem, layout, memory_traits_lin > &g, const grid_key_dx< dim > &key2) |
Set an element of the grid from another element of another grid. More... | |
size_t | size () const |
return the size of the grid More... | |
grid_key_dx_iterator_sub< dim > | getSubIterator (grid_key_dx< dim > &start, grid_key_dx< dim > &stop) const |
Return a sub-grid iterator. More... | |
grid_key_dx_iterator_sub< dim > | getSubIterator (size_t m) |
Return a sub-grid iterator. More... | |
grid_key_dx_iterator< dim > | getIterator () const |
Return a grid iterator. More... | |
grid_key_dx_iterator_sub< dim > | getIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop) const |
Return a grid iterator over all points included between start and stop point. More... | |
grid_key_dx_iterator< dim, stencil_offset_compute< dim, Np > > | getIteratorStencil (const grid_key_dx< dim >(&stencil_pnt)[Np]) const |
Return a grid iterator. More... | |
long int | who () |
It return the id of structure in the allocation list. More... | |
Static Public Member Functions | |
static bool | noPointers () |
This structure has pointers. More... | |
Static Public Member Functions inherited from grid_base_impl< dim, T, S, memory_traits_lin< T >::type, memory_traits_lin > | |
static bool | pack () |
static bool | packRequest () |
static bool | packMem () |
static size_t | packMem (size_t n, size_t e) |
Calculate the memory size required to pack n elements. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from grid_base_impl< dim, T, S, memory_traits_lin< T >::type, memory_traits_lin > | |
static constexpr unsigned int | dims |
expose the dimansionality as a static const | |
Protected Attributes inherited from grid_base_impl< dim, T, S, memory_traits_lin< T >::type, memory_traits_lin > | |
layout | data_ |
Memory layout specification + memory chunk pointer. | |
grid_sm< dim, T > | g1 |
This is a structure that store all information related to the grid and how indexes are linearized. | |
|
inline |
create a grid from another grid
S | memory type for allocation |
g | the grid to copy |
mem | memory object (only used for template deduction) |
Definition at line 128 of file map_grid.hpp.
|
inline |
create a grid of size sz on each direction
S | memory type for allocation |
sz | size if the grid on each directions |
Definition at line 140 of file map_grid.hpp.
|
inlinestatic |
|
inline |
|
inline |