Class UpperTriangularMatrix
Upper triangular matrix class
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Math
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[DataContract]
public class UpperTriangularMatrix : Matrix, IList<double>, ICollection<double>, IReadOnlyList<double>, IReadOnlyCollection<double>, IEnumerable<double>, IEnumerable, ICloneable, SettableTo<Matrix>, CanSetAllElementsTo<double>
Constructors
UpperTriangularMatrix()
Default constructor just used for serialization.
Declaration
protected UpperTriangularMatrix()
UpperTriangularMatrix(Double[,])
Constructs a matrix from data in a 2D array.
Declaration
public UpperTriangularMatrix(double[, ] data)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | data | 2D array of elements. |
Remarks
The 2D array is copied into new storage. The size of the matrix is taken from the array.
UpperTriangularMatrix(Int32, Int32)
Constructs a zero matrix of the given dimensions.
Declaration
public UpperTriangularMatrix(int nRows, int nCols)
Parameters
Type | Name | Description |
---|---|---|
Int32 | nRows | Number of rows >= 0. |
Int32 | nCols | Number of columns >= 0. |
UpperTriangularMatrix(Int32, Int32, Double[])
Constructs a matrix by referencing an array.
Declaration
public UpperTriangularMatrix(int nRows, int nCols, double[] data)
Parameters
Type | Name | Description |
---|---|---|
Int32 | nRows | Number of rows. |
Int32 | nCols | Number of columns. |
Double[] | data | Storage for the matrix elements. |
Methods
CheckUpperTriangular()
Check that this matrix is upper triangular
Declaration
public void CheckUpperTriangular()
Clone()
Creates a full clone of this upper triangular matrix
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
Object |
Overrides
Determinant()
Returns the determinant of this upper-triangular matrix.
Declaration
public double Determinant()
Returns
Type | Description |
---|---|
Double | The determinant of this. |
LogDeterminant()
Returns the natural logarithm of the determinant of this upper-triangular matrix.
Declaration
public double LogDeterminant()
Returns
Type | Description |
---|---|
Double | The log-determinant of this. |
ProdDiag()
Returns the product of diagonal elements.
Declaration
public double ProdDiag()
Returns
Type | Description |
---|---|
Double |
|
TraceLn()
Returns the sum of the logarithm of diagonal elements.
Declaration
public double TraceLn()
Returns
Type | Description |
---|---|
Double |
|
Transpose()
Return the transpose of this upper triangular matrix
Declaration
public LowerTriangularMatrix Transpose()
Returns
Type | Description |
---|---|
LowerTriangularMatrix |
TransposeInPlace(LowerTriangularMatrix)
Transposes a given lower triangular matrix in place.
Declaration
public static UpperTriangularMatrix TransposeInPlace(LowerTriangularMatrix L)
Parameters
Type | Name | Description |
---|---|---|
LowerTriangularMatrix | L | Matrix to transpose. Contents are corrupted on exit. |
Returns
Type | Description |
---|---|
UpperTriangularMatrix | An upper triangular wrapper of L's source array. |
Remarks
L is no longer a valid lower triangular matrix.