OpenFPM  5.2.0
Project that contain the implementation of distributed structures
util_test.hpp
1 /*
2  * util_test.hpp
3  *
4  * Created on: May 31, 2015
5  * Author: Pietro Incardona
6  */
7 
8 #ifndef UTIL_TEST_HPP_
9 #define UTIL_TEST_HPP_
10 
11 #include "config.h"
12 #include "util/object_util.hpp"
13 #include "Point_test.hpp"
14 #include "util/ct_array.hpp"
15 #include "Vector/map_vector.hpp"
16 #include "util/common.hpp"
17 #include "util/check_no_pointers.hpp"
18 #include "Grid/util.hpp"
19 
20 #include "util/convert.hpp"
21 #include <iostream>
22 #include "util/mul_array_extents.hpp"
23 #include "Packer_Unpacker/has_max_prop.hpp"
24 #include "SparseGrid/SparseGrid.hpp"
25 
28 {
30  static const unsigned int max_prop = 6;
31 };
32 
35 {
36 };
37 
39 
41 
44 {
46  float data;
47 
49  static constexpr bool stag_mask[] = {true,false,true};
50 };
51 
54 {
56  float data;
57 };
58 
60 
62 
65 {
67  struct attributes
68  {
70  static const std::string name[2];
71  };
72 };
73 
74 // attribute names
75 const std::string test_has_attributes::attributes::name[]={"attributes1","attributes2"};
76 
78 {
79 };
80 
82 
83 BOOST_AUTO_TEST_SUITE( util_test )
84 
85 BOOST_AUTO_TEST_CASE( object_s_di_test )
86 {
87  // Object write test
88 
90  typedef Point_test<float> p;
91  typedef Point_test<float>::type vboost;
92  typedef object_creator<Point_test<float>::type,0,1,4>::type vboost_red;
93 
94  object<vboost> dst;
96 
97  // fill the source properties 0,1,2 with data
98 
99  boost::fusion::at_c<0>(src.data) = 1.0;
100  boost::fusion::at_c<1>(src.data) = 2.0;
101 
102  for (size_t i = 0 ; i < 3 ; i++)
103  boost::fusion::at_c<2>(src.data)[i] = i + 5.0;
104 
105  // copy from src to dst
106  object_s_di<object<vboost_red>,object<vboost>,OBJ_NORMAL,0,1,4>(src,dst);
107 
108  // Check the result
109  BOOST_REQUIRE_EQUAL(boost::fusion::at_c<p::x>(dst.data),1.0);
110  BOOST_REQUIRE_EQUAL(boost::fusion::at_c<p::y>(dst.data),2.0);
111 
112  for (size_t i = 0 ; i < 3 ; i++)
113  BOOST_REQUIRE_EQUAL(boost::fusion::at_c<p::v>(dst.data)[i],i + 5.0);
114 
116 
118 
119  typedef encapc<1,Point_test<float>,openfpm::vector<Point_test<float>>::layout_type> encap_dst;
120  typedef encapc<1,object<vboost_red>,openfpm::vector<object<vboost_red>>::layout_type> encap_src;
121 
122  openfpm::vector<p> v_point;
124 
125  v_point.resize(2);
126  v_point_red.resize(2);
127 
128  v_point_red.template get<0>(0) = 11.0;
129  v_point_red.template get<1>(0) = 12.0;
130 
131  for (size_t i = 0 ; i < 3 ; i++)
132  v_point_red.template get<2>(0)[i] = i + 15.0;
133 
134  auto dst_e = v_point.get(0);
135  auto src_e = v_point_red.get(0);
136 
138 
139  BOOST_REQUIRE_EQUAL(v_point.get(0).template get<p::x>(),11.0);
140  BOOST_REQUIRE_EQUAL(v_point.get(0).template get<p::y>(),12.0);
141 
142  for (size_t i = 0 ; i < 3 ; i++)
143  BOOST_REQUIRE_EQUAL(v_point.get(0).template get<p::v>()[i],i + 15.0);
144 
146 }
147 
148 BOOST_AUTO_TEST_CASE( object_s_di_op_test )
149 {
150  // Object write test
151 
153  typedef Point_test<float> p;
154  typedef Point_test<float>::type vboost;
155  typedef object_creator<Point_test<float>::type,0,1,4>::type vboost_red;
156 
157  object<vboost> dst;
158  object<vboost_red> src;
159 
160  // fill the source properties 0,1,2 with data
161 
162  boost::fusion::at_c<0>(src.data) = 1.0;
163  boost::fusion::at_c<1>(src.data) = 2.0;
164 
165  for (size_t i = 0 ; i < 3 ; i++)
166  boost::fusion::at_c<2>(src.data)[i] = i + 5.0;
167 
168  boost::fusion::at_c<0>(dst.data) = 2.0;
169  boost::fusion::at_c<1>(dst.data) = 3.0;
170 
171  for (size_t i = 0 ; i < 3 ; i++)
172  boost::fusion::at_c<4>(dst.data)[i] = i + 7.0;
173 
174  // copy from src to dst
175  object_s_di_op<add_,object<vboost_red>,object<vboost>,OBJ_NORMAL,0,1,4>(src,dst);
176 
177  // Check the result
178  BOOST_REQUIRE_EQUAL(boost::fusion::at_c<p::x>(dst.data),3.0);
179  BOOST_REQUIRE_EQUAL(boost::fusion::at_c<p::y>(dst.data),5.0);
180 
181  for (size_t i = 0 ; i < 3 ; i++)
182  BOOST_REQUIRE_EQUAL(boost::fusion::at_c<p::v>(dst.data)[i],2*i + 12.0);
183 
185 
187 
188  typedef encapc<1,Point_test<float>,openfpm::vector<Point_test<float>>::layout_type> encap_dst;
189  typedef encapc<1,object<vboost_red>,openfpm::vector<object<vboost_red>>::layout_type> encap_src;
190 
191  openfpm::vector<p> v_point;
193 
194  v_point.resize(2);
195  v_point_red.resize(2);
196 
197  v_point_red.template get<0>(0) = 11.0;
198  v_point_red.template get<1>(0) = 12.0;
199 
200  v_point.template get<0>(0) = 10.0;
201  v_point.template get<1>(0) = 9.0;
202 
203  for (size_t i = 0 ; i < 3 ; i++)
204  v_point_red.template get<2>(0)[i] = i + 8.0;
205 
206  for (size_t i = 0 ; i < 3 ; i++)
207  v_point.template get<4>(0)[i] = i + 3.0;
208 
209  auto dst_e = v_point.get(0);
210  auto src_e = v_point_red.get(0);
211 
213 
214  BOOST_REQUIRE_EQUAL(v_point.get(0).template get<p::x>(),21.0);
215  BOOST_REQUIRE_EQUAL(v_point.get(0).template get<p::y>(),21.0);
216 
217  for (size_t i = 0 ; i < 3 ; i++)
218  BOOST_REQUIRE_EQUAL(v_point.get(0).template get<p::v>()[i],2*i + 11.0);
219 
221 }
222 
223 BOOST_AUTO_TEST_CASE( object_prop_copy )
224 {
225  {
227  typedef Point_test<float> p;
228  typedef Point_test<float>::type vboost;
229  typedef object_creator<Point_test<float>::type,0,1,4>::type vboost_red;
230 
231  object<vboost> src;
232  object<vboost_red> dst;
233 
234  // fill the source properties x,y,v = 0,1,4 with data
235 
236  boost::fusion::at_c<p::x>(src.data) = 1.0;
237  boost::fusion::at_c<p::y>(src.data) = 2.0;
238 
239  for (size_t i = 0 ; i < 3 ; i++)
240  boost::fusion::at_c<p::v>(src.data)[i] = i + 5.0;
241 
242  // copy from src to dst
243  object_si_d<object<vboost>,object<vboost_red>,OBJ_NORMAL,0,1,4>(src,dst);
244 
245  // Check the result
246  BOOST_REQUIRE_EQUAL(boost::fusion::at_c<0>(dst.data),1.0);
247  BOOST_REQUIRE_EQUAL(boost::fusion::at_c<1>(dst.data),2.0);
248 
249  for (size_t i = 0 ; i < 3 ; i++)
250  BOOST_REQUIRE_EQUAL(boost::fusion::at_c<2>(dst.data)[i],i + 5.0);
251 
253 
255 
256  typedef encapc<1,Point_test<float>,openfpm::vector<Point_test<float>>::layout_type> encap_src;
257  typedef encapc<1,object<vboost_red>,openfpm::vector<object<vboost_red>>::layout_type> encap_dst;
258 
259  openfpm::vector<p> v_point;
261 
262  v_point.resize(2);
263  v_point_red.resize(2);
264 
265  v_point.template get<p::x>(0) = 1.0;
266  v_point.template get<p::y>(0) = 2.0;
267 
268  for (size_t i = 0 ; i < 3 ; i++)
269  v_point.template get<p::v>(0)[i] = i + 5.0;
270 
271  auto src_e = v_point.get(0);
272  auto dst_e = v_point_red.get(0);
273 
275 
276  BOOST_REQUIRE_EQUAL(v_point_red.get(0).template get<0>(),1.0);
277  BOOST_REQUIRE_EQUAL(v_point_red.get(0).template get<1>(),2.0);
278 
279  for (size_t i = 0 ; i < 3 ; i++)
280  BOOST_REQUIRE_EQUAL(v_point_red.get(0).template get<2>()[i],i + 5.0);
281 
283  }
284 
285 
286  {
288  struct no_method_pointer
289  {
290  float a;
291  int b;
292  };
293 
294  struct no_pointer
295  {
296  double c;
297  int d;
298 
299  static bool noPointers() {return true;}
300  };
301 
302  struct with_pointer
303  {
304  double * c;
305  int d;
306 
307  static bool noPointers() {return false;}
308  };
309 
310  typedef boost::fusion::vector<int,float,double,no_method_pointer,no_pointer,with_pointer,no_method_pointer> v;
311 
312  int val = boost::mpl::size< noPointers_sequence<v,0,2>::type >::value;
313  BOOST_REQUIRE_EQUAL(val,0);
314 
315  val = boost::mpl::size< noPointers_sequence<v,0,2,4,5>::type >::value;
316  BOOST_REQUIRE_EQUAL(val,0);
317 
318  val = boost::mpl::size< noPointers_sequence<v,0,1,2,3,4,5,6>::type >::value;
319  BOOST_REQUIRE_EQUAL(val,2);
320 
321  typedef boost::fusion::vector<int *,float &,double *,no_method_pointer *,no_pointer &,with_pointer *,no_method_pointer &> vp;
322 
323  val = boost::mpl::size< noPointers_sequence<vp,0,1,2,3,4,5,6>::type >::value;
324  BOOST_REQUIRE_EQUAL(val,2);
325 
327  }
328 
329  // Check the the object respect the noPointers construction
330  {
331 
332  struct no_method_pointer
333  {
334  float a;
335  int b;
336  };
337 
338  struct no_pointer
339  {
340  double c;
341  int d;
342 
343  static bool noPointers() {return true;}
344  };
345 
346  struct with_pointer
347  {
348  double * c;
349  int d;
350 
351  static bool noPointers() {return false;}
352  };
353 
354  typedef boost::fusion::vector<int,float,double> v;
355  int val = object<v>::noPointers();
356  BOOST_REQUIRE_EQUAL(val,PNP::NO_POINTERS);
357 
358  typedef boost::fusion::vector<int,float,double,no_pointer> va;
359  val = object<va>::noPointers();
360  BOOST_REQUIRE_EQUAL(val,PNP::NO_POINTERS);
361 
362  typedef boost::fusion::vector<int,float,double,no_pointer,with_pointer> vb;
363  val = object<vb>::noPointers();
364  BOOST_REQUIRE_EQUAL(val,PNP::POINTERS);
365 
366  typedef boost::fusion::vector<int,float,double,no_pointer,double *> vc;
367  val = object<vc>::noPointers();
368  BOOST_REQUIRE_EQUAL(val,PNP::POINTERS);
369 
370  typedef boost::fusion::vector<int,float,double,no_pointer,double &> vd;
371  val = object<vd>::noPointers();
372  BOOST_REQUIRE_EQUAL(val,PNP::POINTERS);
373 
374  typedef boost::fusion::vector<int,float,double,no_pointer,double[3]> ve;
375  val = object<ve>::noPointers();
376  BOOST_REQUIRE_EQUAL(val,PNP::NO_POINTERS);
377 
378  typedef boost::fusion::vector<int,float,double,no_pointer,no_pointer *> vf;
379  val = object<vf>::noPointers();
380  BOOST_REQUIRE_EQUAL(val,PNP::POINTERS);
381 
382  typedef boost::fusion::vector<int,float,double,no_pointer,no_pointer &> vg;
383  val = object<vg>::noPointers();
384  BOOST_REQUIRE_EQUAL(val,PNP::POINTERS);
385 
386  typedef boost::fusion::vector<int,float,double,no_pointer,no_pointer[3]> vh;
387  val = object<vh>::noPointers();
388  BOOST_REQUIRE_EQUAL(val,PNP::NO_POINTERS);
389  }
390 }
391 
392 
393 BOOST_AUTO_TEST_CASE( generate_array )
394 {
395  {
397  const size_t count = 5;
398  typedef typename ::generate_array<size_t,count, MetaFunc>::result ct_test;
399 
400  // ct_test::data is equivalent to const size_t [5] = {5,6,7,8,9}
401 
402  for (size_t i = 0 ; i < count; ++i)
403  {
404  const size_t ct_val = ct_test::data[i];
405  BOOST_REQUIRE_EQUAL(ct_val,count+i);
406  }
408  }
409 
410  // check constexpr compile time array as template parameters
411 
412 #ifndef COVERTY_SCAN
413 #if __CUDACC_VER_MAJOR__ >= 9
414  {
416  const size_t count = 5;
417  typedef typename ::generate_array_constexpr<size_t,count, MetaFunc>::result ct_test_ce;
418 
419  // ct_test_ce::data is equivalent to constexpr size_t [5] = {5,6,7,8,9}
420 
422  BOOST_REQUIRE_EQUAL(ct_calc,11ul);
424  }
425 
426 #endif
427 #endif
428 
429 
430  {
432  const size_t count = 5;
433  typedef typename ::generate_indexes<size_t,count, MetaFuncOrd>::result ct_test_ce;
434 
435  bool check = std::is_same<ct_test_ce,index_tuple<0,1,2,3,4>>::value;
436  BOOST_REQUIRE_EQUAL(check,true);
438  }
439 }
440 
441 BOOST_AUTO_TEST_CASE( check_templates_util_function )
442 {
443  {
444  {
445 
447 
448  struct test_pack
449  {
450  static bool pack() {return true;}
451  };
452 
453  struct test_unknown_pack
454  {
455  };
456 
457  BOOST_REQUIRE_EQUAL(has_pack<test_pack>::type::value,true);
458  BOOST_REQUIRE_EQUAL(has_pack<test_unknown_pack>::type::value,false);
459 
461 
462  struct test_packRequest
463  {
464  static bool packRequest() {return false;}
465  };
466 
467  struct test_unknown_packRequest
468  {
469  };
470 
471  BOOST_REQUIRE_EQUAL(has_packRequest<test_packRequest>::type::value,true);
473 
475 
476  struct test_packMem
477  {
478  static bool packMem() {return true;}
479  };
480 
481  struct test_unknown_packMem
482  {
483  };
484 
485  BOOST_REQUIRE_EQUAL(has_packMem<test_packMem>::type::value,true);
486  BOOST_REQUIRE_EQUAL(has_packMem<test_unknown_packMem>::type::value,false);
487 
488 
490 
491  struct test_no_ptr
492  {
493  static bool noPointers() {return true;}
494  };
495 
496  struct test_ptr
497  {
498  static bool noPointers() {return false;}
499  };
500 
501  struct test_unknown
502  {
503  };
504 
505  BOOST_REQUIRE_EQUAL(has_noPointers<test_no_ptr>::type::value,true);
506  BOOST_REQUIRE_EQUAL(has_noPointers<test_ptr>::type::value,true);
507  BOOST_REQUIRE_EQUAL(has_noPointers<test_unknown>::type::value,false);
508 
510 
511  }
512 
513  {
515 
516  int val = is_openfpm_native<Point_test<float>>::value;
517  BOOST_REQUIRE_EQUAL(val, true);
519  BOOST_REQUIRE_EQUAL(val, false);
520 
522  }
523 
524  {
526 
527  struct test_typedef_same_data
528  {
529  typedef boost::fusion::vector<float,double,float[3]> type;
530 
531  type data;
532  };
533 
534  struct test_typedef_not_same_data
535  {
536  typedef boost::fusion::vector<float,double,float[3]> type;
537 
538  boost::fusion::vector<float,double> data;
539  };
540 
542  BOOST_REQUIRE_EQUAL(val, true);
544  BOOST_REQUIRE_EQUAL(val, false);
545 
547  }
548 
549  {
551 
552  struct test_has_data
553  {
554  float data;
555  };
556 
557  struct test_no_has_data
558  {
559  };
560 
562  BOOST_REQUIRE_EQUAL(val, true);
564  BOOST_REQUIRE_EQUAL(val, false);
565 
567  }
568 
569  {
571 
573  BOOST_REQUIRE_EQUAL(val, true);
575  BOOST_REQUIRE_EQUAL(val, false);
576 
577 
579  BOOST_REQUIRE_EQUAL(val, true);
581 #ifndef SE_CLASS3
582  BOOST_REQUIRE_EQUAL(val, 3);
583 #endif
584 
586  }
587 
588  {
590 
591  struct test_has_value_type_ofp
592  {
593  typedef int value_type;
594  };
595 
596  struct test_has_no_value_type
597  {
598 
599  };
600 
602  BOOST_REQUIRE_EQUAL(val, true);
604  BOOST_REQUIRE_EQUAL(val, false);
605 
607  }
608 
609 
610  {
612 
614  BOOST_REQUIRE_EQUAL(val, true);
616  BOOST_REQUIRE_EQUAL(val, false);
617 
619  }
620 
621  {
623 
624  struct test_has_typedef
625  {
626  typedef float type;
627  };
628 
629  struct test_no_has_data
630  {
631  };
632 
634  BOOST_REQUIRE_EQUAL(val, true);
636  BOOST_REQUIRE_EQUAL(val, false);
637 
639  }
640 
641  {
643 
645  BOOST_REQUIRE_EQUAL(val, true);
647  BOOST_REQUIRE_EQUAL(val, false);
648 
650  }
651 
653  struct test_no_ptr
654  {
655  static bool noPointers() {return PNP::NO_POINTERS;}
656  };
657 
658  struct test_ptr
659  {
660  static bool noPointers() {return PNP::POINTERS;}
661  };
662 
663  struct test_unknown
664  {
665  };
666 
668  BOOST_REQUIRE_EQUAL(val,PNP::NO_POINTERS);
670  BOOST_REQUIRE_EQUAL(val,PNP::POINTERS);
672  BOOST_REQUIRE_EQUAL(val,PNP::UNKNOWN);
673 
675 
676  {
678 
679  struct stub_object
680  {
681  float a;
682  double b;
683  };
684 
685  bool val = is_grid< grid_cpu<2,aggregate<float> > >::value;
686  BOOST_REQUIRE_EQUAL( val ,true);
688  BOOST_REQUIRE_EQUAL( val , true);
690  BOOST_REQUIRE_EQUAL( val ,true);
691 
692  val = is_grid< grid_gpu<2,aggregate<float> > >::value;
693  BOOST_REQUIRE_EQUAL(val ,true);
695  BOOST_REQUIRE_EQUAL(val, true);
697  BOOST_REQUIRE_EQUAL(val,true);
698 
700  BOOST_REQUIRE_EQUAL( val, false);
701  val = is_grid< stub_object > ::value;
702  BOOST_REQUIRE_EQUAL( val, false);
703 
705  }
706 
707  {
709 
710  struct stub_object
711  {
712  float a;
713  double b;
714  };
715 
716  bool val = is_vector< openfpm::vector<aggregate<float> > >::value;
717  BOOST_REQUIRE_EQUAL( val ,true);
719  BOOST_REQUIRE_EQUAL( val , true);
721  BOOST_REQUIRE_EQUAL( val ,true);
722 
724  BOOST_REQUIRE_EQUAL(val ,true);
726  BOOST_REQUIRE_EQUAL(val, true);
728  BOOST_REQUIRE_EQUAL(val,true);
729 
731  BOOST_REQUIRE_EQUAL( val, false);
732  val = is_vector< stub_object > ::value;
733  BOOST_REQUIRE_EQUAL( val, false);
734 
736  }
737 
738  {
740 
741  struct stub_object
742  {
743  float a;
744  double b;
745  };
746 
748  BOOST_REQUIRE_EQUAL( val ,true);
750  BOOST_REQUIRE_EQUAL( val , true);
752  BOOST_REQUIRE_EQUAL( val ,true);
753 
755  BOOST_REQUIRE_EQUAL( val ,true);
757  BOOST_REQUIRE_EQUAL( val , true);
759  BOOST_REQUIRE_EQUAL( val ,true);
760 
762  BOOST_REQUIRE_EQUAL( val, false);
763  val = is_encap< stub_object > ::value;
764  BOOST_REQUIRE_EQUAL( val, false);
765 
767  }
768 
769  {
771 
772  size_t mul = array_extents<float>::mul();
773  BOOST_REQUIRE_EQUAL(mul,1ul);
775  BOOST_REQUIRE_EQUAL(mul,3ul);
777  BOOST_REQUIRE_EQUAL(mul,3ul*2ul);
779  BOOST_REQUIRE_EQUAL(mul,3ul*2ul*5ul);
780 
782  }
783 
784  {
786 
788  BOOST_REQUIRE_EQUAL(val,true);
790  BOOST_REQUIRE_EQUAL(val,false);
791 
793  BOOST_REQUIRE_EQUAL(val,false);
795  BOOST_REQUIRE_EQUAL(val,true);
796 
798  }
799 
801  {
803 
805 
806  BOOST_REQUIRE_EQUAL(val,true);
807 
808  typedef aggregate<float, Point_test<float>> aggr2;
809 
811 
812  BOOST_REQUIRE_EQUAL(val,false);
813 
815 
817 
818  BOOST_REQUIRE_EQUAL(val,true);
819 
820  }
822 
823  }
824 }
825 
826 BOOST_AUTO_TEST_CASE( check_convert_function )
827 {
828  {
830 
831  comb<2> c;
832  c.c[0] = 1;
833  c.c[1] = -1;
834 
836 
837  BOOST_REQUIRE_EQUAL(p.get(0),1ul);
838  BOOST_REQUIRE_EQUAL(p.get(1),(size_t)-1);
839 
841  }
842 
843  {
845 
846  comb<3> c;
847  c.c[0] = 1;
848  c.c[1] = -1;
849  c.c[2] = 0;
850 
852 
853  BOOST_REQUIRE_EQUAL(p.get(0),1);
854  BOOST_REQUIRE_EQUAL(p.get(1),-1);
855  BOOST_REQUIRE_EQUAL(p.get(2),0);
856 
858  }
859 }
860 
861 
862 BOOST_AUTO_TEST_CASE( is_contiguos_test)
863 {
864  {
865  bool test = is_contiguos<1,2>::type::value;
866 
867  BOOST_REQUIRE_EQUAL(test,true);
868 
870 
871  BOOST_REQUIRE_EQUAL(test,false);
872 
874 
875  BOOST_REQUIRE_EQUAL(test,true);
876 
878 
879  BOOST_REQUIRE_EQUAL(test,false);
880 
882 
883  BOOST_REQUIRE_EQUAL(test,false);
884 
886 
887  BOOST_REQUIRE_EQUAL(test,false);
888  }
889 }
890 
891 BOOST_AUTO_TEST_CASE( dyn_struct_check )
892 {
893  typedef grid_cpu<3,aggregate<int>> gs;
894 
895  bool test = isDynStruct<gs>::value();
896 
897  BOOST_REQUIRE_EQUAL(test,false);
898 
899  typedef openfpm::vector<aggregate<int>> va;
900 
901  test = isDynStruct<gs>::value();
902 
903  BOOST_REQUIRE_EQUAL(test,false);
904 
906 
907  test = isDynStruct<sg>::value();
908 
909  BOOST_REQUIRE_EQUAL(test,true);
910 
911  typedef openfpm::vector<int> vi;
912 
913  test = isDynStruct<vi>::value();
914 
915  BOOST_REQUIRE_EQUAL(test,false);
916 }
917 
918 BOOST_AUTO_TEST_SUITE_END()
919 
920 #endif /* UTIL_TEST_HPP_ */
This class allocate, and destroy CPU memory.
Definition: HeapMemory.hpp:40
Test structure used for several test.
Definition: Point_test.hpp:106
boost::fusion::vector< T, T, T, T, T[3], T[3][3]> type
declaration of what the Point_test store
Definition: Point_test.hpp:120
This class implement the point shape in an N-dimensional space.
Definition: Point.hpp:28
Implementation of 1-D std::vector like structure.
Definition: map_vector.hpp:204
static Point< dim, St > convert(const comb< dim > &c)
Return the combination converted to point.
Definition: convert.hpp:25
[Metafunction definition]
Definition: common.hpp:349
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
Definition: aggregate.hpp:221
Struct that give functionalities on array extensions.
static size_t value()
Return true if the structure T has a pointer.
This class check if the type T has pointers inside.
Position of the element of dimension d in the hyper-cube of dimension dim.
Definition: comb.hpp:35
Main class to generate compile-time array.
Definition: ct_array.hpp:171
has_calculateMem check if a type has defined a method called calculateMem
Definition: common.hpp:298
has_packRequest check if a type has defined a method called packRequest
Definition: common.hpp:278
return if true the aggregate type T has a property that has a complex packing(serialization) method
has_Pack check if a type has defined a method called Pack
Definition: common.hpp:240
Definition: util.hpp:14
is_openfpm_native check if a type is an openfpm native structure type
Definition: common.hpp:324
check if T::type and T.data has the same type
Definition: common.hpp:190
Transform the boost::fusion::vector into memory specification (memory_traits)
Definition: memory_conf.hpp:84
Transform the boost::fusion::vector into memory specification (memory_traits)
It model an expression expr1 * expr2.
Definition: mul.hpp:120
It create a boost::fusion vector with the selected properties.
It copy the properties from one object to another applying an operation.
It copy the properties from one object to another.
It copy the properties from one object to another.
This is a container to create a general object.
Define attribute names.
Definition: util_test.hpp:68
static const std::string name[2]
This test structure has 2 attribute names.
Definition: util_test.hpp:70
[Check has_posMask struct definition]
Definition: util_test.hpp:65
test type for has_max_prop
Definition: util_test.hpp:28
static const unsigned int max_prop
define that the type has 6 properties
Definition: util_test.hpp:30
test type for has_max_prop
Definition: util_test.hpp:35
[Check has_posMask struct definition]
Definition: util_test.hpp:44
static constexpr bool stag_mask[]
staggered mask
Definition: util_test.hpp:49
float data
unused
Definition: util_test.hpp:46
test type for has_posMask
Definition: util_test.hpp:54
float data
unused
Definition: util_test.hpp:56