T
- type of the underlying field elementspublic class FieldQRDecomposition<T extends RealFieldElement<T>> extends Object
The QR-decomposition of a matrix A consists of two matrices Q and R that satisfy: A = QR, Q is orthogonal (QTQ = I), and R is upper triangular. If A is m×n, Q is m×m and R m×n.
This class compute the decomposition using Householder reflectors.
For efficiency purposes, the decomposition in packed form is transposed. This allows inner loop to iterate inside rows, which is much more cache-efficient in Java.
This class is based on the class QRDecomposition
.
Constructor | Description |
---|---|
FieldQRDecomposition(FieldMatrix<T> matrix) |
Calculates the QR-decomposition of the given matrix.
|
FieldQRDecomposition(FieldMatrix<T> matrix,
T threshold) |
Calculates the QR-decomposition of the given matrix.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
decompose(T[][] matrix) |
Decompose matrix.
|
FieldMatrix<T> |
getH() |
Returns the Householder reflector vectors.
|
FieldMatrix<T> |
getQ() |
Returns the matrix Q of the decomposition.
|
FieldMatrix<T> |
getQT() |
Returns the transpose of the matrix Q of the decomposition.
|
FieldMatrix<T> |
getR() |
Returns the matrix R of the decomposition.
|
FieldDecompositionSolver<T> |
getSolver() |
Get a solver for finding the A × X = B solution in least square sense.
|
protected void |
performHouseholderReflection(int minor,
T[][] matrix) |
Perform Householder reflection for a minor A(minor, minor) of A.
|
public FieldQRDecomposition(FieldMatrix<T> matrix)
matrix
- The matrix to decompose.FieldQRDecomposition(FieldMatrix, RealFieldElement)
public FieldQRDecomposition(FieldMatrix<T> matrix, T threshold)
matrix
- The matrix to decompose.threshold
- Singularity threshold.protected void decompose(T[][] matrix)
matrix
- transposed matrixprotected void performHouseholderReflection(int minor, T[][] matrix)
minor
- minor indexmatrix
- transposed matrixpublic FieldMatrix<T> getR()
R is an upper-triangular matrix
public FieldMatrix<T> getQ()
Q is an orthogonal matrix
public FieldMatrix<T> getQT()
Q is an orthogonal matrix
public FieldMatrix<T> getH()
H is a lower trapezoidal matrix whose columns represent each successive Householder reflector vector. This matrix is used to compute Q.
public FieldDecompositionSolver<T> getSolver()
Least Square sense means a solver can be computed for an overdetermined system,
(i.e. a system with more equations than unknowns, which corresponds to a tall A
matrix with more rows than columns). In any case, if the matrix is singular
within the tolerance set at construction
, an error will be triggered when
the solve
method will be called.
Copyright © 2016–2018 Hipparchus.org. All rights reserved.