Implementation of 1-D std::vector like structure. More...
Implementation of 1-D std::vector like structure.
The layout is memory_traits_lin
T | type of object the vector store |
Memory | allocator to use |
layout | layout to use |
grow_p | grow policy for vector in case of reallocation |
OPENFPM_NATIVE implementation
Definition at line 241 of file map_vector.hpp.
#include <map_vector.hpp>
Data Structures | |
struct | layout_base__ |
struct | pack_cond |
Structures that do a nested packing, depending on the existence of 'pack()' function inside the object. More... | |
struct | pack_cond< true, T1, Memory1, prp... > |
Structures that do a nested packing, depending on the existence of 'pack()' function inside the object. More... | |
struct | pack_simple_cond |
These structures serialize a simple (no "pack()" inside) object. More... | |
struct | pack_simple_cond< true, prp ... > |
These structures serialize a simple (no "pack()" inside) object. More... | |
struct | packMem_cond |
Structures that calculate how many bytes are required to serialize an object. More... | |
struct | packMem_cond< true, T1 > |
Structures that calculate memory for an object, depending on the existence of 'packMem()'. More... | |
struct | unpack_simple_cond |
These structures do an de-serialize a simple object (no pack() inside) More... | |
struct | unpack_simple_cond< true, prp ... > |
Public Types | |
typedef int | yes_i_am_vector |
it define that it is a vector | |
typedef int | yes_i_am_vector_native |
it define that it is a vector | |
typedef layout_base< T >::type | layout_type |
Type of the encapsulation memory parameter. | |
typedef layout_base< T > | layout_base_ |
Type of the encapsulation memory parameter. | |
typedef vector_key_iterator | iterator_key |
iterator for the vector | |
typedef grid_base< 1, T, Memory, typename layout_base< T >::type >::container | container |
Object container for T, it is the return type of get_o it return a object type trough. | |
typedef T | value_type |
Type of the value the vector is storing. | |
typedef Memory | Memory_type |
Type of memory this vector use. | |
typedef grow_p | grow_policy |
growing policy of this vector | |
typedef size_t | access_key |
Access key for the vector. | |
Public Member Functions | |
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... | |
size_t | size () const |
Return the size of the vector. More... | |
size_t | size_local () const |
Return the size of the vector. More... | |
size_t | capacity () |
return the maximum capacity of the vector before reallocation More... | |
void | reserve (size_t sp) |
Reserve slots in the vector to avoid reallocation. More... | |
void | clear () |
Clear the vector. More... | |
void | shrink_to_fit () |
Clear the vector. More... | |
void | resize (size_t slot, size_t opt=DATA_ON_DEVICE|DATA_ON_HOST, unsigned int blockSize=1) |
Resize the vector. More... | |
void | resize_no_device (size_t slot) |
Resize the vector () More... | |
void | add () |
It insert a new emtpy object on the vector, eventually it reallocate the grid. More... | |
void | add_no_device () |
It insert a new emtpy object on the vector, eventually it reallocate the grid. More... | |
void | add (const T &v) |
It insert a new object on the vector, eventually it reallocate the grid. More... | |
void | add (const typename grid_base< 1, T, Memory, typename layout_base< T >::type >::container &v) |
It insert a new object on the vector, eventually it reallocate the vector. More... | |
template<typename M , typename gp > | |
void | add (const vector< T, M, layout_base, gp, OPENFPM_NATIVE > &v) |
It add the element of another vector to this vector. More... | |
template<template< typename, typename > class op, typename S , typename M , typename gp , unsigned int ... args> | |
void | merge_prp (const vector< S, M, layout_base, gp, OPENFPM_NATIVE > &v, const openfpm::vector< size_t > &opart) |
It merge the elements of a source vector to this vector. More... | |
template<template< typename, typename > class op, typename S , typename M , typename gp , unsigned int ... args> | |
void | merge_prp_device (const vector< S, M, layout_base, gp, OPENFPM_NATIVE > &v, unsigned int start) |
It merge the elements of a source vector to this vector (on device) More... | |
template<template< typename, typename > class op, typename S , typename M , typename gp , template< typename > class layout_base2, typename vector_opart_type , unsigned int ... args> | |
void | merge_prp_v (const vector< S, M, layout_base2, gp, OPENFPM_NATIVE > &v, const vector_opart_type &opart) |
It merge the elements of a source vector to this vector. More... | |
template<template< typename, typename > class op, typename S , typename M , typename gp , template< typename > class layout_base2, typename vector_opart_type , unsigned int ... args> | |
void | merge_prp_v (const vector< S, M, layout_base2, gp, OPENFPM_NATIVE > &v, unsigned int offset, const vector_opart_type &opart) |
It merge the elements of a source vector to this vector. More... | |
template<template< typename, typename > class op, typename S , typename M , typename gp , template< typename > class layout_base2, typename vector_opart_type , unsigned int ... args> | |
void | merge_prp_v_device (const vector< S, M, layout_base2, gp, OPENFPM_NATIVE > &v, const vector_opart_type &opart, unsigned int start, unsigned int stop) |
It merge the elements of a source vector to this vector. More... | |
template<template< typename, typename > class op, typename S , typename M , typename gp , template< typename > class layout_base2, typename vector_opart_type , unsigned int ... args> | |
void | merge_prp_v_device (const vector< S, M, layout_base2, gp, OPENFPM_NATIVE > &v, unsigned int start, const vector_opart_type &opart) |
It merge the elements of a source vector to this vector. More... | |
template<template< typename, typename > class op, typename S , typename M , typename gp , template< typename > class layout_base2, unsigned int ... args> | |
void | merge_prp_v (const vector< S, M, layout_base2, gp, OPENFPM_NATIVE > &v, size_t start) |
It merge the elements of a source vector to this vector. More... | |
template<typename S , typename M , typename gp , unsigned int impl, template< typename > class layout_base2, unsigned int ... args> | |
void | add_prp (const vector< S, M, layout_base2, gp, impl > &v) |
It add the element of a source vector to this vector. More... | |
template<typename S , typename M , typename gp , unsigned int impl, template< typename > class layout_base2, unsigned int ... args> | |
void | add_prp_device (const vector< S, M, layout_base2, gp, impl > &v) |
It add the element of a source vector to this vector. More... | |
void | insert (size_t key) |
Insert an entry in the vector. More... | |
void | remove (size_t key) |
Remove one entry from the vector. More... | |
void | remove (openfpm::vector< size_t > &keys, size_t start=0) |
Remove several entries from the vector. More... | |
void | remove (openfpm::vector< aggregate< int >> &keys, size_t start=0) |
Remove several entries from the vector. More... | |
template<unsigned int p> | |
auto | get (size_t id) const -> decltype(base.template get< p >(grid_key_dx< 1 >(0))) |
Get an element of the vector. More... | |
bool | isSubset () const |
Indicate that this class is not a subset. More... | |
auto | get (size_t id) -> decltype(base.get_o(grid_key_dx< 1 >(id))) |
Get an element of the vector. More... | |
const grid_base< 1, T, Memory, typename layout_base< T >::type >::container | get_o (size_t id) const |
Get an element of the vector. More... | |
template<unsigned int id> | |
void | fill (unsigned char c) |
Fill the buffer with a byte. More... | |
template<unsigned int id> | |
void * | getDeviceBufferCopy () |
It return the properties arrays. More... | |
template<unsigned int id> | |
void * | getDeviceBuffer () |
It return the properties arrays. More... | |
const grid_base< 1, T, Memory, layout_type >::container | last () const |
Get the last element of the vector. More... | |
template<unsigned int p, typename KeyType > | |
auto | getProp (const KeyType &id) -> decltype(base.template get< p >(grid_key_dx< 1 >(0))) |
Get an element of the vector. More... | |
template<unsigned int p, typename keyType > | |
auto | getProp (const keyType &id) const -> decltype(base.template get< p >(grid_key_dx< 1 >(0))) |
Get an element of the vector. More... | |
template<unsigned int p> | |
auto | get (size_t id) -> decltype(base.template get< p >(grid_key_dx< 1 >(0))) |
Get an element of the vector. More... | |
auto | get (size_t id) const -> const decltype(base.get_o(grid_key_dx< 1 >(id))) |
Get an element of the vector. More... | |
grid_base< 1, T, Memory, typename layout_base< T >::type >::container | last () |
Get the last element of the vector. More... | |
~vector () THROW | |
Destructor. | |
vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > | duplicate () const |
It duplicate the vector. More... | |
vector (vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &&v) | |
Constructor from another temporal vector. More... | |
vector (const vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) THROW | |
Constructor from another constant vector. More... | |
vector () THROW | |
Constructor, vector of size 0. | |
vector (size_t sz) THROW | |
Constructor, vector of size sz. | |
void | set (size_t id, const typename grid_base< 1, T, Memory, typename layout_base< T >::type >::container &obj) |
Set the object id to obj. More... | |
template<typename encap_S , unsigned int ... args> | |
void | set_o (size_t i, const encap_S &obj) |
It set an element of the vector from a object that is a subset of the vector properties. More... | |
void | set (size_t id, const T &obj) |
Set the object id to obj. More... | |
void | set (size_t id, vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v, size_t src) |
Set the element of the vector v from another element of another vector. More... | |
template<typename key_type > | |
key_type | getOriginKey (key_type vec_key) |
vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > & | operator= (vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &&mv) |
Assignment operator. More... | |
vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > & | operator= (const vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &mv) |
Assignment operator. More... | |
template<typename Mem , typename gp > | |
vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > & | operator= (vector< T, Mem, layout_base, gp, OPENFPM_NATIVE > &&mv) |
Assignment operator. More... | |
template<typename Mem , typename gp > | |
vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > & | operator= (const vector< T, Mem, layout_base, gp, OPENFPM_NATIVE > &mv) |
Assignment operator. More... | |
template<typename Mem , template< typename > class layout_base2> | |
vector< T, Memory, layout_base2, grow_p, OPENFPM_NATIVE > & | operator= (vector< T, Mem, layout_base2, grow_p, OPENFPM_NATIVE > &&mv) |
Assignment operator. More... | |
template<typename Mem , template< typename > class layout_base2, typename check = typename std::enable_if<!std::is_same<typename layout_base2<T>::type,typename layout_base<T>::type>::value >::type> | |
vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > & | operator= (const vector< T, Mem, layout_base2, grow_p, OPENFPM_NATIVE > &mv) |
Assignment operator. More... | |
bool | operator!= (const vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) const |
Check that two vectors are equal. More... | |
bool | operator== (const vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) const |
Check that two vectors are not equal. More... | |
void | swap_nomode (openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) |
Swap the memory with another vector. More... | |
void | swap (openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) |
Swap the memory with another vector. More... | |
void | swap (openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &&v) |
Swap the memory with another vector. More... | |
vector_key_iterator | getIteratorFrom (size_t start) const |
Get iterator over the particles from a particular index. More... | |
vector_key_iterator | getIteratorTo (size_t stop) const |
Get iterator over the particles from 0 until a particular index. More... | |
vector_key_iterator | getDomainIterator () const |
Get the vector elements iterator. More... | |
vector_key_iterator | getIterator () const |
Get the vector elements iterator. More... | |
template<unsigned int p> | |
vector_key_iterator_ele< p, self_type > | getIteratorElements () const |
Get the vector elements iterator. More... | |
size_t | packObjectSize () |
Return the size of the message needed to pack this object. More... | |
size_t | packObject (void *mem) |
Pack the object into the given pointer. More... | |
template<unsigned int p> | |
auto | getMemory () -> decltype(base.template getMemory< p >()) |
Return the memory object. More... | |
template<unsigned int p = 0> | |
void | setMemory (Memory &mem) |
Set the memory of the base structure using an object. More... | |
void | setMemoryArray (Memory *mem) |
Set the memory of the base structure using an object. More... | |
template<unsigned int p = 0> | |
void * | getPointer () |
Return the pointer that store the data. More... | |
template<unsigned int p = 0> | |
const void * | getPointer () const |
Return the pointer that store the data. More... | |
const size_t & | getInternal_v_size () const |
Internal function. More... | |
const grid_base< 1, T, Memory, layout_type > & | getInternal_base () const |
Internal function. More... | |
template<unsigned int ... prp> | |
void | hostToDevice () |
Copy the memory from host to device. More... | |
template<unsigned int ... prp> | |
void | deviceToHost () |
Synchronize the memory buffer in the device with the memory in the host. More... | |
template<unsigned int ... prp> | |
void | deviceToHost (size_t start, size_t stop) |
Synchronize the memory buffer in the device with the memory in the host. More... | |
template<unsigned int ... prp> | |
void | hostToDevice (size_t start, size_t stop) |
Synchronize the memory buffer in the device with the memory in the host. More... | |
template<unsigned int ... prp> | |
void | hostToDeviceNUMA (size_t start, size_t stop) |
Synchronize the memory buffer in the device with the memory in the host respecting NUMA domains. More... | |
template<unsigned int ... prp> | |
void | hostToDeviceNUMA () |
Synchronize the memory buffer in the device with the memory in the host respecing NUMA domains. More... | |
vector_gpu_ker< typename apply_transform< layout_base, T >::type, layout_base > | toKernel () |
Convert the grid into a data-structure compatible for computing into GPU. More... | |
const vector_gpu_ker< typename apply_transform< layout_base, T >::type, layout_base > | toKernel () const |
Convert the grid into a data-structure compatible for computing into GPU. More... | |
template<unsigned int ... prps> | |
const std::string | toString (std::string prefix=std::string()) |
void * | internal_get_size_pointer () |
void | print_size () |
Static Public Member Functions | |
static bool | pack () |
static bool | packRequest () |
static bool | packMem () |
template<int ... prp> | |
static size_t | calculateMem (size_t n, size_t e) |
Calculate the memory size required to allocate n elements. More... | |
template<int ... prp> | |
static size_t | packMem (size_t n, size_t e) |
Calculate the memory size required to pack n elements. More... | |
static size_t | calculateNMem (size_t n) |
How many allocation are required to create n-elements. More... | |
static bool | noPointers () |
This class has pointer inside. More... | |
Private Types | |
typedef vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > | self_type |
Private Member Functions | |
void | non_zero_one (size_t sz[1], size_t arg) |
If the argument is zero return 1 otherwise return the argument. More... | |
Private Attributes | |
size_t | v_size |
grid_base< 1, T, Memory, typename layout_base< T >::type > | base |
1-D static grid | |
|
inline |
Constructor from another temporal vector.
v | the vector |
Definition at line 1487 of file map_vector.hpp.
|
inline |
Constructor from another constant vector.
v | the vector |
Definition at line 1504 of file map_vector.hpp.
|
inline |
It insert a new emtpy object on the vector, eventually it reallocate the grid.
Check if we have enough space
Resize the memory, double up the actual memory allocated for the vector
increase the vector size
Definition at line 490 of file map_vector.hpp.
|
inline |
It insert a new object on the vector, eventually it reallocate the grid.
v | element to add |
Check if we have enough space
Resize the memory, double up the actual memory allocated for the vector
copy the element
increase the vector size
Definition at line 548 of file map_vector.hpp.
|
inline |
It insert a new object on the vector, eventually it reallocate the vector.
v | object (encapsulated) |
Check if we have enough space
Resize the memory, double up the actual memory allocated for the vector
copy the added element
increase the vector size
Definition at line 582 of file map_vector.hpp.
|
inline |
It add the element of another vector to this vector.
v | from where to take the vector |
Add the element of v
Definition at line 612 of file map_vector.hpp.
|
inline |
It insert a new emtpy object on the vector, eventually it reallocate the grid.
Check if we have enough space
Resize the memory, double up the actual memory allocated for the vector
increase the vector size
Definition at line 518 of file map_vector.hpp.
|
inline |
It add the element of a source vector to this vector.
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
S | Base object of the source vector |
M | memory type of the source vector |
gp | Grow policy of the source vector |
args | one or more number that define which property to set-up |
v | source vector |
Add the element of v
Definition at line 1074 of file map_vector.hpp.
|
inline |
It add the element of a source vector to this vector.
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
S | Base object of the source vector |
M | memory type of the source vector |
gp | Grow policy of the source vector |
args | one or more number that define which property to set-up |
v | source vector |
Definition at line 1107 of file map_vector.hpp.
|
inlinestatic |
Calculate the memory size required to allocate n elements.
Calculate the total size required to store n-elements in a vector
n | number of elements |
e | unused |
Definition at line 2025 of file map_vector.hpp.
|
inlinestatic |
How many allocation are required to create n-elements.
n | number of elements |
Definition at line 2069 of file map_vector.hpp.
|
inline |
return the maximum capacity of the vector before reallocation
Definition at line 351 of file map_vector.hpp.
|
inline |
Clear the vector.
Eliminate all the elements for from the vector
Definition at line 385 of file map_vector.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host.
Definition at line 2184 of file map_vector.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host.
Definition at line 2194 of file map_vector.hpp.
|
inline |
|
inline |
Fill the buffer with a byte.
c | char to fill the buffer with |
Definition at line 1321 of file map_vector.hpp.
|
inline |
Get an element of the vector.
Get an element of the vector
p | Property to get |
id | Element to get |
Definition at line 1254 of file map_vector.hpp.
|
inline |
Get an element of the vector.
Get an element of the vector
id | Element to get |
Definition at line 1284 of file map_vector.hpp.
|
inline |
Get an element of the vector.
Get an element of the vector
p | Property to get |
id | Element to get |
Definition at line 1408 of file map_vector.hpp.
|
inline |
Get an element of the vector.
Get an element of the vector
id | Element to get |
Definition at line 1427 of file map_vector.hpp.
|
inline |
Get an element of the vector.
exactly as get, exist to keep the compatibility with grid
id | Element to get |
Definition at line 1306 of file map_vector.hpp.
|
inline |
It return the properties arrays.
In case of Cuda memory it return the device pointers to pass to the kernels
This variant does not copy the host memory to the device memory
Definition at line 1345 of file map_vector.hpp.
|
inline |
It return the properties arrays.
In case of Cuda memory it return the device pointers to pass to the kernels
Definition at line 1332 of file map_vector.hpp.
|
inline |
Get the vector elements iterator.
Definition at line 1942 of file map_vector.hpp.
|
inline |
|
inline |
|
inline |
Get the vector elements iterator.
Definition at line 1957 of file map_vector.hpp.
|
inline |
Get the vector elements iterator.
Definition at line 1969 of file map_vector.hpp.
|
inline |
Get iterator over the particles from a particular index.
start | starting point |
Definition at line 1900 of file map_vector.hpp.
|
inline |
Get iterator over the particles from 0 until a particular index.
stop | stop point |
Definition at line 1914 of file map_vector.hpp.
|
inline |
Return the memory object.
Return the memory object
p | array to retrieve |
Definition at line 2082 of file map_vector.hpp.
|
inline |
Return the pointer that store the data.
property | from which take the pointer |
Definition at line 2126 of file map_vector.hpp.
|
inline |
Return the pointer that store the data.
Definition at line 2136 of file map_vector.hpp.
|
inline |
Get an element of the vector.
Get an element of the vector
p | Property to get |
id | Element to get |
Definition at line 1375 of file map_vector.hpp.
|
inline |
Get an element of the vector.
Get an element of the vector
p | Property to get |
id | Element to get |
Definition at line 1391 of file map_vector.hpp.
|
inline |
Copy the memory from host to device.
Definition at line 2175 of file map_vector.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host.
Definition at line 2203 of file map_vector.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host respecting NUMA domains.
Definition at line 2212 of file map_vector.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host respecing NUMA domains.
Definition at line 2221 of file map_vector.hpp.
|
inline |
Insert an entry in the vector.
\size_t key Where to insert the element
Definition at line 1118 of file map_vector.hpp.
|
inline |
Indicate that this class is not a subset.
Definition at line 1270 of file map_vector.hpp.
|
inline |
Get the last element of the vector.
Definition at line 1356 of file map_vector.hpp.
|
inline |
Get the last element of the vector.
Definition at line 1446 of file map_vector.hpp.
|
inline |
It merge the elements of a source vector to this vector.
Given 2 vector v1 and v2 of size 7,3. and as merging operation the function add. Merging the second vector v2 to the first one v1 starting from the element 2. Mean
* * 6 8 3 2 1 0 3 v1 elements * | | | * op op op * | | | * 5 1 9 v2 elements * *------------------------------------- * 6 8 8 3 10 0 3 updated v1 elements * * This operation is done for each selected property in args * *
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
op | merging operation |
S | Base object of the source vector |
M | memory type of the source vector |
gp | Grow policy of the source vector |
args | one or more number that define which property to set-up |
v | source vector |
start | index from where to start the merging |
Add the element of v
Definition at line 655 of file map_vector.hpp.
|
inline |
It merge the elements of a source vector to this vector (on device)
Given 2 vector v1 and v2 of size 7,3. and as merging operation the function add. Merging the second vector v2 to the first one v1 starting from the element 2. Mean
* * 6 8 3 2 1 0 3 v1 elements * | | | * op op op * | | | * 5 1 9 v2 elements * *------------------------------------- * 6 8 8 3 10 0 3 updated v1 elements * * This operation is done for each selected property in args * *
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
op | merging operation |
S | Base object of the source vector |
M | memory type of the source vector |
gp | Grow policy of the source vector |
args | one or more number that define which property to set-up |
v | source vector |
start | index from where to start the merging |
Definition at line 714 of file map_vector.hpp.
|
inline |
It merge the elements of a source vector to this vector.
Given 2 vector v1 and v2 of size 7,3. and as merging operation the function add. Merging the second vector v2 to the first one v1 starting from the element 2. Mean
\verbarim
6 8 3 2 1 0 3 v1 elements | | | op op op | | | 5 1 9 v2 elements
6 8 8 3 10 0 3 updated v1 elements
This operation is done for each selected property in args
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
op | merging operation |
S | Base object of the source vector |
M | memory type of the source vector |
gp | Grow policy of the source vector |
args | one or more number that define which property to set-up |
v | source vector |
start | index from where to start the merging |
Add the element of v
Definition at line 764 of file map_vector.hpp.
|
inline |
It merge the elements of a source vector to this vector.
Given 2 vector v1 and v2 of size 7,3. and as merging operation the function add. Merging the second vector v2 to the first one v1 starting from the element 2. Mean
\verbarim
6 8 3 2 1 0 3 v1 elements | | | op op op | | | 5 1 9 v2 elements
6 8 8 3 10 0 3 updated v1 elements
This operation is done for each selected property in args
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
op | merging operation |
S | Base object of the source vector |
M | memory type of the source vector |
gp | Grow policy of the source vector |
args | one or more number that define which property to set-up |
v | source vector |
offset | offset from where to copy in v |
start | index from where to start the merging |
Definition at line 830 of file map_vector.hpp.
|
inline |
It merge the elements of a source vector to this vector.
Given 2 vector v1 and v2 of size 7,3. and as merging operation the function add. Merging the second vector v2 to the first one v1 starting from the element 2. Mean
\verbarim
6 8 3 2 1 0 3 v1 elements | | | op op op | | | 5 1 9 v2 elements
6 8 8 3 10 0 3 updated v1 elements
This operation is done for each selected property in args
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
op | merging operation |
S | Base object of the source vector |
M | memory type of the source vector |
gp | Grow policy of the source vector |
args | one or more number that define which property to set-up |
v | source vector |
start | index from where to start the merging |
Add the element of v
Definition at line 1037 of file map_vector.hpp.
|
inline |
It merge the elements of a source vector to this vector.
Given 2 vector v1 and v2 of size 7,3. and as merging operation the function add. Merging the second vector v2 to the first one v1 starting from the element 2. Mean
\verbarim
6 8 3 2 1 0 3 v1 elements | | | op op op | | | 5 1 9 v2 elements
6 8 8 3 10 0 3 updated v1 elements
This operation is done for each selected property in args
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
op | merging operation |
S | Base object of the source vector |
M | memory type of the source vector |
gp | Grow policy of the source vector |
args | one or more number that define which property to set-up |
v | source vector |
opart | merging indexes (property 1) |
start | starting merging index for opart |
stop | stop merging index for opart |
Definition at line 891 of file map_vector.hpp.
|
inline |
It merge the elements of a source vector to this vector.
Given 2 vector v1 and v2 of size 7,3. and as merging operation the function add. Merging the second vector v2 to the first one v1 starting from the element 2. Mean
\verbarim
6 8 3 2 1 0 3 v1 elements | | | op op op | | | 5 1 9 v2 elements
6 8 8 3 10 0 3 updated v1 elements
This operation is done for each selected property in args
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
op | merging operation |
S | Base object of the source vector |
M | memory type of the source vector |
gp | Grow policy of the source vector |
args | one or more number that define which property to set-up |
v | source vector |
opart | merging indexes (property 0) |
i | starting mergong indexes |
Definition at line 967 of file map_vector.hpp.
|
inlineprivate |
If the argument is zero return 1 otherwise return the argument.
sz | output |
arg | argument |
Definition at line 259 of file map_vector.hpp.
|
inlinestatic |
|
inline |
Check that two vectors are equal.
vector | to compare |
Definition at line 1793 of file map_vector.hpp.
|
inline |
Assignment operator.
move semantic movement operator=
mv | vector |
Definition at line 1624 of file map_vector.hpp.
|
inline |
Assignment operator.
it copy
mv | vector |
Definition at line 1647 of file map_vector.hpp.
|
inline |
Assignment operator.
move semantic movement operator=
mv | vector |
Definition at line 1680 of file map_vector.hpp.
|
inline |
Assignment operator.
it copy
mv | vector |
Definition at line 1703 of file map_vector.hpp.
|
inline |
Assignment operator.
move semantic movement operator=
mv | vector |
Definition at line 1737 of file map_vector.hpp.
|
inline |
Assignment operator.
mv | vector to copy |
Definition at line 1764 of file map_vector.hpp.
|
inline |
Check that two vectors are not equal.
vector | to compare |
Definition at line 1803 of file map_vector.hpp.
|
inlinestatic |
This file contains the implemetation of packer and unpacker for vector Created on: Jan 5, 2016 Author: Yaroslav Zaluzhnyi and Pietro Incardona
This Function to indicate the vector class has a packer function
Definition at line 13 of file map_vector.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 315 of file map_vector.hpp.
|
inlinestatic |
This Function indicate that vector class has a packMem function
Definition at line 33 of file map_vector.hpp.
|
inlinestatic |
Calculate the memory size required to pack n elements.
Calculate the total size required to store n-elements in a vector
n | number of elements |
e | unused |
Definition at line 2052 of file map_vector.hpp.
|
inline |
Pack the object into the given pointer.
mem | pointer |
Definition at line 2010 of file map_vector.hpp.
|
inline |
Return the size of the message needed to pack this object.
Definition at line 1998 of file map_vector.hpp.
|
inlinestatic |
This Function indicate that vector class has a packRequest function
Definition at line 23 of file map_vector.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 286 of file map_vector.hpp.
|
inline |
Remove one entry from the vector.
key | element to remove |
Definition at line 1140 of file map_vector.hpp.
|
inline |
Remove several entries from the vector.
keys | objects id to remove |
start | key starting point |
Definition at line 1166 of file map_vector.hpp.
|
inline |
Remove several entries from the vector.
keys | objects id to remove |
start | key starting point |
Definition at line 1208 of file map_vector.hpp.
|
inline |
Reserve slots in the vector to avoid reallocation.
Reserve slots in the vector to avoid reallocation
sp | number of slot to reserve |
Resize the memory
Definition at line 364 of file map_vector.hpp.
|
inline |
Resize the vector.
Resize the vector and allocate n elements
opt | options for resize. In case we know that the data are only on device memory we can use DATA_ONLY_DEVICE, In case we know that the data are only on host memory we can use DATA_ONLY_HOST |
blockSize | The default is equal to 1. In case of accelerator buffer resize indicate the size of the block of threads ( this is used in case of a vector of blocks where the block object override to operator= to distribute threads on each block element ) |
Resize the memory
Definition at line 419 of file map_vector.hpp.
|
inline |
Resize the vector ()
Resize the vector and allocate n elements
slot | number of elements |
opt | options |
Resize the memory
Definition at line 458 of file map_vector.hpp.
|
inline |
Set the object id to obj.
id | element |
obj | object (encapsulated) |
copy the element
Definition at line 1548 of file map_vector.hpp.
|
inline |
Set the object id to obj.
id | |
obj |
copy the element
Definition at line 1584 of file map_vector.hpp.
|
inline |
Set the element of the vector v from another element of another vector.
id | element id |
v | vector source |
src | source element |
Definition at line 1600 of file map_vector.hpp.
|
inline |
It set an element of the vector from a object that is a subset of the vector properties.
The number of properties in the source vector must be smaller than the destination all the properties of S must be mapped so if S has 3 properties 3 numbers for args are required
encap_S | object that encapsulate the object |
args | ids of the properties to map the object to |
i | element to set |
obj | object that encapsulate the object |
v | source vector |
Definition at line 1572 of file map_vector.hpp.
|
inline |
Set the memory of the base structure using an object.
mem | Memory object to use for allocation |
Definition at line 2092 of file map_vector.hpp.
|
inline |
Set the memory of the base structure using an object.
mem | Memory object to use for allocation |
Definition at line 2108 of file map_vector.hpp.
|
inline |
Clear the vector.
Eliminate all the elements for from the vector
Definition at line 395 of file map_vector.hpp.
|
inline |
|
inline |
|
inline |
Swap the memory with another vector.
v | vector |
Definition at line 1851 of file map_vector.hpp.
|
inline |
Swap the memory with another vector.
v | vector |
Definition at line 1875 of file map_vector.hpp.
|
inline |
Swap the memory with another vector.
v | vector |
Definition at line 1828 of file map_vector.hpp.
|
inline |
Convert the grid into a data-structure compatible for computing into GPU.
The object created can be considered like a reference of the original
Definition at line 2267 of file map_vector.hpp.
|
inline |
Convert the grid into a data-structure compatible for computing into GPU.
The object created can be considered like a reference of the original
Definition at line 2281 of file map_vector.hpp.
|
inline |
Convert this vector into a string
prefix | prefix to use for printing |
Definition at line 2301 of file map_vector.hpp.
|
inline |
unpack a vector
mem | preallocated memory from where to unpack the vector |
ps | unpack-stat info |
Definition at line 343 of file map_vector.hpp.
|
private |
Actual size of the vector, warning: it is not the space allocated in grid grid size increase by a fixed amount every time we need a vector bigger than the actually allocated space
Definition at line 248 of file map_vector.hpp.