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://www.nag.com/numeric/nl/nagdoc_27.1/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() or init_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 (see dist_uniform01() for details) and applies the transformation

where 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) or init_nonrepeat() (for a non-repeatable sequence) must be called prior to the first call to int_uniform.

References

Knuth, D E, 1981, The Art of Computer Programming (Volume 2), (2nd Edition), Addison–Wesley