Package org.ejml.dense.block.linsol.qr
Class QrHouseHolderSolver_FDRB
java.lang.Object
org.ejml.dense.block.linsol.qr.QrHouseHolderSolver_FDRB
- All Implemented Interfaces:
LinearSolver<FMatrixRBlock,
,FMatrixRBlock> LinearSolverDense<FMatrixRBlock>
@Generated("org.ejml.dense.block.linsol.qr.QrHouseHolderSolver_DDRB")
public class QrHouseHolderSolver_FDRB
extends Object
implements LinearSolverDense<FMatrixRBlock>
A solver for QRDecompositionHouseholder_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
Modifier and TypeFieldDescriptionprotected QRDecompositionHouseholder_FDRB
protected FMatrixRBlock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIf a decomposition class was used internally then this will return that class.void
invert
(FMatrixRBlock A_inv) Invert by solving for against an identity matrix.boolean
Returns true if the passed in matrix toLinearSolver.setA(Matrix)
is modified.boolean
Returns true if the passed in 'B' matrix toLinearSolver.solve(Matrix, Matrix)
is modified.double
quality()
Computes the quality using diagonal elements the triangular R matrix in the QR decomposition.boolean
Computes the QR decomposition of A and store the results in A.void
solve
(FMatrixRBlock B, FMatrixRBlock X) Solves for X in the linear system, A*X=B.
-
Field Details
-
decomposer
-
QR
-
-
Constructor Details
-
QrHouseHolderSolver_FDRB
public QrHouseHolderSolver_FDRB()
-
-
Method Details
-
setA
Computes the QR decomposition of A and store the results in A.- Specified by:
setA
in 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:
quality
in interfaceLinearSolver<FMatrixRBlock,
FMatrixRBlock> - Returns:
- Solutions quality.
-
solve
Description copied from interface:LinearSolver
Solves 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:
solve
in 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:
invert
in interfaceLinearSolverDense<FMatrixRBlock>
- Parameters:
A_inv
- Where the inverted matrix saved. Modified.
-
modifiesA
public boolean modifiesA()Description copied from interface:LinearSolver
Returns true if the passed in matrix toLinearSolver.setA(Matrix)
is modified.- Specified by:
modifiesA
in interfaceLinearSolver<FMatrixRBlock,
FMatrixRBlock> - Returns:
- true if A is modified in setA().
-
modifiesB
public boolean modifiesB()Description copied from interface:LinearSolver
Returns true if the passed in 'B' matrix toLinearSolver.solve(Matrix, Matrix)
is modified.- Specified by:
modifiesB
in interfaceLinearSolver<FMatrixRBlock,
FMatrixRBlock> - Returns:
- true if B is modified in solve(B,X).
-
getDecomposition
Description copied from interface:LinearSolver
If 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:
getDecomposition
in interfaceLinearSolver<FMatrixRBlock,
FMatrixRBlock> - Returns:
- Internal decomposition class. If there is none then null.
-