2.7 Randomly Generated Matrices

The module cvxopt.random provides functions for generating random matrices. Two types of random matrices are defined: matrices with normally distributed entries and matrices with uniformly distributed entries.

The pseudo-random number generators used to generate the random matrices are from the package described in the references below.

See Also:

S. Park, Random Number Generators.

S. Park, D. Geyer, Random Number Generators: Good Ones Are Hard To Find, Communications of the ACM, October 1988.

normal( nrows[, ncols[, mean[, std]]])
Returns a type 'd' matrix of size nrows by ncols with random elements chosen from a normal distribution with mean mean and standard deviation std. The default values for the optional arguments are ncols=1, mean=0.0, std=1.0.

uniform( nrows[, ncols[, a[, b]]])
Returns a type 'd' matrix of size nrows by ncols matrix with random elements, uniformly distributed between a and b. The default values for the optional arguments are ncols=1, a=0.0, b=1.0.

getseed( )
Returns the current seed value (the state of the random number generator).

setseed( [value])
Sets the seed value. value must be a nonnegative integer. If value is absent or equal to zero, the seed value is taken from the system clock.