Ocean
TestEstimator.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_TESTGEOMETRY_TEST_ESTIMATOR_H
9 #define META_OCEAN_TEST_TESTGEOMETRY_TEST_ESTIMATOR_H
10 
12 
13 #include "ocean/math/Numeric.h"
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestGeometry
22 {
23 
24 /**
25  * This class implements the test for the Estimator class of the geometry library.
26  * @ingroup testgeometry
27  */
28 class OCEAN_TEST_GEOMETRY_EXPORT TestEstimator
29 {
30  public:
31 
32  /**
33  * Tests the entire error functionality.
34  * @param testDuration Number of seconds for each test, with range (0, infinity)
35  * @return True, if succeeded
36  */
37  static bool test(const double testDuration);
38 
39  /**
40  * Tests the needSigma() function.
41  * @return True, if succeeded
42  */
43  static bool testNeedSigma();
44 
45  /**
46  * Tests the isStandardEstimator() function.
47  * @return True, if succeeded
48  */
49  static bool testIsStandardEstimator();
50 
51  /**
52  * Tests the robust error function.
53  * @param testDuration Number of seconds for each test, with range (0, infinity)
54  * @return True, if succeeded
55  */
56  static bool testRobustError(const double testDuration);
57 
58  /**
59  * Tests the robust weight function.
60  * @param testDuration Number of seconds for each test, with range (0, infinity)
61  * @return True, if succeeded
62  */
63  static bool testRobustWeight(const double testDuration);
64 
65  /**
66  * Tests the translate function.
67  * @return True, if succeeded
68  */
70 
71  protected:
72 
73  /**
74  * Returns whether the absolute value of a given first value is smaller than the absolute value of a given second value.
75  * @param firstValue The first value to compare, with range (-infinity, infinity)
76  * @param secondValue The second value to compare, with range (-infinity, infinity)
77  * @return True, if so
78  */
79  static inline bool compareAbsolute(const Scalar& firstValue, const Scalar& secondValue);
80 };
81 
82 inline bool TestEstimator::compareAbsolute(const Scalar& firstValue, const Scalar& secondValue)
83 {
84  return Numeric::abs(firstValue) < Numeric::abs(secondValue);
85 }
86 
87 }
88 
89 }
90 
91 }
92 
93 #endif // META_OCEAN_TEST_TESTGEOMETRY_TEST_ESTIMATOR_H
static T abs(const T value)
Returns the absolute value of a given value.
Definition: Numeric.h:1220
This class implements the test for the Estimator class of the geometry library.
Definition: TestEstimator.h:29
static bool test(const double testDuration)
Tests the entire error functionality.
static bool testIsStandardEstimator()
Tests the isStandardEstimator() function.
static bool testTranslateEstimatorType()
Tests the translate function.
static bool testRobustWeight(const double testDuration)
Tests the robust weight function.
static bool testNeedSigma()
Tests the needSigma() function.
static bool testRobustError(const double testDuration)
Tests the robust error function.
static bool compareAbsolute(const Scalar &firstValue, const Scalar &secondValue)
Returns whether the absolute value of a given first value is smaller than the absolute value of a giv...
Definition: TestEstimator.h:82
float Scalar
Definition of a scalar type.
Definition: Math.h:128
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15