public interface SymmetricPositiveMatrix extends SymmetricMatrix
Modifier and Type | Method and Description |
---|---|
SymmetricPositiveMatrix |
add(SymmetricPositiveMatrix m)
Returns the result of adding the symmetric positive semi-definite matrix
m to this
matrix. |
SymmetricPositiveMatrix |
copy()
Returns a deep copy of this matrix.
|
SymmetricPositiveMatrix |
createMatrix(int rowDimension,
int columnDimension)
Creates a new matrix of the same type as this matrix.
|
SymmetricPositiveMatrix |
getInverse()
Gets the inverse (or pseudo-inverse) of this matrix using the default decomposition.
|
SymmetricPositiveMatrix |
getInverse(Function<RealMatrix,Decomposition> decompositionBuilder)
Gets the inverse (or pseudo-inverse) of this matrix using the given decomposition algorithm.
|
SymmetricPositiveMatrix |
getSubMatrix(int[] indices)
Extracts the submatrix corresponding to the specified indices.
|
SymmetricPositiveMatrix |
getSubMatrix(int startIndex,
int endIndex)
Extracts the submatrix corresponding to the specified indices.
|
SymmetricPositiveMatrix |
positiveScalarAdd(double d)
Returns the result of adding a positive scalar
d to the entries of this matrix. |
SymmetricPositiveMatrix |
positiveScalarMultiply(double d)
Returns the result of multiplying the entries of this matrix by a positive scalar
d . |
SymmetricPositiveMatrix |
power(int p)
Returns the the result of multiplying this matrix with itself
p times. |
SymmetricPositiveMatrix |
quadraticMultiplication(RealMatrix m)
Returns the result of the quadratic multiplication M×
this ×MT,
where M is the provided matrix. |
SymmetricPositiveMatrix |
quadraticMultiplication(RealMatrix m,
boolean isTranspose)
Returns the result of the quadratic multiplication M×
this ×MT,
where M or MT is the provided matrix. |
SymmetricPositiveMatrix |
transpose()
Returns the transpose of this matrix.
|
SymmetricPositiveMatrix |
transpose(boolean forceCopy)
Returns the transpose of this matrix.
|
add, getDiagonal, scalarAdd, scalarMultiply, subtract
add, addToEntry, concatenateDiagonally, concatenateDiagonally, concatenateDiagonally, concatenateHorizontally, concatenateHorizontally, concatenateVertically, concatenateVertically, copySubMatrix, copySubMatrix, copySubMatrix, copySubMatrix, equals, getAbs, getColumn, getColumnMatrix, getColumnVector, getData, getData, getDefaultDecomposition, getEntry, getFrobeniusNorm, getMax, getMax, getMin, getMin, getNorm, getRow, getRowMatrix, getRowVector, getSubMatrix, getSubMatrix, getTrace, isAntisymmetric, isDiagonal, isInvertible, isOrthogonal, isSymmetric, isSymmetric, isSymmetric, multiply, multiply, multiply, multiplyEntry, operate, operate, preMultiply, preMultiply, preMultiply, setColumn, setColumnMatrix, setColumnVector, setDefaultDecomposition, setEntry, setRow, setRowMatrix, setRowVector, setSubMatrix, subtract, toString, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder
getColumnDimension, getRowDimension, isSquare
SymmetricPositiveMatrix add(SymmetricPositiveMatrix m)
m
to this
matrix.m
- the symmetric positive semi-definite matrix to be addedthis
+
m
MatrixDimensionMismatchException
- if the matrix m
is not the same size as this matrixSymmetricPositiveMatrix positiveScalarAdd(double d)
d
to the entries of this matrix.d
- the positive scalar value to be added to the entries of this matrixthis
+
d
SymmetricPositiveMatrix positiveScalarMultiply(double d)
d
.d
- the positive scalar value by which to multiply the entries of this matrix byd
×this
SymmetricPositiveMatrix copy()
copy
in interface RealMatrix
copy
in interface SymmetricMatrix
SymmetricPositiveMatrix quadraticMultiplication(RealMatrix m)
this
×MT,
where M is the provided matrix.quadraticMultiplication
in interface SymmetricMatrix
m
- the matrix Mthis
×MTSymmetricPositiveMatrix quadraticMultiplication(RealMatrix m, boolean isTranspose)
this
×MT,
where M or MT is the provided matrix.quadraticMultiplication
in interface SymmetricMatrix
m
- the matrix M or the matrix MTisTranspose
- if true
, assumes the provided matrix is MT, otherwise assumes it is
Mthis
×MTSymmetricPositiveMatrix getSubMatrix(int startIndex, int endIndex)
This method uses the same start/end indices to select the rows and columns to be extracted. These indices must be valid indices with respect to the dimensions of the matrix (valid indices range from 0 to n-1, with n the row/column dimension of the matrix). Calling this method is equivalent to calling RealMatrix.getSubMatrix(int, int, int, int) using the same start/end indices for the rows and columns. The extracted submatrix is guaranteed to be symmetric. It will also remain positive semi-definite if the initial matrix originally is.
Usage examples:
// Initial matrix matrix = [a00, a10, a20] [a10, a11, a21] [a20, a21, a22] // Submatrix extraction matrix.getSubMatrix(1, 2) => [a11, a21] [a21, a22]
getSubMatrix
in interface SymmetricMatrix
startIndex
- the initial row/column indexendIndex
- the final row/column index (inclusive)SymmetricPositiveMatrix getSubMatrix(int[] indices)
This method uses a single index array to select the rows and columns to be extracted. All indices must be valid indices with respect to the dimensions of the matrix (valid indices range from 0 to n-1, with n the row/column dimension of the matrix). The provided index array is allowed to contain duplicates. Calling this method is equivalent to calling RealMatrix.getSubMatrix(int[], int[]) using the provided index array for the selected rows and columns. This method can be used to extract any submatrix and perform a symmetric reordering of its rows/columns. The extracted submatrix is guaranteed to be symmetric. It will also remain positive semi-definite if the initial matrix originally is.
Usage examples:
// Initial matrix matrix = [a00, a10, a20] [a10, a11, a21] [a20, a21, a22] // Submatrix extraction matrix.getSubMatrix([1, 2]) => [a11, a21] [a21, a22] // Rows/Columns permutation matrix.getSubMatrix([1, 2, 0]) => [a11, a21, a10] [a21, a22, a20] [a10, a20, a00] // Submatrix extraction (with duplicated indices) matrix.getSubMatrix([1, 2, 0, 1, 0]) => [a11, a21, a10, a11, a10] [a21, a22, a20, a21, a20] [a10, a20, a00, a10, a00] [a11, a21, a10, a11, a10] [a10, a20, a00, a10, a00]
getSubMatrix
in interface SymmetricMatrix
indices
- the selected indicesSymmetricPositiveMatrix transpose()
transpose
in interface RealMatrix
transpose
in interface SymmetricMatrix
SymmetricPositiveMatrix transpose(boolean forceCopy)
If forceCopy
is true
, the returned matrix is guaranteed to be a new instance,
which can be modified without any risk of impacting the current instance. Otherwise, this
method may simply return the current instance when the matrix is its own transpose (symmetric
matrix).
transpose
in interface RealMatrix
transpose
in interface SymmetricMatrix
forceCopy
- if true
, the transpose of the matrix is systematically stored in a new matrix;
otherwise the method may return the current instance when the matrix is its own
transposeSymmetricPositiveMatrix power(int p)
p
times.
The exponent p
must be positive or equal to zero.
This operation is only supported for square matrices.
Depending on the underlying storage, numerical instabilities might occur for high powers.
power
in interface RealMatrix
power
in interface SymmetricMatrix
p
- the exponent p
to which this matrix is to be raisedp
SymmetricPositiveMatrix getInverse()
The default decomposition builder can be changed using the
setDefaultDecomposition
method.
getInverse
in interface RealMatrix
getInverse
in interface SymmetricMatrix
RealMatrix.getDefaultDecomposition()
,
RealMatrix.setDefaultDecomposition(Function)
SymmetricPositiveMatrix getInverse(Function<RealMatrix,Decomposition> decompositionBuilder)
The decomposition builder is a function capable of generating new instances of the decomposition algorithm to be used for the computation of the inverse matrix (like the QRDecomposition or the EigenDecomposition, for instance).
getInverse
in interface RealMatrix
getInverse
in interface SymmetricMatrix
decompositionBuilder
- the decomposition builder to useSymmetricPositiveMatrix createMatrix(int rowDimension, int columnDimension)
The returned matrix is filled with zeros. Its size is determined by the specified row and column dimensions, which must both be strictly positive. Additional constraints on the dimensions may apply depending on the implementation (for example, symmetric matrices must be square, which implies that the row and column dimensions must be equal).
Since the matrix build is a symmetric matrix, the row and column dimensions are expected to be equal.
createMatrix
in interface RealMatrix
createMatrix
in interface SymmetricMatrix
rowDimension
- the number of rows in the new matrixcolumnDimension
- the number of columns in the new matrixCopyright © 2023 CNES. All rights reserved.