8#ifndef VECTOR_TEST_UTIL_HPP_
9#define VECTOR_TEST_UTIL_HPP_
12#include "Point_test.hpp"
13#include "Vector/map_vector.hpp"
14#include "data_type/aggregate.hpp"
20#ifdef TEST_COVERAGE_MODE
21#define FIRST_PUSH 1000
22#define SECOND_PUSH 1000
24#define FIRST_PUSH 1000000
25#define SECOND_PUSH 1000000
30static std::vector<Point_orig<float>> allocate_stl()
32 std::vector<Point_orig<float>> v_stl_test;
42 for (
size_t i = 0 ; i < FIRST_PUSH ; i++)
50 po.t[0][0] = 10.0 + i;
51 po.t[0][1] = 13.0 + i;
53 po.t[1][0] = 19.0 + i;
54 po.t[1][1] = 23.0 + i;
58 po.t[2][2] = 11.0 + i;
62 v_stl_test.push_back(po);
73 for (
size_t i = 0 ; i < n ; i++)
105 for (
size_t i = 0 ; i < n ; i++)
112template<
typename vector> vector allocate_openfpm(
size_t n_ele)
127 for (
size_t i = 0 ; i < n_ele / 2 ; i++)
136 p.
get<
P::t>()[0][0] = 10.0 + i;
137 p.
get<
P::t>()[0][1] = 13.0 + i;
139 p.
get<
P::t>()[1][0] = 19.0 + i;
140 p.
get<
P::t>()[1][1] = 23.0 + i;
144 p.
get<
P::t>()[2][2] = 11.0 + i;
152 for (
size_t i = n_ele / 2 ; i < n_ele ; i++)
156 size_t last = v_ofp_test.size()-1;
160 v_ofp_test.template get<P::v>(last)[0] = 1.0 + i;
161 v_ofp_test.template get<P::v>(last)[1] = 2.0 + i;
162 v_ofp_test.template get<P::v>(last)[2] = 7.0 + i;
164 v_ofp_test.template get<P::t>(last)[0][0] = 10.0 + i;
165 v_ofp_test.template get<P::t>(last)[0][1] = 13.0 + i;
166 v_ofp_test.template get<P::t>(last)[0][2] = 8.0 + i;
167 v_ofp_test.template get<P::t>(last)[1][0] = 19.0 + i;
168 v_ofp_test.template get<P::t>(last)[1][1] = 23.0 + i;
169 v_ofp_test.template get<P::t>(last)[1][2] = 5.0 + i;
170 v_ofp_test.template get<P::t>(last)[2][0] = 4.0 + i;
171 v_ofp_test.template get<P::t>(last)[2][1] = 3.0 + i;
172 v_ofp_test.template get<P::t>(last)[2][2] = 11.0 + i;
193 for (
size_t i = 0 ; i < n_ele / 2 ; i++)
202 p.
get<
P::t>()[0][0] = 10.0 + i;
203 p.
get<
P::t>()[0][1] = 13.0 + i;
205 p.
get<
P::t>()[1][0] = 19.0 + i;
206 p.
get<
P::t>()[1][1] = 23.0 + i;
210 p.
get<
P::t>()[2][2] = 11.0 + i;
218 for (
size_t i = n_ele / 2 ; i < n_ele ; i++)
222 size_t last = v_ofp_test.
size()-1;
226 v_ofp_test.get<
P::v>(last)[0] = 1.0 + i;
227 v_ofp_test.get<
P::v>(last)[1] = 2.0 + i;
228 v_ofp_test.get<
P::v>(last)[2] = 7.0 + i;
230 v_ofp_test.get<
P::t>(last)[0][0] = 10.0 + i;
231 v_ofp_test.get<
P::t>(last)[0][1] = 13.0 + i;
232 v_ofp_test.get<
P::t>(last)[0][2] = 8.0 + i;
233 v_ofp_test.get<
P::t>(last)[1][0] = 19.0 + i;
234 v_ofp_test.get<
P::t>(last)[1][1] = 23.0 + i;
235 v_ofp_test.get<
P::t>(last)[1][2] = 5.0 + i;
236 v_ofp_test.get<
P::t>(last)[2][0] = 4.0 + i;
237 v_ofp_test.get<
P::t>(last)[2][1] = 3.0 + i;
238 v_ofp_test.get<
P::t>(last)[2][2] = 11.0 + i;
250 for (
size_t i = 0 ; i < n_ele ; i++)
254 size_t last = v_ofp_test.
size()-1;
258 v_ofp_test.get<
P::x>(last) = 100.0 + i;
259 v_ofp_test.get<
P::y>(last) = 102.0 + i;
260 v_ofp_test.get<
P::z>(last) = 107.0 + i;
261 v_ofp_test.get<
P::s>(last) = 109.0 + i;
263 v_ofp_test.get<
P::v>(last)[0] = 1.0 + i;
264 v_ofp_test.get<
P::v>(last)[1] = 2.0 + i;
265 v_ofp_test.get<
P::v>(last)[2] = 7.0 + i;
267 v_ofp_test.get<
P::t>(last)[0][0] = 10.0 + i;
268 v_ofp_test.get<
P::t>(last)[0][1] = 13.0 + i;
269 v_ofp_test.get<
P::t>(last)[0][2] = 8.0 + i;
270 v_ofp_test.get<
P::t>(last)[1][0] = 19.0 + i;
271 v_ofp_test.get<
P::t>(last)[1][1] = 23.0 + i;
272 v_ofp_test.get<
P::t>(last)[1][2] = 5.0 + i;
273 v_ofp_test.get<
P::t>(last)[2][0] = 4.0 + i;
274 v_ofp_test.get<
P::t>(last)[2][1] = 3.0 + i;
275 v_ofp_test.get<
P::t>(last)[2][2] = 11.0 + i;
Definition of a class Point in plain C++ and boost::vector for testing purpose.
Test structure used for several test.
void sets(T s_)
set the s property
void setx(T x_)
set the x property
void setz(T z_)
set the z property
boost::fusion::result_of::at< type, boost::mpl::int_< i > >::type get()
getter method for a general property i
void sety(T y_)
set the y property
Test structure used for several test.
static const unsigned int x
x property is at position 0 in the boost::fusion::vector
void sety(T y_)
set the y property
static const unsigned int s
s property is at position 3 in the boost::fusion::vector
void setv(size_t i, T v_)
set the v property
void setz(T z_)
set the z property
auto get() -> decltype(boost::fusion::at_c< i >(data))
getter method for a general property i
static const unsigned int v
v property is at position 4 in the boost::fusion::vector
void sets(T s_)
set the s property
static const unsigned int y
y property is at position 1 in the boost::fusion::vector
static const unsigned int z
z property is at position 2 in the boost::fusion::vector
void setx(T x_)
set the x property
void sett(size_t i, size_t j, T t_)
set the t property
static const unsigned int t
t property is at position 5 in the boost::fusion::vector
Implementation of 1-D std::vector like structure.