Matrix.GetLowerTriangularView Method

Definition

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

Overload List

GetLowerTriangularView<T>(Matrix<T>, MatrixDiagonal, ArrayMutability) Returns a view of the lower triangular part of a matrix.
GetLowerTriangularView<T>(Matrix<T>, Int32, Int32, MatrixDiagonal, ArrayMutability) Returns a view of the lower triangular part of a matrix with explicit dimensions.

GetLowerTriangularView<T>(Matrix<T>, MatrixDiagonal, ArrayMutability)

Returns a view of the lower triangular part of a matrix.
C#
public static Matrix<T> GetLowerTriangularView<T>(
	Matrix<T> source,
	MatrixDiagonal diagonal = MatrixDiagonal.NonUnitDiagonal,
	ArrayMutability mutability = ArrayMutability.Inherit
)

Parameters

source  Matrix<T>
The source matrix.
diagonal  MatrixDiagonal  (Optional)
A MatrixDiagonal value that specifies whether the diagonal elements are taken from the source or implied to be one. The default is NonUnitDiagonal.
mutability  ArrayMutability  (Optional)
The desired mutability of the view. Must not exceed the mutability of source. The default is Inherit.

Type Parameters

T
The element type of the matrix.

Return Value

Matrix<T>
A matrix that represents the lower triangular part of source. Elements outside the lower triangle read as zero. In Community edition this is a MatrixView<T>; in Professional edition this may be a TriangularMatrix<T> for dense sources.

Remarks

The returned view aliases the storage of source: no copy is made. Writes to elements inside the lower triangle are forwarded to the source; writes outside the triangle throw a ComponentReadOnlyException.

Exceptions

ArgumentNullException

source is null.

InvalidOperationException

mutability is more permissive than the mutability of source.

GetLowerTriangularView<T>(Matrix<T>, Int32, Int32, MatrixDiagonal, ArrayMutability)

Returns a view of the lower triangular part of a matrix with explicit dimensions.
C#
public static Matrix<T> GetLowerTriangularView<T>(
	Matrix<T> source,
	int rowCount,
	int columnCount,
	MatrixDiagonal diagonal = MatrixDiagonal.NonUnitDiagonal,
	ArrayMutability mutability = ArrayMutability.Inherit
)

Parameters

source  Matrix<T>
The source matrix.
rowCount  Int32
The number of rows of the view. Must be between 0 and the row count of source (inclusive).
columnCount  Int32
The number of columns of the view. Must be between 0 and the column count of source (inclusive).
diagonal  MatrixDiagonal  (Optional)
A MatrixDiagonal value that specifies whether the diagonal elements are taken from the source or implied to be one. The default is NonUnitDiagonal.
mutability  ArrayMutability  (Optional)
The desired mutability of the view. Must not exceed the mutability of source. The default is Inherit.

Type Parameters

T
The element type of the matrix.

Return Value

Matrix<T>
A rowCount×columnCount matrix that represents the lower triangular part of the leading submatrix of source. Elements outside the lower triangle read as zero.

Exceptions

ArgumentNullException

source is null.

ArgumentOutOfRangeException

rowCount is less than 0 or greater than the row count of source.

-or-

columnCount is less than 0 or greater than the column count of source.

See Also