org.ejml.alg.block.linsol.qr
Class BlockQrHouseHolderSolver
- java.lang.Object
-
- org.ejml.alg.block.linsol.qr.BlockQrHouseHolderSolver
-
- All Implemented Interfaces:
- LinearSolver<BlockMatrix64F>
public class BlockQrHouseHolderSolver extends java.lang.Object implements LinearSolver<BlockMatrix64F>
A solver for
QRDecompositionHouseholder_B64. 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.
-
-
Constructor Summary
Constructors Constructor and Description BlockQrHouseHolderSolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description QRDecomposition<BlockMatrix64F>getDecomposition()If a decomposition class was used internally then this will return that class.voidinvert(BlockMatrix64F A_inv)Invert by solving for against an identity matrix.booleanmodifiesA()Returns true if the passed in matrix toLinearSolver.setA(org.ejml.data.Matrix)is modified.booleanmodifiesB()Returns true if the passed in 'B' matrix toLinearSolver.solve(org.ejml.data.Matrix, org.ejml.data.Matrix)is modified.doublequality()Computes the quality using diagonal elements the triangular R matrix in the QR decomposition.booleansetA(BlockMatrix64F A)Computes the QR decomposition of A and store the results in A.voidsolve(BlockMatrix64F B, BlockMatrix64F X)Solves for X in the linear system, A*X=B.
-
-
-
Method Detail
-
setA
public boolean setA(BlockMatrix64F A)
Computes the QR decomposition of A and store the results in A.- Specified by:
setAin interfaceLinearSolver<BlockMatrix64F>- 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<BlockMatrix64F>- Returns:
- Solutions quality.
-
solve
public void solve(BlockMatrix64F B, BlockMatrix64F X)
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<BlockMatrix64F>- Parameters:
B- A matrix ℜ m × p. Might be modified.X- A matrix ℜ n × p, where the solution is written to. Modified.
-
invert
public void invert(BlockMatrix64F A_inv)
Invert by solving for against an identity matrix.- Specified by:
invertin interfaceLinearSolver<BlockMatrix64F>- 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(org.ejml.data.Matrix)is modified.- Specified by:
modifiesAin interfaceLinearSolver<BlockMatrix64F>- 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(org.ejml.data.Matrix, org.ejml.data.Matrix)is modified.- Specified by:
modifiesBin interfaceLinearSolver<BlockMatrix64F>- Returns:
- true if B is modified in solve(B,X).
-
getDecomposition
public QRDecomposition<BlockMatrix64F> 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<BlockMatrix64F>- Returns:
- Internal decomposition class. If there is none then null.
-
-
DMelt 3.0 © DataMelt by jWork.ORG