Package org.ejml.dense.block.linsol.qr
Class QrHouseHolderSolver_MT_FDRB
java.lang.Object
org.ejml.dense.block.linsol.qr.QrHouseHolderSolver_MT_FDRB
- All Implemented Interfaces:
LinearSolver<FMatrixRBlock,,FMatrixRBlock> LinearSolverDense<FMatrixRBlock>
@Generated("org.ejml.dense.block.linsol.qr.QrHouseHolderSolver_FDRB")
public class QrHouseHolderSolver_MT_FDRB
extends Object
implements LinearSolverDense<FMatrixRBlock>
A solver for QRDecompositionHouseholder_MT_FDRB. Systems are solved for using the standard
QR decomposition method, sketched below.
A = Q*R
A*x = b
Q*R*x = b
R*x = y = QTb
x = R-1y
Where A is the m by n matrix being decomposed. Q is an orthogonal matrix. R is upper triangular matrix.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected QRDecompositionHouseholder_MT_FDRBprotected FMatrixRBlock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIf a decomposition class was used internally then this will return that class.voidinvert(FMatrixRBlock A_inv) Invert by solving for against an identity matrix.booleanReturns true if the passed in matrix toLinearSolver.setA(Matrix)is modified.booleanReturns true if the passed in 'B' matrix toLinearSolver.solve(Matrix, Matrix)is modified.doublequality()Computes the quality using diagonal elements the triangular R matrix in the QR decomposition.booleanComputes the QR decomposition of A and store the results in A.voidsolve(FMatrixRBlock B, FMatrixRBlock X) Solves for X in the linear system, A*X=B.
-
Field Details
-
decomposer
-
QR
-
-
Constructor Details
-
QrHouseHolderSolver_MT_FDRB
public QrHouseHolderSolver_MT_FDRB()
-
-
Method Details
-
setA
Computes the QR decomposition of A and store the results in A.- Specified by:
setAin interfaceLinearSolver<FMatrixRBlock,FMatrixRBlock> - Parameters:
A- The A matrix in the linear equation. Modified. Reference saved.- Returns:
- true if the decomposition was successful.
-
quality
public double quality()Computes the quality using diagonal elements the triangular R matrix in the QR decomposition.- Specified by:
qualityin interfaceLinearSolver<FMatrixRBlock,FMatrixRBlock> - Returns:
- Solutions quality.
-
solve
Description copied from interface:LinearSolverSolves for X in the linear system, A*X=B.
In some implementations 'B' and 'X' can be the same instance of a variable. Call
LinearSolver.modifiesB()to determine if 'B' is modified.- Specified by:
solvein interfaceLinearSolver<FMatrixRBlock,FMatrixRBlock> - Parameters:
B- A matrix ℜ m × p. Might be modified.X- A matrix ℜ n × p, where the solution is written to. Modified.
-
invert
Invert by solving for against an identity matrix.- Specified by:
invertin interfaceLinearSolverDense<FMatrixRBlock>- Parameters:
A_inv- Where the inverted matrix saved. Modified.
-
modifiesA
public boolean modifiesA()Description copied from interface:LinearSolverReturns true if the passed in matrix toLinearSolver.setA(Matrix)is modified.- Specified by:
modifiesAin interfaceLinearSolver<FMatrixRBlock,FMatrixRBlock> - Returns:
- true if A is modified in setA().
-
modifiesB
public boolean modifiesB()Description copied from interface:LinearSolverReturns true if the passed in 'B' matrix toLinearSolver.solve(Matrix, Matrix)is modified.- Specified by:
modifiesBin interfaceLinearSolver<FMatrixRBlock,FMatrixRBlock> - Returns:
- true if B is modified in solve(B,X).
-
getDecomposition
Description copied from interface:LinearSolverIf a decomposition class was used internally then this will return that class. Most linear solvers decompose the input matrix into a more simplistic form. However some solutions do not require decomposition, e.g. inverse by minor.- Specified by:
getDecompositionin interfaceLinearSolver<FMatrixRBlock,FMatrixRBlock> - Returns:
- Internal decomposition class. If there is none then null.
-