|
CGVIS Utils
|
Simple random number utility wrapping std::mt19937 with common ranges.
More...
#include <random>#include <algorithm>Go to the source code of this file.
Classes | |
| class | Random |
Variables | |
| Random | staticRand |
| Global PRNG instance for convenience functions. | |
Simple random number utility wrapping std::mt19937 with common ranges.
Provides a small helper class, Random, for drawing floating-point values from frequently used ranges and for shuffling containers. The generator is an instance of std::mt19937 seeded either from std::random_device or an explicit seed. Distributions include [0,1), [-1,1), [0,\pi), [0,0.5), and [0.5,1).
Random is not inherently thread-safe. Guard access if you share a single instance across threads, or use thread-local instances.
|
extern |
Global PRNG instance for convenience functions.
Declared here and defined in a corresponding translation unit. Useful for quick sampling without managing an instance. Prefer explicit dependency injection for testability.