Ocean
Loading...
Searching...
No Matches
TestUnidirectionalCorrespondences.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_TESTTRACKING_TEST_UNIDIRECTIONAL_CORRESPONDENCES_H
9#define META_OCEAN_TEST_TESTTRACKING_TEST_UNIDIRECTIONAL_CORRESPONDENCES_H
10
12
14
16
17namespace Ocean
18{
19
20namespace Test
21{
22
23namespace TestTracking
24{
25
26/**
27 * This class implements tests for the UnidirectionalCorrespondences class.
28 * @ingroup testtracking
29 */
30class OCEAN_TEST_TRACKING_EXPORT TestUnidirectionalCorrespondences
31{
32 protected:
33
34 /**
35 * Definition of an unordered map mapping indices to counters.
36 */
37 using IndexCounterMap = std::unordered_map<Index32, size_t>;
38
39 /**
40 * Definition of an unordered map mapping indices to indices.
41 */
42 using IndexConnectionMap = std::unordered_map<Index32, Indices32>;
43
44 /**
45 * Definition of an unordered set holding index pairs.
46 */
47 using IndexPairSet = std::unordered_set<IndexPair32, PairHash>;
48
49 public:
50
51 /**
52 * Starts all tests for the class.
53 * @param testDuration Number of seconds for each test, with range (0, infinity)
54 * @param worker The worker object
55 * @param selector The test selector
56 * @return True, if succeeded
57 */
58 static bool test(const double testDuration, Worker& worker, const TestSelector& selector);
59
60 /**
61 * Tests the function counting bijective correspondences.
62 * @param testDuration Number of seconds for each test, with range (0, infinity)
63 * @return True, if succeeded
64 */
65 static bool testCountBijectiveCorrespondences(const double testDuration);
66
67 /**
68 * Tests the function removing non-bijective correspondences.
69 * @param testDuration Number of seconds for each test, with range (0, infinity)
70 * @return True, if succeeded
71 */
72 static bool testRemoveNonBijectiveCorrespondences(const double testDuration);
73};
74
75}
76
77}
78
79}
80
81#endif // META_OCEAN_TEST_TESTTRACKING_TEST_UNIDIRECTIONAL_CORRESPONDENCES_H
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
This class implements tests for the UnidirectionalCorrespondences class.
Definition TestUnidirectionalCorrespondences.h:31
static bool testRemoveNonBijectiveCorrespondences(const double testDuration)
Tests the function removing non-bijective correspondences.
std::unordered_set< IndexPair32, PairHash > IndexPairSet
Definition of an unordered set holding index pairs.
Definition TestUnidirectionalCorrespondences.h:47
std::unordered_map< Index32, Indices32 > IndexConnectionMap
Definition of an unordered map mapping indices to indices.
Definition TestUnidirectionalCorrespondences.h:42
static bool testCountBijectiveCorrespondences(const double testDuration)
Tests the function counting bijective correspondences.
static bool test(const double testDuration, Worker &worker, const TestSelector &selector)
Starts all tests for the class.
std::unordered_map< Index32, size_t > IndexCounterMap
Definition of an unordered map mapping indices to counters.
Definition TestUnidirectionalCorrespondences.h:37
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
The namespace covering the entire Ocean framework.
Definition Accessor.h:15