Functions related to random number generation.
More...
|
| void | generateRandomControlTimes (double *controlTimes, const size_t numPoints) |
| | Generate random control times for cubic spline interpolation.
|
| |
| void | generateRandomControlPoints (double *controlPoints, const double maxValue, const size_t numPoints) |
| | Generate random control points for cubic spline interpolation.
|
| |
| int | random_int (int min, int max) |
| | Generate a random integer between min and max (inclusive).
|
| |
| double | randomExponentialSeconds (double minSeconds, double maxSeconds) |
| | Generate a random floating point value (seconds) between a minimum and maximum value.
|
| |
| void | shuffle (int arr[], int n) |
| | Shuffles the elements of an array.
|
| |
Functions related to random number generation.
◆ generateRandomControlPoints()
| void generateRandomControlPoints |
( |
double * | controlPoints, |
|
|
const double | maxValue, |
|
|
const size_t | numPoints ) |
Generate random control points for cubic spline interpolation.
- Parameters
-
| controlPoints | Pointer to an array to store the generated control points. |
| maxValue | The maximum value for generating random control points. |
| numPoints | The number of control points. |
◆ generateRandomControlTimes()
| void generateRandomControlTimes |
( |
double * | controlTimes, |
|
|
const size_t | numPoints ) |
Generate random control times for cubic spline interpolation.
- Parameters
-
| controlTimes | Pointer to an array to store the generated control times. |
| numPoints | The number of control points. |
◆ random_int()
| int random_int |
( |
int | min, |
|
|
int | max ) |
Generate a random integer between min and max (inclusive).
- Parameters
-
| min | The minimum value for the random integer (inclusive). |
| max | The maximum value for the random integer (inclusive). |
- Returns
- The generated random integer.
◆ randomExponentialSeconds()
| double randomExponentialSeconds |
( |
double | minSeconds, |
|
|
double | maxSeconds ) |
Generate a random floating point value (seconds) between a minimum and maximum value.
If the maximum is less than or equal to the minimum, returns the minimum value. Otherwise, computes an exponential distribution between the minimum and maximum values.
- Parameters
-
| minSeconds | The minimum value in seconds. |
| maxSeconds | The maximum value in seconds. |
- Returns
- A random floating point value in seconds.
◆ shuffle()
| void shuffle |
( |
int | arr[], |
|
|
int | n ) |
Shuffles the elements of an array.
This function shuffles the elements of the given array in place. It uses the Fisher-Yates shuffle algorithm.
- Parameters
-
| arr | The array to be shuffled. |
| n | The number of elements in the array. |