9 #include <boost/test/unit_test.hpp>
18 namespace tt = boost::test_tools;
23 Vector3D edgePosition(0.5, 0.5, 0.5);
29 BOOST_CHECK_EQUAL(xUtil_eq.
bins(), (size_t)10);
32 xyUtil_eq += yUtil_eq;
33 BOOST_CHECK_EQUAL(xyUtil_eq.
bins(), 100
u);
36 xyzUtil_eq += zUtil_eq;
37 BOOST_CHECK_EQUAL(xyzUtil_eq.bins(), 1000
u);
41 BOOST_CHECK_EQUAL(xyzUtil_eq.dimensions(), 3
u);
44 auto xTriple = xUtil_eq.
binTriple(xyzPosition);
45 auto xyTriple = xyUtil_eq.
binTriple(xyzPosition);
46 auto xyzTriple = xyzUtil_eq.binTriple(xyzPosition);
48 BOOST_CHECK_EQUAL(xTriple[0], 1
u);
49 BOOST_CHECK_EQUAL(xTriple[1], 0
u);
50 BOOST_CHECK_EQUAL(xTriple[2], 0
u);
52 BOOST_CHECK_EQUAL(xyTriple[0], 1
u);
53 BOOST_CHECK_EQUAL(xyTriple[1], 2
u);
54 BOOST_CHECK_EQUAL(xyTriple[2], 0
u);
56 BOOST_CHECK_EQUAL(xyzTriple[0], 1
u);
57 BOOST_CHECK_EQUAL(xyzTriple[1], 2
u);
58 BOOST_CHECK_EQUAL(xyzTriple[2], 3
u);
61 std::vector<size_t> xRangeCheck0 = {0, 1, 2};
62 std::vector<size_t> xyRangeCheck1 = {1, 2, 3};
63 std::vector<size_t> xyzRangeCheck2 = {2, 3, 4};
66 BOOST_CHECK_EQUAL_COLLECTIONS(xNrange0.begin(), xNrange0.end(),
67 xRangeCheck0.begin(), xRangeCheck0.end());
70 BOOST_CHECK_EQUAL(xNrange1.size(), 1
u);
71 BOOST_CHECK_EQUAL(xNrange1[0], 0
u);
74 BOOST_CHECK_EQUAL(xNrange2.size(), 1
u);
75 BOOST_CHECK_EQUAL(xNrange2[0], 0
u);
78 BOOST_CHECK_EQUAL_COLLECTIONS(xyNrange1.begin(), xyNrange1.end(),
79 xyRangeCheck1.begin(), xyRangeCheck1.end());
81 auto xyzNrange2 = xyzUtil_eq.neighbourRange(xyzPosition, 2);
82 BOOST_CHECK_EQUAL_COLLECTIONS(xyzNrange2.begin(), xyzNrange2.end(),
83 xyzRangeCheck2.begin(), xyzRangeCheck2.end());
86 std::vector<size_t> xEdgeCheck = {0, 1};
88 BOOST_CHECK_EQUAL_COLLECTIONS(xEdgeRange.begin(), xEdgeRange.end(),
89 xEdgeCheck.begin(), xEdgeCheck.end());