Ocean
TestKdTree.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_TEST_TESTBASE_TEST_KD_TREE_H
9 #define META_OCEAN_TEST_TESTBASE_TEST_KD_TREE_H
10 
12 
13 namespace Ocean
14 {
15 
16 namespace Test
17 {
18 
19 namespace TestBase
20 {
21 
22 /**
23  * This class implements a k-d tree test.
24  * @ingroup testbase
25  */
26 class OCEAN_TEST_BASE_EXPORT TestKdTree
27 {
28  public:
29 
30  /**
31  * Tests all kd tree functions.
32  * @param testDuration Number of seconds for each test, with range (0, infinity)
33  * @return True, if succeeded
34  */
35  static bool test(const double testDuration);
36 
37  /**
38  * Tests the nearest neighbor search function.
39  * @param testDuration Number of seconds for each test, with range (0, infinity)
40  * @return True, if succeeded
41  * @tparam T Scalar type used internally (can be `float` or `double`)
42  */
43  template<typename T>
44  static bool testNearestNeighborInteger(const double testDuration);
45 
46  /**
47  * Tests the radius search function.
48  * @param testDuration Number of seconds for each test, with range (0, infinity)
49  * @return True, if succeeded
50  * @tparam T Scalar type used internally (can be `float` or `double`)
51  */
52  template<typename T>
53  static bool testRadiusSearchInteger(const double testDuration);
54 
55  private:
56 
57  /**
58  * Tests the nearest neighbor search function.
59  * @param number Number of elements
60  * @param dimension Dimensions of an element
61  * @param testDuration Number of seconds for each test, with range (0, infinity)
62  * @return True, if succeeded
63  * @tparam T Scalar type used internally (can be `float` or `double`)
64  */
65  template<typename T>
66  static bool testNearestNeighborInteger(const unsigned int number, const unsigned int dimension, const double testDuration);
67 
68  /**
69  * Tests the radius search function.
70  * @param number Number of elements
71  * @param dimension Dimensions of an element
72  * @param testDuration Number of seconds for each test, with range (0, infinity)
73  * @return True, if succeeded
74  * @tparam T Scalar type used internally (can be `float` or `double`)
75  */
76  template<typename T>
77  static bool testRadiusSearchInteger(const unsigned int number, const unsigned int dimension, const double testDuration);
78 };
79 
80 }
81 
82 }
83 
84 }
85 
86 #endif // META_OCEAN_TEST_TESTBASE_TEST_KD_TREE_H
This class implements a k-d tree test.
Definition: TestKdTree.h:27
static bool testRadiusSearchInteger(const unsigned int number, const unsigned int dimension, const double testDuration)
Tests the radius search function.
static bool testNearestNeighborInteger(const unsigned int number, const unsigned int dimension, const double testDuration)
Tests the nearest neighbor search function.
static bool test(const double testDuration)
Tests all kd tree functions.
static bool testRadiusSearchInteger(const double testDuration)
Tests the radius search function.
static bool testNearestNeighborInteger(const double testDuration)
Tests the nearest neighbor search function.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15