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__ |
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, typenamelayout_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 | |
size_t | size () const |
Return the size of the vector. | |
size_t | size_local () const |
Return the size of the vector. | |
size_t | capacity () |
return the maximum capacity of the vector before reallocation | |
void | reserve (size_t sp) |
Reserve slots in the vector to avoid reallocation. | |
void | clear () |
Clear the vector. | |
void | shrink_to_fit () |
Clear the vector. | |
void | resize (size_t slot, size_t opt=DATA_ON_DEVICE|DATA_ON_HOST, unsigned int blockSize=1) |
Resize the vector. | |
void | resize_no_device (size_t slot) |
Resize the vector () | |
void | add () |
It insert a new emtpy object on the vector, eventually it reallocate the grid. | |
void | add_no_device () |
It insert a new emtpy object on the vector, eventually it reallocate the grid. | |
void | add (const T &v) |
It insert a new object on the vector, eventually it reallocate the grid. | |
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. | |
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. | |
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. | |
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) | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
void | insert (size_t key) |
Insert an entry in the vector. | |
void | remove (size_t key) |
Remove one entry from the vector. | |
void | remove (openfpm::vector< size_t > &keys, size_t start=0) |
Remove several entries from the vector. | |
void | remove (openfpm::vector< aggregate< int > > &keys, size_t start=0) |
Remove several entries from the vector. | |
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. | |
bool | isSubset () const |
Indicate that this class is not a subset. | |
auto | get (size_t id) -> decltype(base.get_o(grid_key_dx< 1 >(id))) |
Get an element of the vector. | |
const grid_base< 1, T, Memory, typenamelayout_base< T >::type >::container | get_o (size_t id) const |
Get an element of the vector. | |
template<unsigned int id> | |
void | fill (unsigned char c) |
Fill the buffer with a byte. | |
template<unsigned int id> | |
void * | getDeviceBufferCopy () |
It return the properties arrays. | |
template<unsigned int id> | |
void * | getDeviceBuffer () |
It return the properties arrays. | |
const grid_base< 1, T, Memory, layout_type >::container | last () const |
Get the last element of the vector. | |
template<unsigned int p> | |
auto | getProp (const unsigned int &id) -> decltype(base.template get< p >(grid_key_dx< 1 >(0))) |
Get an element of the vector. | |
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. | |
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. | |
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. | |
auto | get (size_t id) const -> const decltype(base.get_o(grid_key_dx< 1 >(id))) |
Get an element of the vector. | |
grid_base< 1, T, Memory, typenamelayout_base< T >::type >::container | last () |
Get the last element of the vector. | |
~vector () THROW | |
Destructor. | |
vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > | duplicate () const |
It duplicate the vector. | |
vector (vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &&v) | |
Constructor from another temporal vector. | |
vector (const vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) THROW | |
Constructor from another constant vector. | |
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. | |
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. | |
void | set (size_t id, const T &obj) |
Set the object id to obj. | |
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. | |
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. | |
vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > & | operator= (const vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &mv) |
Assignment operator. | |
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. | |
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. | |
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. | |
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. | |
bool | operator!= (const vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) const |
Check that two vectors are equal. | |
bool | operator== (const vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) const |
Check that two vectors are not equal. | |
void | swap_nomode (openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) |
Swap the memory with another vector. | |
void | swap (openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &v) |
Swap the memory with another vector. | |
void | swap (openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE > &&v) |
Swap the memory with another vector. | |
vector_key_iterator | getIteratorFrom (size_t start) const |
Get iterator over the particles from a particular index. | |
vector_key_iterator | getIteratorTo (size_t stop) const |
Get iterator over the particles from 0 until a particular index. | |
vector_key_iterator | getDomainIterator () const |
Get the vector elements iterator. | |
vector_key_iterator | getIterator () const |
Get the vector elements iterator. | |
template<unsigned int p> | |
vector_key_iterator_ele< p, self_type > | getIteratorElements () const |
Get the vector elements iterator. | |
size_t | packObjectSize () |
Return the size of the message needed to pack this object. | |
size_t | packObject (void *mem) |
Pack the object into the given pointer. | |
template<unsigned int p> | |
auto | getMemory () -> decltype(base.template getMemory< p >()) |
Return the memory object. | |
template<unsigned int p = 0> | |
void | setMemory (Memory &mem) |
Set the memory of the base structure using an object. | |
void | setMemoryArray (Memory *mem) |
Set the memory of the base structure using an object. | |
template<unsigned int p = 0> | |
void * | getPointer () |
Return the pointer that store the data. | |
template<unsigned int p = 0> | |
const void * | getPointer () const |
Return the pointer that store the data. | |
const size_t & | getInternal_v_size () const |
Internal function. | |
const grid_base< 1, T, Memory, layout_type > & | getInternal_base () const |
Internal function. | |
template<unsigned int ... prp> | |
void | hostToDevice () |
Copy the memory from host to device. | |
template<unsigned int ... prp> | |
void | deviceToHost () |
Synchronize the memory buffer in the device with the memory in the host. | |
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. | |
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. | |
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. | |
template<unsigned int ... prp> | |
void | hostToDeviceNUMA () |
Synchronize the memory buffer in the device with the memory in the host respecing NUMA domains. | |
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. | |
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. | |
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 | |
template<int ... prp> | |
static size_t | calculateMem (size_t n, size_t e) |
Calculate the memory size required to allocate n elements. | |
template<int ... prp> | |
static size_t | packMem (size_t n, size_t e) |
Calculate the memory size required to pack n elements. | |
static size_t | calculateNMem (size_t n) |
How many allocation are required to create n-elements. | |
static bool | noPointers () |
This class has pointer inside. | |
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. | |
Private Attributes | |
size_t | v_size |
grid_base< 1, T, Memory, typename layout_base< T >::type > | base |
1-D static grid | |
typedef size_t openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::access_key |
Access key for the vector.
Definition at line 482 of file map_vector.hpp.
typedef grid_base<1,T,Memory,typenamelayout_base<T>::type>::container openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::container |
Object container for T, it is the return type of get_o it return a object type trough.
Definition at line 305 of file map_vector.hpp.
typedef grow_p openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::grow_policy |
growing policy of this vector
Definition at line 314 of file map_vector.hpp.
typedef vector_key_iterator openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::iterator_key |
iterator for the vector
Definition at line 301 of file map_vector.hpp.
typedef layout_base<T> openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::layout_base_ |
Type of the encapsulation memory parameter.
Definition at line 298 of file map_vector.hpp.
typedef layout_base<T>::type openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::layout_type |
Type of the encapsulation memory parameter.
Definition at line 295 of file map_vector.hpp.
typedef Memory openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::Memory_type |
Type of memory this vector use.
Definition at line 311 of file map_vector.hpp.
|
private |
Definition at line 243 of file map_vector.hpp.
typedef T openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::value_type |
Type of the value the vector is storing.
Definition at line 308 of file map_vector.hpp.
typedef int openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::yes_i_am_vector |
it define that it is a vector
Definition at line 289 of file map_vector.hpp.
typedef int openfpm::vector< T, Memory, layout_base, grow_p, OPENFPM_NATIVE >::yes_i_am_vector_native |
it define that it is a vector
Definition at line 292 of file map_vector.hpp.
|
inline |
Destructor.
Definition at line 1468 of file map_vector.hpp.
|
inline |
Constructor from another temporal vector.
v | the vector |
Definition at line 1501 of file map_vector.hpp.
|
inline |
Constructor from another constant vector.
v | the vector |
Definition at line 1518 of file map_vector.hpp.
|
inline |
Constructor, vector of size 0.
Definition at line 1531 of file map_vector.hpp.
|
inline |
Constructor, vector of size sz.
Definition at line 1544 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 2049 of file map_vector.hpp.
|
inlinestatic |
How many allocation are required to create n-elements.
n | number of elements |
Definition at line 2093 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 2208 of file map_vector.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host.
Definition at line 2218 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
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 1422 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 1441 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.
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 1958 of file map_vector.hpp.
|
inline |
|
inline |
|
inline |
Get the vector elements iterator.
Definition at line 1973 of file map_vector.hpp.
|
inline |
Get the vector elements iterator.
Definition at line 1985 of file map_vector.hpp.
|
inline |
Get iterator over the particles from a particular index.
start | starting point |
Definition at line 1915 of file map_vector.hpp.
|
inline |
Get iterator over the particles from 0 until a particular index.
stop | stop point |
Definition at line 1929 of file map_vector.hpp.
|
inline |
Return the memory object.
Return the memory object
p | array to retrieve |
Definition at line 2106 of file map_vector.hpp.
|
inline |
Definition at line 1623 of file map_vector.hpp.
|
inline |
Return the pointer that store the data.
property | from which take the pointer |
Definition at line 2150 of file map_vector.hpp.
|
inline |
Return the pointer that store the data.
Definition at line 2160 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 1388 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 1405 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 1373 of file map_vector.hpp.
|
inline |
Copy the memory from host to device.
Definition at line 2199 of file map_vector.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host.
Definition at line 2227 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 2245 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 2236 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 |
Definition at line 2349 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 1460 of file map_vector.hpp.
|
inline |
Get the last element of the vector.
Definition at line 1356 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 |
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 |
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 |
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 1808 of file map_vector.hpp.
|
inline |
Assignment operator.
it copy
mv | vector |
Definition at line 1718 of file map_vector.hpp.
|
inline |
Assignment operator.
mv | vector to copy |
Definition at line 1779 of file map_vector.hpp.
|
inline |
Assignment operator.
it copy
mv | vector |
Definition at line 1661 of file map_vector.hpp.
|
inline |
Assignment operator.
move semantic movement operator=
mv | vector |
Definition at line 1695 of file map_vector.hpp.
|
inline |
Assignment operator.
move semantic movement operator=
mv | vector |
Definition at line 1752 of file map_vector.hpp.
|
inline |
Assignment operator.
move semantic movement operator=
mv | vector |
Definition at line 1638 of file map_vector.hpp.
|
inline |
Check that two vectors are not equal.
vector | to compare |
Definition at line 1818 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 2076 of file map_vector.hpp.
|
inline |
Pack the object into the given pointer.
mem | pointer |
Definition at line 2034 of file map_vector.hpp.
|
inline |
Return the size of the message needed to pack this object.
Definition at line 2022 of file map_vector.hpp.
|
inline |
Definition at line 2351 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 |
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 one entry from the vector.
key | element to remove |
Definition at line 1140 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 | |
obj |
copy the element
Definition at line 1598 of file map_vector.hpp.
|
inline |
Set the object id to obj.
id | element |
obj | object (encapsulated) |
copy the element
Definition at line 1562 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 1614 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 1586 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 2116 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 2132 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 1890 of file map_vector.hpp.
|
inline |
Swap the memory with another vector.
v | vector |
Definition at line 1866 of file map_vector.hpp.
|
inline |
Swap the memory with another vector.
v | vector |
Definition at line 1843 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 2291 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 2305 of file map_vector.hpp.
|
inline |
Convert this vector into a string
prefix | prefix to use for printing |
Definition at line 2325 of file map_vector.hpp.
|
private |
1-D static grid
Definition at line 251 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.