Ocean
Loading...
Searching...
No Matches
TestRandom.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_TESTMATH_TEST_RANDOM_H
9#define META_OCEAN_TEST_TESTMATH_TEST_RANDOM_H
10
12
14
16
17namespace Ocean
18{
19
20namespace Test
21{
22
23namespace TestMath
24{
25
26/**
27 * This class tests the performance of the random functionalities.
28 * @ingroup testmath
29 */
30class OCEAN_TEST_MATH_EXPORT TestRandom
31{
32 public:
33
34 /**
35 * Executes the entire random tests.
36 * @param testDuration Number of seconds for each test, with range (0, infinity)
37 * @param selector The test selector
38 * @return True, if succeeded
39 */
40 static bool test(const double testDuration, const TestSelector& selector);
41
42 /**
43 * Tests the performance of the standard random function using a single thread.
44 * @param testDuration Number of seconds for each test, with range (0, infinity)
45 * @return True, if succeeded
46 */
47 static bool testStandardRandomSingleThreaded(const double testDuration);
48
49 /**
50 * Tests the performance of the standard random function using multiple threads.
51 * @param testDuration Number of seconds for each test, with range (0, infinity)
52 * @return True, if succeeded
53 */
54 static bool testStandardRandomMultiThreaded(const double testDuration);
55
56 /**
57 * Tests the performance of the Ocean random function using a single thread.
58 * @param testDuration Number of seconds for each test, with range (0, infinity)
59 * @return True, if succeeded
60 */
61 static bool testOceanRandomSingleThreaded(const double testDuration);
62
63 /**
64 * Tests the performance of the Ocean random function using multiple threads.
65 * @param testDuration Number of seconds for each test, with range (0, infinity)
66 * @return True, if succeeded
67 */
68 static bool testOceanRandomMultiThreaded(const double testDuration);
69
70 /**
71 * Tests the performance of the standard triple random function.
72 * @param testDuration Number of seconds for each test, with range (0, infinity)
73 * @return True, if succeeded
74 */
75 static bool testStandardRandomTriple(const double testDuration);
76
77 /**
78 * Tests the performance of the Ocean triple random function.
79 * @param testDuration Number of seconds for each test, with range (0, infinity)
80 * @return True, if succeeded
81 */
82 static bool testOceanRandomTriple(const double testDuration);
83
84 /**
85 * Tests the random 3D vector with specified ranges function.
86 * @param testDuration Number of seconds for each test, with range (0, infinity)
87 * @return True, if succeeded
88 */
89 static bool testStandardRandomVector3(const double testDuration);
90
91 /**
92 * Tests the Ocean random 3D vector with specified ranges function.
93 * @param testDuration Number of seconds for each test, with range (0, infinity)
94 * @return True, if succeeded
95 */
96 static bool testOceanRandomVector3(const double testDuration);
97
98 /**
99 * Tests the random euler with specified range function.
100 * @param testDuration Number of seconds for each test, with range (0, infinity)
101 * @return True, if succeeded
102 */
103 static bool testStandardRandomEuler(const double testDuration);
104
105 /**
106 * Tests the Ocean random euler with specified range function.
107 * @param testDuration Number of seconds for each test, with range (0, infinity)
108 * @return True, if succeeded
109 */
110 static bool testOceanRandomEuler(const double testDuration);
111
112 private:
113
114 /**
115 * Calculates random variables for a subset of the given data using the standard random function.
116 * @param values Values receiving the random values
117 * @param firstValue First value to be handled
118 * @param numberValues Number of values to be handled
119 */
120 static void calculateStandardRandomValues(int* values, const unsigned int firstValue, const unsigned int numberValues);
121
122 /**
123 * Calculates random variables for a subset of the given data using an own implementation of the random function.
124 * @param generator Random number generator used for initialization of the local generator
125 * @param values Values receiving the random values
126 * @param firstValue First value to be handled
127 * @param numberValues Number of values to be handled
128 */
129 static void calculateOceanRandomValues(RandomGenerator* generator, int* values, const unsigned int firstValue, const unsigned int numberValues);
130};
131
132}
133
134}
135
136}
137
138#endif // META_OCEAN_TEST_TESTMATH_TEST_RANDOM_H
This class implements a generator for random numbers.
Definition RandomGenerator.h:42
This class tests the performance of the random functionalities.
Definition TestRandom.h:31
static bool testStandardRandomVector3(const double testDuration)
Tests the random 3D vector with specified ranges function.
static bool testOceanRandomMultiThreaded(const double testDuration)
Tests the performance of the Ocean random function using multiple threads.
static bool testOceanRandomVector3(const double testDuration)
Tests the Ocean random 3D vector with specified ranges function.
static bool testOceanRandomTriple(const double testDuration)
Tests the performance of the Ocean triple random function.
static bool test(const double testDuration, const TestSelector &selector)
Executes the entire random tests.
static void calculateOceanRandomValues(RandomGenerator *generator, int *values, const unsigned int firstValue, const unsigned int numberValues)
Calculates random variables for a subset of the given data using an own implementation of the random ...
static bool testStandardRandomSingleThreaded(const double testDuration)
Tests the performance of the standard random function using a single thread.
static bool testOceanRandomSingleThreaded(const double testDuration)
Tests the performance of the Ocean random function using a single thread.
static void calculateStandardRandomValues(int *values, const unsigned int firstValue, const unsigned int numberValues)
Calculates random variables for a subset of the given data using the standard random function.
static bool testStandardRandomTriple(const double testDuration)
Tests the performance of the standard triple random function.
static bool testStandardRandomEuler(const double testDuration)
Tests the random euler with specified range function.
static bool testStandardRandomMultiThreaded(const double testDuration)
Tests the performance of the standard random function using multiple threads.
static bool testOceanRandomEuler(const double testDuration)
Tests the Ocean random euler with specified range 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