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