OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
ORB_unit_test.hpp
1 /*
2  * ORB_unit_test.hpp
3  *
4  * Created on: Mar 16, 2015
5  * Author: i-bird
6  */
7 
8 #ifndef ORB_UNIT_TEST_HPP_
9 #define ORB_UNIT_TEST_HPP_
10 
11 #include "ORB.hpp"
12 #include <random>
13 
14 BOOST_AUTO_TEST_SUITE( ORB_test )
15 
16 #define N_POINTS 1024
17 
18 BOOST_AUTO_TEST_CASE( ORB_test_use)
19 {
20  // set the seed
21  // create the random generator engine
22  std::srand(create_vcluster().getProcessUnitID());
23  std::default_random_engine eg;
24  std::uniform_real_distribution<float> ud(0.0f, 1.0f);
25 
26  typedef Point<3,float> p;
27 
28  // create a random local vector of particles
29  openfpm::vector<Point<3,float>> vp(N_POINTS);
30 
31  // fill the particles
32 
33  auto vp_it = vp.getIterator();
34 
35  while (vp_it.isNext())
36  {
37  auto key = vp_it.get();
38 
39  vp.get<p::x>(key)[0] = ud(eg);
40  vp.get<p::x>(key)[1] = ud(eg);
41  vp.get<p::x>(key)[2] = ud(eg);
42 
43  ++vp_it;
44  }
45 
46  // Orthogonal Recursive Bisection
47  Box<3,float> dom({0.0,0.0,0.0},{1.0,1.0,1.0});
48 
49 // ORB<3,float> orb(dom,16,vp);
50 
51  //
52 }
53 
54 BOOST_AUTO_TEST_SUITE_END()
55 
56 #endif /* ORB_UNIT_TEST_HPP_ */
This class implement the point shape in an N-dimensional space.
Definition: Point.hpp:22
This class is a trick to indicate the compiler a specific specialization pattern. ...
Definition: memory_c.hpp:201
Implementation of 1-D std::vector like structure.
Definition: map_vector.hpp:61