mikera.matrixx.solve.impl.qr
Class QRHouseColSolver
- java.lang.Object
-
- mikera.matrixx.solve.impl.qr.QRHouseColSolver
-
public class QRHouseColSolver extends java.lang.ObjectQR decomposition can be used to solve for systems. However, this is not as computationally efficient as LU decomposition and costs about 3n2 flops.
It solve for x by first multiplying b by the transpose of Q then solving for the result.
QRx=b
Rx=Q^T b
A column major decomposition is used in this solver.
-
-
Constructor Summary
Constructors Constructor and Description QRHouseColSolver()Creates a linear solver that uses QR decomposition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description AMatrixgetA()doublequality()static doublequalityTriangular(boolean upper, AMatrix T)Computes the quality of a triangular matrix.booleansetA(AMatrix A)Performs QR decomposition on AvoidsetMaxSize(int maxRows, int maxCols)AMatrixsolve(AMatrix B)Solves for X using the QR decomposition.
-
-
-
Constructor Detail
-
QRHouseColSolver
public QRHouseColSolver()
Creates a linear solver that uses QR decomposition.
-
-
Method Detail
-
getA
public AMatrix getA()
-
setMaxSize
public void setMaxSize(int maxRows, int maxCols)
-
setA
public boolean setA(AMatrix A)
Performs QR decomposition on A- Parameters:
A- not modified.
-
quality
public double quality()
-
solve
public AMatrix solve(AMatrix B)
Solves for X using the QR decomposition.- Parameters:
B- A matrix that is n by m. Not modified.
-
qualityTriangular
public static double qualityTriangular(boolean upper, AMatrix T)Computes the quality of a triangular matrix. In this situation the quality is the absolute value of the product of each diagonal element divided by the magnitude of the largest diagonal element. If all diagonal elements are zero then zero is returned.- Parameters:
upper- if it is upper triangular or not.T- A matrix. @return product of the diagonal elements.- Returns:
- the quality of the system.
-
-
DMelt 3.0 © DataMelt by jWork.ORG