Matrix.Random Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0

Overload List

Random(Int32, Int32, ArrayMutability) Creates a new matrix with uniform random numbers between 0 and 1.
Random(Int32, Int32, Random, ArrayMutability) Creates a new matrix with uniform random numbers between 0 and 1.

Random(Int32, Int32, ArrayMutability)

Creates a new matrix with uniform random numbers between 0 and 1.
C#
public static DenseMatrix<double> Random(
	int rowCount,
	int columnCount,
	ArrayMutability mutability = ArrayMutability.MutableValues
)

Parameters

rowCount  Int32
The number of rows in the new matrix.
columnCount  Int32
The number of columns in the new matrix.
mutability  ArrayMutability  (Optional)
Specifies how the matrix's values may be changed. The default is mutable values.

Return Value

DenseMatrix<Double>
A new DenseMatrix<T> with random values.

Exceptions

ArgumentOutOfRangeExceptionrowCount or columnCount is less than zero.

Random(Int32, Int32, Random, ArrayMutability)

Creates a new matrix with uniform random numbers between 0 and 1.
C#
public static DenseMatrix<double> Random(
	int rowCount,
	int columnCount,
	Random random,
	ArrayMutability mutability = ArrayMutability.MutableValues
)

Parameters

rowCount  Int32
The number of rows in the new matrix.
columnCount  Int32
The number of columns in the new matrix.
random  Random
A random number generator used to generate samples.
mutability  ArrayMutability  (Optional)
Specifies how the matrix's values may be changed. The default is mutable values.

Return Value

DenseMatrix<Double>
A new DenseMatrix<T> with random values.

Exceptions

ArgumentOutOfRangeExceptionrowCount or columnCount is less than zero.
ArgumentNullExceptionrandom is null.

See Also