MultithreadedRNG#
- class caput.algorithms.random.MultithreadedRNG(seed: int | None = None, threads: int | None = None, bitgen=None)[source]#
Bases:
numpy.random.GeneratorA multithreaded random number generator.
This wraps specific methods to allow generation across multiple threads. The following methods are supported:
random
integers
uniform
normal
standard_normal
poisson
power
- Parameters:
- seed
int|None, optional The seed to use.
- threads
int|None, optional The number of threads to use. If not set, this tries to get the number from the OMP_NUM_THREADS environment variable, or just uses 4 if that is also not set.
- bitgen
BitGenerator|None, optional The BitGenerator to use, if not set this uses _default_bitgen.
- seed