It is a class that work like a vector of vector. More...
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 88 of file MemFast.hpp.
#include <MemFast.hpp>
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 | |
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. | |
void | operator= (const Mem_fast< Memory, local_index > &mem) |
copy an object Mem_fast | |
void | operator= (Mem_fast< Memory, local_index > &&mem) |
copy an object Mem_fast | |
template<typename Memory2 > | |
void | copy_general (const Mem_fast< Memory2, local_index > &mem) |
copy an object Mem_fast | |
void | addCell (local_index cell_id, local_index ele) |
Add an element to the cell. | |
void | add (local_index cell_id, local_index ele) |
Add an element to the cell. | |
auto | get (local_index cell, local_index ele) -> decltype(cl_base.template get< 0 >(cell *slot+ele)) & |
Get an element in the cell. | |
auto | get (local_index cell, local_index ele) const -> decltype(cl_base.template get< 0 >(cell *slot+ele)) & |
Get an element in the cell. | |
void | remove (local_index cell, local_index ele) |
Remove an element in the cell. | |
size_t | getNelements (const local_index cell_id) const |
Get the number of elements in the cell. | |
void | swap (Mem_fast< Memory, local_index > &mem) |
swap to Mem_fast object | |
void | swap (Mem_fast< Memory, local_index > &&mem) |
swap to Mem_fast object | |
void | clear () |
Delete all the elements in the Cell-list. | |
const local_index & | getStartId (local_index cell_id) const |
Get the first element of a cell (as reference) | |
const local_index & | getStopId (local_index cell_id) const |
Get the last element of a cell (as reference) | |
const local_index & | get_lin (const local_index *part_id) const |
Just return the value pointed by part_id. | |
Mem_fast (local_index slot) | |
Constructor. | |
void | set_slot (local_index slot) |
Set the number of slot for each cell. | |
const openfpm::vector< aggregate< local_index >, Memory > & | private_get_cl_n () const |
Return the private data-structure cl_n. | |
const int & | private_get_slot () const |
Return the private slot. | |
const base & | private_get_cl_base () const |
Return the private data-structure cl_base. | |
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 | |
base | cl_base |
|
private |
base that store the data
Definition at line 97 of file MemFast.hpp.
typedef local_index Mem_fast< Memory, local_index >::loc_index |
expose the type of the local index
Definition at line 376 of file MemFast.hpp.
typedef local_index Mem_fast< Memory, local_index >::local_index_type |
Definition at line 132 of file MemFast.hpp.
typedef Mem_fast_ker<Memory,memory_traits_lin,local_index> Mem_fast< Memory, local_index >::toKernel_type |
Definition at line 130 of file MemFast.hpp.
|
inline |
Constructor.
slot | number of slot for each cell |
Definition at line 383 of file MemFast.hpp.
|
inline |
Add an element to the cell.
cell_id | id of the cell |
ele | element to add |
Definition at line 239 of file MemFast.hpp.
|
inline |
Add an element to the cell.
cell_id | id of the cell |
ele | element to add |
Definition at line 216 of file MemFast.hpp.
|
inline |
Delete all the elements in the Cell-list.
Definition at line 331 of file MemFast.hpp.
|
inline |
|
inline |
Destroy the internal memory including the retained one.
Definition at line 147 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 254 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 268 of file MemFast.hpp.
|
inline |
Just return the value pointed by part_id.
part_id |
Definition at line 368 of file MemFast.hpp.
|
inline |
Get the number of elements in the cell.
cell_id | id of the cell |
Definition at line 292 of file MemFast.hpp.
|
inline |
Get the first element of a cell (as reference)
cell_id | cell-id |
Definition at line 344 of file MemFast.hpp.
|
inline |
Get the last element of a cell (as reference)
cell_id | cell-id |
Definition at line 356 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 159 of file MemFast.hpp.
|
inline |
Return the private data-structure cl_base.
Definition at line 444 of file MemFast.hpp.
|
inline |
|
inline |
|
inlineprivate |
realloc the data structures
Definition at line 107 of file MemFast.hpp.
|
inline |
Remove an element in the cell.
cell | id of the cell |
ele | element id to remove |
Definition at line 280 of file MemFast.hpp.
|
inline |
Set the number of slot for each cell.
number | of slot |
Definition at line 392 of file MemFast.hpp.
|
inline |
return the number of elements
Definition at line 139 of file MemFast.hpp.
|
inline |
swap to Mem_fast object
mem | object to swap the memory with |
Definition at line 318 of file MemFast.hpp.
|
inline |
swap to Mem_fast object
mem | object to swap the memory with |
Definition at line 303 of file MemFast.hpp.
|
private |
elements that each cell store (each cell can store a number of elements == slot )
Definition at line 101 of file MemFast.hpp.
|
private |
number of particle in each cell list
Definition at line 94 of file MemFast.hpp.
|
private |
Number of slot for each cell.
Definition at line 91 of file MemFast.hpp.