This class provides several random functions for different data types using a floating point type for its elements that is specified by T.
More...
|
| static T | sign () |
| | Returns a random sign (either +1 or -1).
|
| static T | sign (RandomGenerator &randomGenerator) |
| | Returns a random sign (either +1 or -1).
|
| static T | scalar (const T lower, const T upper) |
| | Returns a random number between two borders.
|
| static T | scalar (RandomGenerator &randomGenerator, const T lower, const T upper) |
| | Returns a random number between two borders using an explicit random generator.
|
| static T | gaussianNoise (const T sigma) |
| | Returns a random number with Gaussian distribution.
|
| static T | gaussianNoise (RandomGenerator &randomGenerator, const T sigma) |
| | Returns a random number with Gaussian distribution using an explicit random generator.
|
| static VectorT2< T > | gaussianNoiseVector2 (const T sigmaX, const T sigmaY) |
| | Returns a random 2D vector with Gaussian distribution.
|
| static VectorT2< T > | gaussianNoiseVector2 (RandomGenerator &randomGenerator, const T sigmaX, const T sigmaY) |
| | Returns a random 2D vector with Gaussian distribution using an explicit random generator.
|
| static VectorT2< T > | vector2 () |
| | Returns a random 2D vector with length 1 which is equal distributed within a circle.
|
| static VectorT2< T > | vector2 (RandomGenerator &randomGenerator) |
| | Returns a random 2D vector with length 1 which is equal distributed within a circle using an explicit random generator.
|
| static VectorT2< T > | vector2 (const T min, const T max) |
| | Returns a random 2D vector with coordinates in a given range.
|
| static VectorT2< T > | vector2 (RandomGenerator &randomGenerator, const T min, const T max) |
| | Returns a random 2D vector with coordinates in a given range using an explicit random generator.
|
| static VectorT2< T > | vector2 (const T xMin, const T xMax, const T yMin, const T yMax) |
| | Returns a random 2D vector with coordinates in a given range.
|
| static VectorT2< T > | vector2 (RandomGenerator &randomGenerator, const T xMin, const T xMax, const T yMin, const T yMax) |
| | Returns a random 2D vector with coordinates in a given range using an explicit random generator.
|
| static VectorT3< T > | vector3 () |
| | Returns a random 3D vector with length 1 which is equal distributed within a sphere.
|
| static VectorT3< T > | vector3 (RandomGenerator &randomGenerator) |
| | Returns a random 3D vector with length 1 which is equal distributed within a sphere using an explicit random generator.
|
| static VectorT3< T > | vector3 (const T min, const T max) |
| | Returns a random 3D vector with coordinates in a given range.
|
| static VectorT3< T > | vector3 (const VectorT3< T > &range) |
| | Returns a random 3D vector with coordinates in a given range.
|
| static VectorT3< T > | vector3 (RandomGenerator &randomGenerator, const T min, const T max) |
| | Returns a random 3D vector with coordinates in a given range using an explicit random generator.
|
| static VectorT3< T > | vector3 (RandomGenerator &randomGenerator, const VectorT3< T > &range) |
| | Returns a random 3D vector with coordinates in a given range using an explicit random generator.
|
| static VectorT3< T > | vector3 (RandomGenerator &randomGenerator, const T xMin, const T xMax, const T yMin, const T yMax, const T zMin, const T zMax) |
| | Returns a random 3D vector with coordinates in a given range using an explicit random generator.
|
| static VectorT4< T > | vector4 () |
| | Returns a random 4D vector with length 1 which is equal distributed within a hyper sphere.
|
| static VectorT4< T > | vector4 (RandomGenerator &randomGenerator) |
| | Returns a random 4D vector with length 1 which is equal distributed within a hyper sphere using an explicit random generator.
|
| static VectorT4< T > | vector4 (const T min, const T max) |
| | Returns a random 4D vector with coordinates in a given range.
|
| static VectorT4< T > | vector4 (RandomGenerator &randomGenerator, const T min, const T max) |
| | Returns a random 4D vector with coordinates in a given range using an explicit random generator.
|
| static QuaternionT< T > | quaternion () |
| | Returns a random rotation as unit quaternion.
|
| static QuaternionT< T > | quaternion (RandomGenerator &randomGenerator) |
| | Returns a random rotation as unit quaternion using an explicit random generator.
|
| static RotationT< T > | rotation () |
| | Returns a random rotation.
|
| static RotationT< T > | rotation (RandomGenerator &randomGenerator) |
| | Returns a random rotation using an explicit random generator.
|
| static EulerT< T > | euler () |
| | Returns a random euler.
|
| static EulerT< T > | euler (const T range) |
| | Returns a random euler with angles in a given range.
|
| static EulerT< T > | euler (const T minRange, const T maxRange) |
| | Returns a random euler with angles in a given range.
|
| static EulerT< T > | euler (RandomGenerator &randomGenerator) |
| | Returns a random euler using an explicit random generator.
|
| static EulerT< T > | euler (RandomGenerator &randomGenerator, const T range) |
| | Returns a random euler with angles in a given range using an explicit random generator.
|
| static EulerT< T > | euler (RandomGenerator &randomGenerator, const T minRange, const T maxRange) |
| | Returns a random euler with angles in a given range using an explicit random generator.
|
| Static Public Member Functions inherited from Ocean::RandomI |
| static void | initialize () |
| | Initializes the standard random generator for this thread with a time-based seed value.
|
| static void | initialize (const unsigned int value) |
| | Initializes the standard random generator for this thread with a user-defined seed value.
|
| static uint32_t | random32 () |
| | Returns one random integer number with range [0x00000000, 0xFFFFFFFF].
|
| static uint32_t | random32 (RandomGenerator &randomGenerator) |
| | Returns one random integer number with range [0x00000000, 0xFFFFFFFF] using an explicit random generator.
|
| static uint64_t | random64 () |
| | Returns one random integer number with range [0x00000000 00000000, 0xFFFFFFFF FFFFFFFF].
|
| static uint64_t | random64 (RandomGenerator &randomGenerator) |
| | Returns one random integer number with range [0x00000000 00000000, 0xFFFFFFFF FFFFFFFF] using an explicit random generator.
|
| static unsigned int | random (const unsigned int maxValue) |
| | Returns one random integer value with specified maximum value.
|
| static unsigned int | random (RandomGenerator &randomGenerator, const unsigned int maxValue) |
| | Returns one random integer value with specified maximum value using an explicit random generator.
|
| static int | random (const int lower, const int upper) |
| | Returns one random integer value within a specific range.
|
| static unsigned int | random (const unsigned int lower, const unsigned int upper) |
| | Returns one random integer value within a specific range.
|
| static int | random (RandomGenerator &randomGenerator, const int lower, const int upper) |
| | Returns one random integer value within a specific range using an explicit random generator.
|
| static unsigned int | random (RandomGenerator &randomGenerator, const unsigned int lower, const unsigned int upper) |
| | Returns one random integer value within a specific range using an explicit random generator.
|
| static void | random (const unsigned int maxValue, unsigned int &first, unsigned int &second) |
| | Returns two different random integer values with specified maximum value.
|
| static void | random (RandomGenerator &randomGenerator, const unsigned int maxValue, unsigned int &first, unsigned int &second) |
| | Returns two different random integer values with specified maximum value using an explicit random generator.
|
| static void | random (const unsigned int maxValue, unsigned int &first, unsigned int &second, unsigned int &third) |
| | Returns three different random integer values with specified maximum value.
|
| static void | random (RandomGenerator &randomGenerator, const unsigned int maxValue, unsigned int &first, unsigned int &second, unsigned int &third) |
| | Returns three different random integer values with specified maximum value using an explicit random generator.
|
| static bool | boolean () |
| | Returns a random bool value.
|
| static bool | boolean (RandomGenerator &randomGenerator) |
| | Returns a random bool value.
|
| template<typename T> |
| static T | random (const std::vector< T > &elements) |
| | Randomly returns one element from a given vector.
|
| template<typename T> |
| static T | random (const std::initializer_list< T > &elements) |
| | Randomly returns one element from a given initializer list.
|
| template<typename T> |
| static T | random (RandomGenerator &randomGenerator, const std::vector< T > &elements) |
| | Randomly returns one element from a given vector.
|
| template<typename T> |
| static T | random (RandomGenerator &randomGenerator, const std::initializer_list< T > &elements) |
| | Randomly returns one element from a given initializer list.
|
| static unsigned int | timeBasedSeed () |
| | Returns a seed value based on the current time.
|
template<typename T>
class Ocean::RandomT< T >
This class provides several random functions for different data types using a floating point type for its elements that is specified by T.
Beware: All function must not be used without a initialize() call for each thread!
- Template Parameters
-
| T | Data type of passed and generated values |
- See also
- Random, RandomF, RandomD.