Package org.ejml.dense.block.linsol.qr
Class QrHouseHolderSolver_MT_DDRB
java.lang.Object
org.ejml.dense.block.linsol.qr.QrHouseHolderSolver_MT_DDRB
- All Implemented Interfaces:
LinearSolver<DMatrixRBlock,
,DMatrixRBlock> LinearSolverDense<DMatrixRBlock>
@Generated("org.ejml.dense.block.linsol.qr.QrHouseHolderSolver_DDRB")
public class QrHouseHolderSolver_MT_DDRB
extends Object
implements LinearSolverDense<DMatrixRBlock>
A solver for QRDecompositionHouseholder_MT_DDRB
. 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_MT_DDRB
protected DMatrixRBlock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIf a decomposition class was used internally then this will return that class.void
invert
(DMatrixRBlock 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
(DMatrixRBlock B, DMatrixRBlock X) Solves for X in the linear system, A*X=B.
-
Field Details
-
decomposer
-
QR
-
-
Constructor Details
-
QrHouseHolderSolver_MT_DDRB
public QrHouseHolderSolver_MT_DDRB()
-
-
Method Details
-
setA
Computes the QR decomposition of A and store the results in A.- Specified by:
setA
in interfaceLinearSolver<DMatrixRBlock,
DMatrixRBlock> - 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<DMatrixRBlock,
DMatrixRBlock> - 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<DMatrixRBlock,
DMatrixRBlock> - 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<DMatrixRBlock>
- 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<DMatrixRBlock,
DMatrixRBlock> - 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<DMatrixRBlock,
DMatrixRBlock> - 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<DMatrixRBlock,
DMatrixRBlock> - Returns:
- Internal decomposition class. If there is none then null.
-