medusa.georgios.Distance_Geometry
Class QRDecomposition
- java.lang.Object
-
- medusa.georgios.Distance_Geometry.QRDecomposition
-
- All Implemented Interfaces:
- java.io.Serializable
public class QRDecomposition extends java.lang.Object implements java.io.SerializableQR Decomposition.For an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n orthogonal matrix Q and an n-by-n upper triangular matrix R so that A = Q*R.
The QR decompostion always exists, even if the matrix does not have full rank, so the constructor will never fail. The primary use of the QR decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if isFullRank() returns false.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description QRDecomposition(Distance_Geometry_Matrix A)QR Decomposition, computed by Householder reflections.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Distance_Geometry_MatrixgetH()Return the Householder vectorsDistance_Geometry_MatrixgetQ()Generate and return the (economy-sized) orthogonal factorDistance_Geometry_MatrixgetR()Return the upper triangular factorbooleanisFullRank()Is the matrix full rank?Distance_Geometry_Matrixsolve(Distance_Geometry_Matrix B)Least squares solution of A*X = B
-
-
-
Constructor Detail
-
QRDecomposition
public QRDecomposition(Distance_Geometry_Matrix A)
QR Decomposition, computed by Householder reflections.- Parameters:
A- Rectangular matrix
-
-
Method Detail
-
isFullRank
public boolean isFullRank()
Is the matrix full rank?- Returns:
- true if R, and hence A, has full rank.
-
getH
public Distance_Geometry_Matrix getH()
Return the Householder vectors- Returns:
- Lower trapezoidal matrix whose columns define the reflections
-
getR
public Distance_Geometry_Matrix getR()
Return the upper triangular factor- Returns:
- R
-
getQ
public Distance_Geometry_Matrix getQ()
Generate and return the (economy-sized) orthogonal factor- Returns:
- Q
-
solve
public Distance_Geometry_Matrix solve(Distance_Geometry_Matrix B)
Least squares solution of A*X = B- Parameters:
B- A Distance_Geometry_Matrix with as many rows as A and any number of columns.- Returns:
- X that minimizes the two norm of Q*R*X-B.
- Throws:
java.lang.IllegalArgumentException- Distance_Geometry_Matrix row dimensions must agree.java.lang.RuntimeException- Distance_Geometry_Matrix is rank deficient.
-
-
DMelt 3.0 © DataMelt by jWork.ORG