naginterfaces.library.rand.dist_​uniform

naginterfaces.library.rand.dist_uniform(n, a, b, statecomm)[source]

dist_uniform generates a vector of pseudorandom numbers uniformly distributed over the interval .

For full information please refer to the NAG Library document for g05sq

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/g05/g05sqf.html

Parameters
nint

, the number of pseudorandom numbers to be generated.

afloat

The end points and of the uniform distribution.

bfloat

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
xfloat, 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

If and , dist_uniform returns the next values from a uniform generator (see dist_uniform01() for details).

For other values of and , dist_uniform applies the transformation

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 dist_uniform.

References

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