DenseMatrix<T>.ExtractUpperTriangle Method

Definition

Namespace: Numerics.NET.LinearAlgebra
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0

Overload List

ExtractUpperTriangle(MatrixDiagonal) Constructs a TriangularMatrix<T> whose elements are contained in the upper triangular portion of a DenseMatrix<T>.
ExtractUpperTriangle(Int32, Int32, MatrixDiagonal, Int32, Int32) Constructs a TriangularMatrix<T> whose elements are contained in the upper triangular portion of a DenseMatrix<T>.

ExtractUpperTriangle(MatrixDiagonal)

Constructs a TriangularMatrix<T> whose elements are contained in the upper triangular portion of a DenseMatrix<T>.
C#
public TriangularMatrix<T> ExtractUpperTriangle(
	MatrixDiagonal unitDiagonal = MatrixDiagonal.NonUnitDiagonal
)

Parameters

unitDiagonal  MatrixDiagonal  (Optional)
If true, the matrix is unit triangular. Only the elements below the diagonal in the matrix are considered. If false, the diagonal elements of the matrix are taken as the diagonal elements of the triangular matrix.

Return Value

TriangularMatrix<T>
A TriangularMatrix<T> whose elements are contained in the upper triangular portion of the matrix.

Exceptions

ArgumentNullException

the matrix is null.

ExtractUpperTriangle(Int32, Int32, MatrixDiagonal, Int32, Int32)

Constructs a TriangularMatrix<T> whose elements are contained in the upper triangular portion of a DenseMatrix<T>.
C#
public abstract TriangularMatrix<T> ExtractUpperTriangle(
	int rowCount,
	int columnCount,
	MatrixDiagonal unitDiagonal = MatrixDiagonal.NonUnitDiagonal,
	int startRow = 0,
	int startColumn = 0
)

Parameters

rowCount  Int32
The number of rows in the TriangularMatrix<T>.
columnCount  Int32
The number of columns in the TriangularMatrix<T>.
unitDiagonal  MatrixDiagonal  (Optional)
If true, the matrix is unit triangular. Only the elements below the diagonal in the matrix are considered. If false, the diagonal elements of the matrix are taken as the diagonal elements of the triangular matrix.
startRow  Int32  (Optional)
The row in the matrix of the first element of the new matrix.
startColumn  Int32  (Optional)
The column in the matrix of the first element of the new matrix.

Return Value

TriangularMatrix<T>
A TriangularMatrix<T> whose elements are contained in the lower triangular portion of the matrix.

Exceptions

ArgumentNullException

the matrix is null.

ArgumentOutOfRangeException

rowCount is less than zero or greater than or equal to the number of rows in the matrix.

-or-

columnCount is less than zero or greater than or equal to the number of columns in the matrix.

See Also