TriangularMatrix Class | Extreme Optimization Numerical Libraries for .NET Professional |

Extreme.Mathematics.LinearAlgebra

Extreme.Mathematics

Extreme.Mathematics.LinearAlgebra

**Namespace:**Extreme.Mathematics.LinearAlgebra

**Assembly:**Extreme.Numerics.Net40 (in Extreme.Numerics.Net40.dll) Version: 6.0.16073.0 (6.0.16312.0)

[SerializableAttribute] public sealed class TriangularMatrix : Matrix, IDoubleStorage, ISerializable

The TriangularMatrix type exposes the following members.

Name | Description | |
---|---|---|

AbsoluteMax |
Returns the value of the component in this
matrix that has the largest absolute
value.
(Inherited from Matrix.) | |

AbsoluteMin |
Returns the value of the component in this
matrix that has the smallest absolute
value.
(Inherited from Matrix.) | |

Add(Double) | Obsolete.
Adds a constant to a matrix and returns the result.
(Inherited from Matrix.) | |

Add(TransposeOperation, TransposeOperation, Double, Matrix) | (Inherited from Matrix.) | |

AddInPlace |
Adds a constant to a matrix.
(Inherited from Matrix.) | |

AddProductToVector | (Overrides Matrix | |

Apply(Func |
Applies a function to the elements of a matrix.
(Inherited from Matrix.) | |

ApplyInPlace(Func |
Applies a function to the elements of a matrix.
(Inherited from Matrix.) | |

ApplyInPlace(Matrix, Func |
Applies the specified function to each element in a matrix.
(Inherited from Matrix.) | |

ApplyToColumns(Func |
Applies a function to each column in a matrix and returns the result as a vector.
(Inherited from Matrix.) | |

ApplyToColumns(Func |
Applies a function to each column in a matrix and returns the result as a vector.
(Inherited from Matrix.) | |

ApplyToRows(Func |
Applies a function to each column in a matrix and returns the result as a vector.
(Inherited from Matrix.) | |

ApplyToRows(Func |
Applies a function to each column in a matrix and returns the result as a vector.
(Inherited from Matrix.) | |

AsDenseMatrix |
Returns this matrix as a dense matrix.
(Inherited from Matrix.) | |

AsGeneralMatrix | Obsolete.
Returns this matrix as a dense matrix.
(Inherited from Matrix.) | |

Clone |
Constructs a deep copy of this matrix.
(Inherited from Matrix.) | |

Clone(CloningMethod) |
Makes a copy of this vector using the specified
method.
(Inherited from Matrix.) | |

CloneData |
Gives this instance its own copy of its elements.
(Overrides Matrix | |

CloneData(MatrixElementOrder) |
Gives this instance its own copy of its elements.
| |

CloneShape |
Creates a new matrix that has the same number of rows and columns
and optionally preserves the writable structure.
(Inherited from Matrix.) | |

ComponentwiseDivide(Matrix) | Obsolete.
Divides the components of this instance by the corresponding
components of another matrix.
(Inherited from Matrix.) | |

ComponentwiseMultiply(Matrix) | Obsolete.
Multiplies the components of this instance by the corresponding
components of another matrix.
(Inherited from Matrix.) | |

CopyTo(Matrix) |
Copies the components of this matrix
to another matrix.
(Inherited from Matrix.) | |

CopyTo(Matrix, TransposeOperation) |
Copies the components of this matrix
to another matrix.
(Inherited from Matrix.) | |

ElementwiseDivideInPlace |
Divides the components of this instance by the corresponding
components of another matrix.
(Inherited from Matrix.) | |

ElementwiseMultiplyInPlace(Matrix) |
Multiplies the components of this instance by the corresponding
components of another matrix.
(Inherited from Matrix.) | |

Equals(Object) | (Inherited from Matrix.) | |

Equals(Matrix) | (Inherited from Matrix.) | |

Equals(Object, IEqualityComparer) |
Returns whether an object is structurally equal to this instance.
(Inherited from Matrix.) | |

EstimateConditionNumber |
Calculates an estimate for the condition
number of this TriangularMatrix.
(Overrides Matrix | |

ExtractLowerTriangle(DenseMatrix) |
Constructs a TriangularMatrix whose
elements are contained in the lower triangular portion
of a DenseMatrix.
| |

ExtractLowerTriangle(SymmetricMatrix) |
Constructs a TriangularMatrix whose
elements are contained in the lower triangular portion
of a SymmetricMatrix.
| |

ExtractLowerTriangle(DenseMatrix, MatrixDiagonal) |
Constructs a TriangularMatrix whose
elements are contained in the lower triangular portion
of a DenseMatrix.
| |

ExtractLowerTriangle(SymmetricMatrix, MatrixDiagonal) |
Constructs a TriangularMatrix whose
elements are contained in the lower triangular portion
of a SymmetricMatrix.
| |

ExtractLowerTriangle(DenseMatrix, Int32, Int32, MatrixDiagonal) |
Constructs a TriangularMatrix whose
elements are contained in the lower triangular portion
of a DenseMatrix.
| |

ExtractUpperTriangle(DenseMatrix) |
Constructs a TriangularMatrix whose
elements are contained in the triangleMode triangular portion
of a DenseMatrix.
| |

ExtractUpperTriangle(SymmetricMatrix) |
Constructs a TriangularMatrix whose
elements are contained in the lower triangular portion
of a SymmetricMatrix.
| |

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

ExtractUpperTriangle(SymmetricMatrix, MatrixDiagonal) |
Constructs an upper TriangularMatrix whose
elements are contained in the upper triangular portion
of a SymmetricMatrix.
| |

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

FrobeniusNorm |
Returns the Frobenius norm of this matrix.
(Inherited from Matrix.) | |

GetCholeskyDecomposition |
Returns the Cholesky decomposition of the matrix.
(Inherited from Matrix.) | |

GetCholeskyDecomposition(Boolean) |
Returns the Cholesky decomposition of the matrix.
(Inherited from Matrix.) | |

GetColumn(Int32) |
Returns a column vector for this instance
that points at the specified column.
(Inherited from Matrix.) | |

GetColumn(Int32, Range) |
Returns a column vector for this instance
starting at the specified column and row and of the
specified length.
(Inherited from Matrix.) | |

GetColumn(Int32, Int32, Int32) |
Returns a column vector for this instance
starting at the specified column and row and of the
specified length.
(Inherited from Matrix.) | |

GetColumn(Int32, Int32, Int32, Int32) |
Returns a column vector for this instance
starting at the specified column and row and of the
specified length.
(Inherited from Matrix.) | |

GetColumn(Int32, Int32, Int32, Int32, Intent) | ||

GetColumnEnumerator | Obsolete.
Gets an IEnumerator than can be used to enumerate
the columns of this Matrix.
(Inherited from Matrix.) | |

GetColumnEnumerator(Intent) | Obsolete.
Gets an IEnumerator than can be used to enumerate
the columns of this Matrix.
(Inherited from Matrix.) | |

GetColumnSums |
Returns the sums of the elements of each column of the matrix.
(Inherited from Matrix.) | |

GetComponents | Obsolete.
Gets the components of the vector.
(Inherited from Matrix.) | |

GetComponents(MatrixElementOrder) | Obsolete.
Gets the components of the vector.
(Inherited from Matrix.) | |

GetConditionNumber |
Calculates the condition
number of this matrix.
(Inherited from Matrix.) | |

GetDeterminant |
Calculates the determinant of this TriangularMatrix.
(Overrides Matrix | |

GetDiagonal |
Gets a vector view of the diagonal elements
of this instance.
(Inherited from Matrix.) | |

GetDiagonal(Int32) |
Gets a vector view of the specified diagonal
of this instance.
(Inherited from Matrix.) | |

GetDiagonal(Int32, Intent) |
Gets a vector view of the specified diagonal
of this instance.
(Overrides Matrix | |

GetEigenvalueDecomposition |
Returns the eigenvalue decomposition for this matrix.
(Inherited from Matrix.) | |

GetEigenvalueDecomposition(Boolean) |
Returns the eigenvalue decomposition for this matrix.
(Inherited from Matrix.) | |

GetExponential |
Computes the matrix exponential of a square matrix.
(Inherited from Matrix.) | |

GetHashCode |
Returns the hash code for this instance.
(Inherited from Matrix.) | |

GetHashCode(IEqualityComparer) |
Returns a hash code for this instance.
(Inherited from Matrix.) | |

GetInverse |
Calculates the inverse matrix..
(Inherited from LinearOperator.) | |

GetInverse(Boolean) |
Calculates the inverse matrix.
(Overrides Matrix | |

GetLUDecomposition |
Returns the LU decomposition of the matrix.
(Inherited from Matrix.) | |

GetLUDecomposition(Boolean) |
Returns the LU decomposition of the matrix.
(Overrides Matrix | |

GetObjectData |
Populates a SerializationInfo with the values
needed to serialize the target object.
(Overrides Matrix | |

GetParallelColumnEnumerator | Obsolete.
Returns a Partitioner (Inherited from Matrix.) | |

GetParallelRowEnumerator | Obsolete.
Returns a Partitioner (Inherited from Matrix.) | |

GetPseudoInverse |
Calculates the Moore-Penrose pseudo-inverse of this matrix.
(Inherited from Matrix.) | |

GetQRDecomposition |
Returns the QR decomposition of the matrix.
(Inherited from Matrix.) | |

GetQRDecomposition(Boolean) |
Returns the QR decomposition of the matrix.
(Overrides Matrix | |

GetRow(Int32) |
Returns a row vector for this instance
that points at the specified row.
(Inherited from Matrix.) | |

GetRow(Int32, Range) |
Returns a row vector for this instance
starting at the specified row and column and of the
specified length.
(Inherited from Matrix.) | |

GetRow(Int32, Int32, Int32) |
Returns a row vector for this instance
over the specified range.
(Inherited from Matrix.) | |

GetRow(Int32, Int32, Int32, Int32) |
Returns a row vector for this instance
starting at the specified row and column and of the
specified length.
(Inherited from Matrix.) | |

GetRow(Int32, Int32, Int32, Int32, Intent) |
Returns a row vector for this instance
starting at the specified row and column and of the
specified length.
(Overrides Matrix | |

GetRowEnumerator | Obsolete.
Returns an IEnumerator instance that allows you to
enumerate the rows of this Matrix.
(Inherited from Matrix.) | |

GetRowEnumerator(Intent) | Obsolete.
Returns an IEnumerator instance that allows you to
enumerate the rows of this Matrix.
(Inherited from Matrix.) | |

GetRowSums |
Returns the sums of the elements of each row of the matrix.
(Inherited from Matrix.) | |

GetSingularValueDecomposition |
Returns the singular value decomposition of the matrix.
(Inherited from Matrix.) | |

GetSingularValueDecomposition(SingularValueDecompositionFactors) |
Returns the singular value decomposition of the matrix.
(Inherited from Matrix.) | |

GetSingularValueDecomposition(SingularValueDecompositionFactors, Boolean) |
Returns the singular value decomposition of the matrix.
(Inherited from Matrix.) | |

GetSingularValues |
Gets a vector containing the singular values of the matrix.
(Inherited from Matrix.) | |

GetSubmatrix(Range, Range) | (Inherited from Matrix.) | |

GetSubmatrix(Range, Range, TransposeOperation) | (Inherited from Matrix.) | |

GetSubmatrix(Int32, Int32, Int32, Int32) | (Inherited from Matrix.) | |

GetSubmatrix(Int32, Int32, Int32, Int32, Int32, Int32, TransposeOperation) | (Inherited from Matrix.) | |

GetSymmetricIndefiniteDecomposition |
Returns the symmetric indefinite (Bunch-Kaufman) decomposition of the matrix.
(Inherited from Matrix.) | |

GetSymmetricIndefiniteDecomposition(Boolean) |
Returns the symmetric indefinite (Bunch-Kaufman) decomposition of the matrix.
(Inherited from Matrix.) | |

GetType | Gets the Type of the current instance. (Inherited from Object.) | |

GetValue |
Gets the matrix component at the specified position.
(Overrides Matrix | |

InfinityNorm |
Returns the infinity norm of this matrix.
(Inherited from Matrix.) | |

IsComponentWritable | Obsolete.
Returns whether the value of the component at
the specified row and column can be changed.
(Inherited from Matrix.) | |

IsElementWritable |
Returns whether the value of the component at
the specified row and column can be changed.
(Overrides Matrix | |

IsSingular |
Gets a value indicating whether the TriangularMatrix
is singular.
(Overrides Matrix | |

Max |
Returns the value of the largest component in this
matrix.
(Inherited from Matrix.) | |

Min |
Returns the value of the smallest component in this
matrix.
(Inherited from Matrix.) | |

Multiply(Double) |
Multiplies this matrix by a scalar factor.
(Overrides Matrix | |

Multiply(Matrix) | Applies the matrix to a matrix. (Inherited from Matrix.) | |

Multiply(Vector) | Applies the matrix to a vector. (Inherited from Matrix.) | |

Multiply(DenseMatrix, TriangularMatrix) |
Multiplies a DenseMatrix by a TriangularMatrix.
| |

Multiply(MatrixOperationSide, TransposeOperation, TransposeOperation, Matrix) |
Multiplies this matrix by another matrix and returns
the result.
(Overrides Matrix | |

MultiplyTranspose(Matrix) | Applies the transpose of the matrix to a matrix. (Inherited from Matrix.) | |

MultiplyTranspose(Vector) | Applies the transpose of the matrix to a vector. (Inherited from Matrix.) | |

OneNorm |
Returns the 1-norm of this matrix.
(Inherited from Matrix.) | |

PermuteColumns |
Permutes the columns of the matrix using the specified Permutation.
(Inherited from Matrix.) | |

PermuteRows |
Permutes the rows of the matrix using the specified Permutation.
(Inherited from Matrix.) | |

PermuteRowsAndColumns(Permutation) |
Permutes the rows and columns of the matrix using the specified Permutation.
(Inherited from Matrix.) | |

PermuteRowsAndColumns(Permutation, Permutation) |
Permutes the rows and columns of the matrix using the specified row and column Permutation.
(Inherited from Matrix.) | |

Rank |
Returns the numerical rank of a matrix.
(Inherited from LinearOperator.) | |

Rank(Double) |
Returns the numerical rank of a matrix using the specified tolerance.
(Inherited from Matrix.) | |

Reshape |
Returns a matrix that contains the same elements
listed columnwise.
(Inherited from Matrix.) | |

ReshapeAsVector |
Returns a vector that contains the columnwise matrix elements.
(Inherited from Matrix.) | |

ScaleColumns(Vector) |
Scales the columns of the matrix by the values specified by a vector.
(Inherited from Matrix.) | |

ScaleRows(Vector) |
Scales the rows of the matrix by the values specified by a vector.
(Inherited from Matrix.) | |

SetToZero |
Sets all elements of the matrix to zero.
(Inherited from Matrix.) | |

SetValue(Double) |
Sets all elements of the matrix to the specified value.
(Inherited from Matrix.) | |

SetValue(Double, Int32, Int32) |
Sets the matrix component at the specified position to the specified value.
(Overrides Matrix | |

ShallowCopy |
Makes a shallow copy of this matrix.
(Inherited from Matrix.) | |

Solve(Matrix) |
Solves the system of linear equations for the specified
right-hand side matrix.
(Inherited from LinearOperator.) | |

Solve(Vector) |
Solves the system of linear equations for the specified
right-hand side vector.
(Inherited from LinearOperator.) | |

Solve(DenseMatrix, Boolean) |
Solves a triangular system of equations that this
TriangularMatrix represents.
(Overrides Matrix | |

Solve(DenseVector, Boolean) |
Solves a triangular system of equations that this
TriangularMatrix represents.
(Overrides Matrix | |

SolveTo(DenseVector, DenseVector) |
Solves the system for the specified right-hand side.
(Inherited from LinearOperator.) | |

SolveTo(Vector, DenseVector) |
Solves the system for the specified right-hand side.
(Inherited from LinearOperator.) | |

SolveTranspose(Matrix) |
Solves the transposed system of linear equations for the specified
right-hand side matrix.
(Inherited from LinearOperator.) | |

SolveTranspose(Vector) |
Solves the system of linear equations for the specified
right-hand side vector.
(Inherited from LinearOperator.) | |

SolveTranspose(DenseMatrix, Boolean) |
Solves the transposed system of linear equations for the specified
right-hand side dense matrix and optionally overwrites the
right-hand side with the solution.
(Overrides Matrix | |

SolveTranspose(DenseVector, Boolean) |
Solves the transposed system of linear equations for the specified
right-hand side dense vector and optionally
overwrites the right-hand side with the solution.
(Overrides Matrix | |

SolveTransposeTo |
Solves the transposed system for the specified right-hand side.
(Inherited from LinearOperator.) | |

SortColumns |
Sorts each column of the matrix in ascending order.
(Inherited from Matrix.) | |

SortColumns(SortOrder) |
Sorts each column of the matrix in the specified order.
(Inherited from Matrix.) | |

SortRows |
Sorts each row of the matrix in ascending order.
(Inherited from Matrix.) | |

SortRows(SortOrder) |
Sorts each row of the matrix in the specified order.
(Inherited from Matrix.) | |

Summarize |
Returns a summary of the contents of the matrix using the default summary options.
(Inherited from Matrix.) | |

Summarize(SummaryOptions) |
Returns a summary of the contents of the matrix using the specified options.
(Inherited from Matrix.) | |

SwapColumns |
Swaps the columns with the specified indices.
(Inherited from Matrix.) | |

SwapRows |
Swaps the rows with the specified indices.
(Inherited from Matrix.) | |

ToArray |
Gets the elements of the vector.
(Inherited from Matrix.) | |

ToArray(MatrixElementOrder) |
Gets the elements of the vector.
(Inherited from Matrix.) | |

ToDenseMatrix |
Makes a copy of this instance and returns it as a
dense matrix.
(Inherited from Matrix.) | |

ToGeneralMatrix | Obsolete.
Makes a copy of this instance and returns it as a
dense matrix.
(Inherited from Matrix.) | |

ToString | (Inherited from Matrix.) | |

ToString(String) | (Inherited from Matrix.) | |

ToString(String, IFormatProvider) | (Inherited from Matrix.) | |

Trace |
Gets the sum of the diagonal elements of this
matrix.
(Inherited from Matrix.) | |

Transpose |
Returns the transpose of this instance.
(Overrides Matrix | |

TwoNorm |
Returns the two-norm of this matrix.
(Inherited from Matrix.) | |

UnscaleColumns(Vector) |
Scales the columns of the matrix by the inverse of the values specified by a vector.
(Inherited from Matrix.) | |

UnscaleRows(Vector) |
Scales the rows of the matrix by the inverse of the values specified by a vector.
(Inherited from Matrix.) |

Name | Description | |
---|---|---|

AsGenericMatrix |
Converts a non-generic matrix to a generic matrix.
(Defined by MatrixExtensions.) |

Use the TriangularMatrix class to represent dense matrices whose elements above or below the diagonal are zero. The name is derived from the shape of the non-zero elements, which form a triangle. However, this class also represents rectangular matrices, whose non-zero elements may form a trapezoid.

A TriangularMatrix can be either upper or lower-triangular, depending on which components are non-zero. This property is available as the TriangleMode property. It is of type MatrixTriangle, and must be specified at construction.

Sometimes, the components on the diagonal are all equal to one.
In this case, the matrix is said to be unit-diagonal, and the IsUnitDiagonal property
will be

Only the non-zero components of a triangular matrix can be modified. The diagonal components of a unit-diagonal matrix can't be modified. An attempt to do so will result in an ComponentReadOnlyException. You can verify if a component can be modified by calling the IsElementWritable(Int32, Int32) method.

The components of a TriangularMatrix are stored in a one-dimensional array of Double values. By default, components that are adjacent in a column of the matrix are adjacent in the storage array. The components are said to be stored in column major order. It is also possible to have elements stored in row major order.

Triangular matrices can be constructed from scratch, or they can be derived or *extracted*
from a DenseMatrix using one of the ExtractLowerTriangle(DenseMatrix, Int32, Int32, MatrixDiagonal)
or ExtractUpperTriangle(DenseMatrix) methods.

The rows and column vectors of a triangular matrix are of type BandVector.

The TriangularMatrix class implements algorithms using the triangular matrix BLAS and LAPACK routines. These routines assume matrix components are stored in column major order. However, any necessary conversions are performed transparantly. No additional work is needed. In some cases there might be a small performance penalty.

TriangularMatrix objects are used as properties of many matrix decompositions. Both factors of the LU decomposition are triangular. So is at least one factor of the Cholesky Decomposition and the QR Decomposition.

#### Numerical Libraries

Supported in: 5.x, 4.x#### Reference

Copyright © 2004-2021,
Extreme Optimization. All rights reserved.

*Extreme Optimization,* *Complexity made simple*, *M#*, and *M
Sharp* are trademarks of ExoAnalytics Inc.

*Microsoft*, *Visual C#, Visual Basic, Visual Studio*, *Visual
Studio.NET*, and the *Optimized for Visual Studio* logo

are
registered trademarks of Microsoft Corporation.