Ocean
Loading...
Searching...
No Matches
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
13
14namespace Ocean
15{
16
17namespace Test
18{
19
20namespace TestBase
21{
22
23/**
24 * This class implements a k-d tree test.
25 * @ingroup testbase
26 */
27class OCEAN_TEST_BASE_EXPORT TestKdTree
28{
29 public:
30
31 /**
32 * Tests all kd tree functions.
33 * @param testDuration Number of seconds for each test, with range (0, infinity)
34 * @param selector Test selector for filtering sub-tests; default runs all tests
35 * @return True, if succeeded
36 */
37 static bool test(const double testDuration, const TestSelector& selector = TestSelector());
38
39 /**
40 * Tests the nearest neighbor search function.
41 * @param testDuration Number of seconds for each test, with range (0, infinity)
42 * @return True, if succeeded
43 * @tparam T Scalar type used internally (can be `float` or `double`)
44 */
45 template<typename T>
46 static bool testNearestNeighborInteger(const double testDuration);
47
48 /**
49 * Tests the radius search function.
50 * @param testDuration Number of seconds for each test, with range (0, infinity)
51 * @return True, if succeeded
52 * @tparam T Scalar type used internally (can be `float` or `double`)
53 */
54 template<typename T>
55 static bool testRadiusSearchInteger(const double testDuration);
56
57 private:
58
59 /**
60 * Tests the nearest neighbor search function.
61 * @param number Number of elements
62 * @param dimension Dimensions of an element
63 * @param testDuration Number of seconds for each test, with range (0, infinity)
64 * @return True, if succeeded
65 * @tparam T Scalar type used internally (can be `float` or `double`)
66 */
67 template<typename T>
68 static bool testNearestNeighborInteger(const unsigned int number, const unsigned int dimension, const double testDuration);
69
70 /**
71 * Tests the radius search function.
72 * @param number Number of elements
73 * @param dimension Dimensions of an element
74 * @param testDuration Number of seconds for each test, with range (0, infinity)
75 * @return True, if succeeded
76 * @tparam T Scalar type used internally (can be `float` or `double`)
77 */
78 template<typename T>
79 static bool testRadiusSearchInteger(const unsigned int number, const unsigned int dimension, const double testDuration);
80};
81
82}
83
84}
85
86}
87
88#endif // META_OCEAN_TEST_TESTBASE_TEST_KD_TREE_H
This class implements a k-d tree test.
Definition TestKdTree.h:28
static bool testRadiusSearchInteger(const unsigned int number, const unsigned int dimension, const double testDuration)
Tests the radius search function.
static bool test(const double testDuration, const TestSelector &selector=TestSelector())
Tests all kd tree functions.
static bool testNearestNeighborInteger(const unsigned int number, const unsigned int dimension, const double testDuration)
Tests the nearest neighbor search function.
static bool testRadiusSearchInteger(const double testDuration)
Tests the radius search function.
static bool testNearestNeighborInteger(const double testDuration)
Tests the nearest neighbor search function.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
The namespace covering the entire Ocean framework.
Definition Accessor.h:15