Class MatthewsDavies
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix
-
- dev.nm.algebra.linear.matrix.doubles.operation.positivedefinite.MatthewsDavies
-
- All Implemented Interfaces:
Matrix
,MatrixAccess
,MatrixRing
,MatrixTable
,Densifiable
,AbelianGroup<Matrix>
,Monoid<Matrix>
,Ring<Matrix>
,Table
,DeepCopyable
public class MatthewsDavies extends DenseMatrix
Matthews and Davies propose the following way to coerce a non-positive definite Hessian matrix to become symmetric, positive definite. An LDL decomposition is performed on the non-positive definite matrix. The zero and negative entries are then replaced by the smallest positive entry in the diagonal matrix.
-
-
Constructor Summary
Constructors Constructor Description MatthewsDavies(Matrix H)
Constructs a symmetric, positive definite matrix using the Matthews-Davies algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DiagonalMatrix
D()
Gets the diagonal matrix D in the LDL decomposition.DiagonalMatrix
Dhat()
Gets the modified diagonal matrix which is positive definite.LowerTriangularMatrix
L()
Gets the lower triangular matrix L in the LDL decomposition.UpperTriangularMatrix
Lt()
Gets the transpose of the lower triangular matrix L in the LDL decomposition.-
Methods inherited from class dev.nm.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix
add, deepCopy, equals, get, getColumn, getColumn, getRow, getRow, hashCode, minus, multiply, multiply, nCols, nRows, ONE, opposite, scaled, set, setColumn, setRow, t, toDense, toString, ZERO
-
-
-
-
Constructor Detail
-
MatthewsDavies
public MatthewsDavies(Matrix H)
Constructs a symmetric, positive definite matrix using the Matthews-Davies algorithm. This implementation replaces all zero or negative entries on the diagonal by the smallest positive entry on the diagonal. If all entries in the diagonal are negative, D becomes an identity matrix.- Parameters:
H
- a non-positive definite matrix
-
-
Method Detail
-
L
public LowerTriangularMatrix L()
Gets the lower triangular matrix L in the LDL decomposition.- Returns:
- L
-
Lt
public UpperTriangularMatrix Lt()
Gets the transpose of the lower triangular matrix L in the LDL decomposition. The transpose is upper triangular.- Returns:
- Lt
-
D
public DiagonalMatrix D()
Gets the diagonal matrix D in the LDL decomposition.- Returns:
- D
-
Dhat
public DiagonalMatrix Dhat()
Gets the modified diagonal matrix which is positive definite.- Returns:
- D^
-
-