It is a class that work like a vector of vector. More...
#include <MemFast.hpp>
Inheritance diagram for Mem_fast< Memory, local_index >:Public Types | |
| typedef Mem_fast_ker< Memory, memory_traits_lin, local_index > | toKernel_type |
| typedef local_index | local_index_type |
| typedef local_index | loc_index |
| expose the type of the local index | |
Public Member Functions | |
| size_t | size () const |
| return the number of elements More... | |
| void | destroy () |
| Destroy the internal memory including the retained one. | |
| void | init_to_zero (local_index slot, local_index tot_n_cell) |
| Initialize the data to zero. More... | |
| void | operator= (const Mem_fast< Memory, local_index > &mem) |
| copy an object Mem_fast More... | |
| void | operator= (Mem_fast< Memory, local_index > &&mem) |
| copy an object Mem_fast More... | |
| template<typename Memory2 > | |
| void | copy_general (const Mem_fast< Memory2, local_index > &mem) |
| copy an object Mem_fast More... | |
| void | addCellGhostMarkers () |
| Add ghost marker to the cell. More... | |
| size_t | getGhostMarker (local_index cell_id) const |
| Get ghost marker of the cell. | |
| void | addCell (local_index cell_id, local_index ele) |
| Add an element to the cell. More... | |
| auto | get (local_index cell, local_index ele) -> decltype(cl_base.template get< 0 >(cell *slot+ele)) & |
| Get an element in the cell. More... | |
| auto | get (local_index cell, local_index ele) const -> decltype(cl_base.template get< 0 >(cell *slot+ele)) & |
| Get an element in the cell. More... | |
| void | remove (local_index cell_id, local_index ele) |
| Remove an element in the cell. More... | |
| size_t | getNelements (const local_index cell_id) const |
| Get the number of elements in the cell. More... | |
| void | swap (Mem_fast< Memory, local_index > &mem) |
| swap to Mem_fast object More... | |
| void | swap (Mem_fast< Memory, local_index > &&mem) |
| swap to Mem_fast object More... | |
| void | clear () |
| Delete all the elements in every cell. | |
| void | clear (local_index cell_id) |
| Delete cell elements in Cell p. | |
| const local_index & | getStartId (local_index cell_id) const |
| Get the first element of a cell (as reference) More... | |
| const local_index & | getGhostId (local_index cell_id) const |
| Get the index of the first ghost element. More... | |
| const local_index & | getStopId (local_index cell_id) const |
| Get the last element of a cell (as reference) More... | |
| const local_index & | get_lin (const local_index *part_id) const |
| Just return the value pointed by part_id. More... | |
| Mem_fast (local_index slot) | |
| Constructor. More... | |
| void | set_slot (local_index slot) |
| Set the number of slot for each cell. More... | |
| const openfpm::vector< aggregate< local_index >, Memory > & | private_get_cl_n () const |
| Return the private data-structure cl_n. More... | |
| const openfpm::vector< size_t > & | getGhostMarkers () const |
| Return the private data-structure ghostMarkers. More... | |
| const int & | private_get_slot () const |
| Return the private slot. More... | |
| const base & | private_get_cl_base () const |
| Return the private data-structure cl_base. More... | |
| template<int ... prp> | |
| void | packRequest (size_t &req) const |
| It calculate the number of byte required to serialize the object. More... | |
| template<int ... prp> | |
| void | pack (ExtPreAlloc< HeapMemory > &mem, Pack_stat &sts) const |
| pack a vector selecting the properties to pack More... | |
| template<int ... prp, typename MemType > | |
| void | unpack (ExtPreAlloc< MemType > &mem, Unpack_stat &ps) |
| unpack a vector More... | |
Static Public Member Functions | |
| static bool | pack () |
| static bool | packRequest () |
Private Types | |
| typedef openfpm::vector< aggregate< local_index >, Memory > | base |
| base that store the data | |
Private Member Functions | |
| void | realloc () |
| realloc the data structures | |
Private Attributes | |
| local_index | slot |
| Number of slot for each cell. | |
| openfpm::vector< aggregate< local_index >, Memory > | cl_n |
| number of particle in each cell list | |
| openfpm::vector< size_t > | ghostMarkers |
| ghost marker for every cell (non-ghost particles < gm (ghost marker)) | |
| base | cl_base |
It is a class that work like a vector of vector.
| local_index | type used for the local index |
It is a class that work like a vector(1) of vector(2). To emulate the vector of vector it use a 1D array of size N_ele * N_max_slot where N_ele is the number of elements in vector(1) and N_max_slot is the maximum number of elements across the vectors
Definition at line 87 of file MemFast.hpp.
|
inline |
Constructor.
| slot | number of slot for each cell |
Definition at line 433 of file MemFast.hpp.
|
inline |
Add an element to the cell.
| cell_id | id of the cell |
| ele | element to add |
Definition at line 248 of file MemFast.hpp.
|
inline |
Add ghost marker to the cell.
| cell_id | id of the cell |
| g_m | ghost marker to add |
Definition at line 224 of file MemFast.hpp.
|
inline |
|
inline |
Get an element in the cell.
| cell | id of the cell |
| ele | element id in the cell |
Definition at line 273 of file MemFast.hpp.
|
inline |
Get an element in the cell.
| cell | id of the cell |
| ele | element id in the cell |
Definition at line 287 of file MemFast.hpp.
|
inline |
Just return the value pointed by part_id.
| part_id |
Definition at line 418 of file MemFast.hpp.
|
inline |
Get the index of the first ghost element.
| cell_id | cell-id |
Definition at line 394 of file MemFast.hpp.
|
inline |
Return the private data-structure ghostMarkers.
Definition at line 484 of file MemFast.hpp.
|
inline |
Get the number of elements in the cell.
| cell_id | id of the cell |
Definition at line 315 of file MemFast.hpp.
|
inline |
Get the first element of a cell (as reference)
| cell_id | cell-id |
Definition at line 382 of file MemFast.hpp.
|
inline |
Get the last element of a cell (as reference)
| cell_id | cell-id |
Definition at line 406 of file MemFast.hpp.
|
inline |
Initialize the data to zero.
| slot | number of slot for each cell |
| tot_n_cell | total number of cells |
Definition at line 162 of file MemFast.hpp.
|
inlinestatic |
This Function to indicate the vector class has a packer function
Definition at line 514 of file MemFast.hpp.
|
inline |
pack a vector selecting the properties to pack
| mem | preallocated memory where to pack the vector |
| sts | pack-stat info |
Definition at line 551 of file MemFast.hpp.
|
inlinestatic |
This Function indicate that vector class has a packRequest function
Definition at line 524 of file MemFast.hpp.
|
inline |
It calculate the number of byte required to serialize the object.
| prp | list of properties |
| req | reference to the total counter required to pack the information |
Definition at line 536 of file MemFast.hpp.
|
inline |
Return the private data-structure cl_base.
Definition at line 504 of file MemFast.hpp.
|
inline |
|
inline |
|
inline |
Remove an element in the cell.
| cell | id of the cell |
| ele | element id to remove |
Definition at line 298 of file MemFast.hpp.
|
inline |
Set the number of slot for each cell.
| number | of slot |
Definition at line 442 of file MemFast.hpp.
|
inline |
return the number of elements
Definition at line 141 of file MemFast.hpp.
|
inline |
swap to Mem_fast object
| mem | object to swap the memory with |
Definition at line 342 of file MemFast.hpp.
|
inline |
swap to Mem_fast object
| mem | object to swap the memory with |
Definition at line 326 of file MemFast.hpp.
|
inline |
unpack a vector
| mem | preallocated memory from where to unpack the vector |
| ps | unpack-stat info |
Definition at line 564 of file MemFast.hpp.
|
private |
elements that each cell store (each cell can store a number of elements == slot )
Definition at line 103 of file MemFast.hpp.