OpenFPM_data  0.1.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
 All Data Structures Namespaces Functions Variables Typedefs Friends
openfpm::vector< T, Memory, grow_p, impl > Class Template Reference

Implementation of 1-D std::vector like structure. More...

Detailed Description

template<typename T, typename Memory = HeapMemory, typename grow_p = grow_policy_double, unsigned int impl = vect_isel<T>::value>
class openfpm::vector< T, Memory, grow_p, impl >

Implementation of 1-D std::vector like structure.

Stub object look at the various implementations

openfpm::vector<Point_test<float>> v_ofp_test;
p.setx(1.0);
p.sety(2.0);
p.setz(3.0);
p.sets(4.0);
// push objects
for (size_t i = 0 ; i < n_ele / 2 ; i++)
{
// Modify the point
p.get<P::v>()[0] = 1.0 + i;
p.get<P::v>()[1] = 2.0 + i;
p.get<P::v>()[2] = 7.0 + i;
p.get<P::t>()[0][0] = 10.0 + i;
p.get<P::t>()[0][1] = 13.0 + i;
p.get<P::t>()[0][2] = 8.0 + i;
p.get<P::t>()[1][0] = 19.0 + i;
p.get<P::t>()[1][1] = 23.0 + i;
p.get<P::t>()[1][2] = 5.0 + i;
p.get<P::t>()[2][0] = 4.0 + i;
p.get<P::t>()[2][1] = 3.0 + i;
p.get<P::t>()[2][2] = 11.0 + i;
// add p
v_ofp_test.add(p);
}
for (size_t i = n_ele / 2 ; i < n_ele ; i++)
{
v_ofp_test.add();
size_t last = v_ofp_test.size()-1;
// Modify the point
v_ofp_test.get<P::v>(last)[0] = 1.0 + i;
v_ofp_test.get<P::v>(last)[1] = 2.0 + i;
v_ofp_test.get<P::v>(last)[2] = 7.0 + i;
v_ofp_test.get<P::t>(last)[0][0] = 10.0 + i;
v_ofp_test.get<P::t>(last)[0][1] = 13.0 + i;
v_ofp_test.get<P::t>(last)[0][2] = 8.0 + i;
v_ofp_test.get<P::t>(last)[1][0] = 19.0 + i;
v_ofp_test.get<P::t>(last)[1][1] = 23.0 + i;
v_ofp_test.get<P::t>(last)[1][2] = 5.0 + i;
v_ofp_test.get<P::t>(last)[2][0] = 4.0 + i;
v_ofp_test.get<P::t>(last)[2][1] = 3.0 + i;
v_ofp_test.get<P::t>(last)[2][2] = 11.0 + i;
}
Parameters
Ttype of structure the vector has to store
Memoryallocator to use
grow_pgrow policy, how this vector should grow
See Also
vector<T,HeapMemory,grow_policy_double,STD_VECTOR>
vector<T,Memory,grow_p,OPENFPM_NATIVE>
vector<T,Memory,grow_p,OPENFPM_NATIVE>

Definition at line 94 of file map_grid.hpp.

#include <map_vector.hpp>


The documentation for this class was generated from the following file: