Matrix.CreateIdentity<T> Method

Returns an identity matrix of the specified dimension.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.7
C#
public static Matrix<T> CreateIdentity<T>(
	int dimension,
	MatrixStructure structure = MatrixStructure.General
)

Parameters

dimension  Int32
An integer greater than 0.
structure  MatrixStructure  (Optional)
Optional. A MatrixStructure value that specifies the structure of the matrix. The default is a full, dense matrix.

Type Parameters

T

Return Value

Matrix<T>
A matrix with dimension rows and columns that has ones on the main diagonal and is zero everywhere else.

See Also