|
Veritable Lasagna
An Allocator & Data Structure Library for C.
|
Include dependency graph for vl_rand.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | VL_H_RANDOM_SPLIT(randPtr, resultPtr) (vlRandSplitBytes((randPtr), (resultPtr))) |
| #define | vlRandFx4(randPtr, resultPtr) |
| Generates four random floats. | |
Functions | |
| VL_API vl_rand | vlRandInit (void) |
| Initializes a random state (aka, seed) based on the current time. | |
| VL_API vl_rand | vlRandNext (vl_rand *rand) |
| Returns the "next" 64-bit integer. | |
| VL_API void | vlRandFill (vl_rand *rand, void *mem, vl_ularge_t len) |
| Fills the specified region of memory with random bytes. | |
| VL_API vl_float32_t | vlRandF (vl_rand *randPtr) |
| Generate a random float. | |
| VL_API void | vlRandFx2 (vl_rand *randPtr, vl_float32_t *resultPtr) |
| Generates two random floats. | |
| VL_API vl_float64_t | vlRandD (vl_rand *randPtr) |
| Generate a random double. | |
| #define VL_H_RANDOM_SPLIT | ( | randPtr, | |
| resultPtr | |||
| ) | (vlRandSplitBytes((randPtr), (resultPtr))) |
| #define vlRandFx4 | ( | randPtr, | |
| resultPtr | |||
| ) |
Generates four random floats.
Range of returned floats is in range of 0...1.
| randPtr | pointer to random state |
| resultPtr | where the result will be stored. |
| VL_API vl_float64_t vlRandD | ( | vl_rand * | randPtr | ) |
Generate a random double.
Range of returned value is in 0...1.
| randPtr | pointer to random state |
| VL_API vl_float32_t vlRandF | ( | vl_rand * | randPtr | ) |
Generate a random float.
Range of returned value is in 0...1.
| randPtr | pointer to random state |
Here is the call graph for this function:
Here is the caller graph for this function:| VL_API void vlRandFill | ( | vl_rand * | rand, |
| void * | mem, | ||
| vl_ularge_t | len | ||
| ) |
Fills the specified region of memory with random bytes.
This function operates on blocks of 8 bytes at a time, until it fills in the last few remaining bytes.
| rand | rand state |
| mem | destination |
| len | total number of bytes to fill. |
| VL_API void vlRandFx2 | ( | vl_rand * | randPtr, |
| vl_float32_t * | resultPtr | ||
| ) |
Generates two random floats.
Range of returned floats is in range of 0...1.
| randPtr | pointer to random state |
| resultPtr | where the result will be stored |
Here is the call graph for this function:| VL_API vl_rand vlRandInit | ( | void | ) |
Initializes a random state (aka, seed) based on the current time.
This function can be skipped entirely, assuming another seed integer can be provided.
Here is the call graph for this function:| VL_API vl_rand vlRandNext | ( | vl_rand * | rand | ) |
Returns the "next" 64-bit integer.
This function has a side effect of updating the random state.
| rand | pointer to random state |
Here is the caller graph for this function: