9 #include <boost/test/unit_test.hpp>
20 namespace tt = boost::test_tools;
25 Vector3D edgePosition(0.5, 0.5, 0.5);
31 BOOST_CHECK_EQUAL(xUtil_eq.
bins(), (size_t)10);
34 xyUtil_eq += yUtil_eq;
35 BOOST_CHECK_EQUAL(xyUtil_eq.
bins(), 100
u);
38 xyzUtil_eq += zUtil_eq;
39 BOOST_CHECK_EQUAL(xyzUtil_eq.bins(), 1000
u);
43 BOOST_CHECK_EQUAL(xyzUtil_eq.dimensions(), 3
u);
46 auto xTriple = xUtil_eq.
binTriple(xyzPosition);
47 auto xyTriple = xyUtil_eq.
binTriple(xyzPosition);
48 auto xyzTriple = xyzUtil_eq.binTriple(xyzPosition);
50 BOOST_CHECK_EQUAL(xTriple[0], 1
u);
51 BOOST_CHECK_EQUAL(xTriple[1], 0
u);
52 BOOST_CHECK_EQUAL(xTriple[2], 0
u);
54 BOOST_CHECK_EQUAL(xyTriple[0], 1
u);
55 BOOST_CHECK_EQUAL(xyTriple[1], 2
u);
56 BOOST_CHECK_EQUAL(xyTriple[2], 0
u);
58 BOOST_CHECK_EQUAL(xyzTriple[0], 1
u);
59 BOOST_CHECK_EQUAL(xyzTriple[1], 2
u);
60 BOOST_CHECK_EQUAL(xyzTriple[2], 3
u);
63 std::vector<size_t> xRangeCheck0 = {0, 1, 2};
64 std::vector<size_t> xyRangeCheck1 = {1, 2, 3};
65 std::vector<size_t> xyzRangeCheck2 = {2, 3, 4};
68 BOOST_CHECK_EQUAL_COLLECTIONS(xNrange0.begin(), xNrange0.end(),
69 xRangeCheck0.begin(), xRangeCheck0.end());
72 BOOST_CHECK_EQUAL(xNrange1.size(), 1
u);
73 BOOST_CHECK_EQUAL(xNrange1[0], 0
u);
76 BOOST_CHECK_EQUAL(xNrange2.size(), 1
u);
77 BOOST_CHECK_EQUAL(xNrange2[0], 0
u);
80 BOOST_CHECK_EQUAL_COLLECTIONS(xyNrange1.begin(), xyNrange1.end(),
81 xyRangeCheck1.begin(), xyRangeCheck1.end());
83 auto xyzNrange2 = xyzUtil_eq.neighbourRange(xyzPosition, 2);
84 BOOST_CHECK_EQUAL_COLLECTIONS(xyzNrange2.begin(), xyzNrange2.end(),
85 xyzRangeCheck2.begin(), xyzRangeCheck2.end());
88 std::vector<size_t> xEdgeCheck = {0, 1};
90 BOOST_CHECK_EQUAL_COLLECTIONS(xEdgeRange.begin(), xEdgeRange.end(),
91 xEdgeCheck.begin(), xEdgeCheck.end());
95 Transform3D transform_LtoG = Transform3D::Identity();
100 Transform3D transform_GtoL = transform_LtoG.inverse();
108 noTranform += phiUtil;
112 withTranform += rUtil;
113 withTranform += phiUtil;
114 withTranform += zUtil;
122 for (
int i = 0; i < 3; i++) {
123 BOOST_CHECK_EQUAL(withTranform.
bin(pos1, i),
124 noTranform.
bin(transform_GtoL * pos1, i));
125 BOOST_CHECK_EQUAL(withTranform.
bin(pos2, i),
126 noTranform.
bin(transform_GtoL * pos2, i));
127 BOOST_CHECK_EQUAL(withTranform.
bin(pos3, i),
128 noTranform.
bin(transform_GtoL * pos3, i));
129 BOOST_CHECK_EQUAL(withTranform.
bin(pos4, i),
130 noTranform.
bin(transform_GtoL * pos4, i));
131 BOOST_CHECK_EQUAL(withTranform.
bin(pos5, i),
132 noTranform.
bin(transform_GtoL * pos5, i));