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