naginterfaces.library.rand.int_uniform¶
- naginterfaces.library.rand.int_uniform(n, a, b, statecomm)[source]¶
int_uniform
generates a vector of pseudorandom integers uniformly distributed over the interval .For full information please refer to the NAG Library document for g05tl
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g05/g05tlf.html
- Parameters
- nint
, the number of pseudorandom numbers to be generated.
- aint
The end points and of the uniform distribution.
- bint
The end points and of the uniform distribution.
- statecommdict, RNG communication object, modified in place
RNG communication structure.
This argument must have been initialized by a prior call to
init_repeat()
orinit_nonrepeat()
.
- Returns
- xint, ndarray, shape
The pseudorandom numbers from the specified uniform distribution.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, [‘state’] vector has been corrupted or not initialized.
- Notes
int_uniform
generates the next values from a uniform generator (seedist_uniform01()
for details) and applies the transformationwhere is the integer part of the real value . The function ensures that the values lie in the closed interval .
One of the initialization functions
init_repeat()
(for a repeatable sequence if computed sequentially) orinit_nonrepeat()
(for a non-repeatable sequence) must be called prior to the first call toint_uniform
.
- References
Knuth, D E, 1981, The Art of Computer Programming (Volume 2), (2nd Edition), Addison–Wesley