randomgen.wrapper.UserBitGenerator.from_cfunc¶
-
classmethod UserBitGenerator.from_cfunc(next_raw, next_64, next_32, next_double, state, state_getter=
None
, state_setter=None
)¶ - from_cfunc(next_raw, next_64, next_32, next_double, state,
state_getter=None, state_setter=None)
Construct a bit generator from ctypes pointers
- Parameters:¶
- next_raw¶
A numba callback with a signature uint64(void) the return the next raw value from the underlying PRNG.
- next_64¶
A numba callback with a signature uint64(void) the return the next 64 bits from the underlying PRNG.
- next_32¶
A numba callback with a signature uint32(void) the return the next 32 bits from the underlying PRNG.
- next_double¶
A numba callback with a signature uint32(void) the return the next double in [0,1) from the underlying PRNG.
- state¶
A void pointer to the state. Passed to the next functions when generating random variates.
- state_getter=
None
¶ A callable that returns the state of the bit generator. If not provided, getting the
state
property will raise NotImplementedError.- state_setter=
None
¶ A callable that sets the state of the bit generator. Must take a single input. If not provided, getting the
state
property will raise NotImplementedError.
Notes
See the documentation for an example of a generator written using numba.