Class LinearSolverQr_DDRM

java.lang.Object
org.ejml.dense.row.linsol.LinearSolverAbstract_DDRM
org.ejml.dense.row.linsol.qr.LinearSolverQr_DDRM
All Implemented Interfaces:
org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DMatrixRMaj,​org.ejml.data.DMatrixRMaj>, org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.DMatrixRMaj>
Direct Known Subclasses:
AdjLinearSolverQr_DDRM

public class LinearSolverQr_DDRM
extends LinearSolverAbstract_DDRM

A solver for a generic QR decomposition algorithm. This will in general be a bit slower than the specialized once since the full Q and R matrices need to be extracted.

It solve for x by first multiplying b by the transpose of Q then solving for the result.
QRx=b
Rx=Q^T b

  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected int maxCols  
    protected int maxRows  
    protected org.ejml.data.DMatrixRMaj Q  
    protected org.ejml.data.DMatrixRMaj R  

    Fields inherited from class org.ejml.dense.row.linsol.LinearSolverAbstract_DDRM

    A, numCols, numRows
  • Constructor Summary

    Constructors 
    Constructor Description
    LinearSolverQr_DDRM​(org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.DMatrixRMaj> decomposer)
    Creates a linear solver that uses QR decomposition.
  • Method Summary

    Modifier and Type Method Description
    org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.DMatrixRMaj> getDecomposer()  
    org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.DMatrixRMaj> getDecomposition()  
    org.ejml.data.DMatrixRMaj getQ()  
    org.ejml.data.DMatrixRMaj getR()  
    boolean modifiesA()  
    boolean modifiesB()  
    double quality()  
    boolean setA​(org.ejml.data.DMatrixRMaj A)
    Performs QR decomposition on A
    void setMaxSize​(int maxRows, int maxCols)
    Changes the size of the matrix it can solve for
    void solve​(org.ejml.data.DMatrixRMaj B, org.ejml.data.DMatrixRMaj X)
    Solves for X using the QR decomposition.

    Methods inherited from class org.ejml.dense.row.linsol.LinearSolverAbstract_DDRM

    _setA, getA, invert

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • maxRows

      protected int maxRows
    • maxCols

      protected int maxCols
    • Q

      protected org.ejml.data.DMatrixRMaj Q
    • R

      protected org.ejml.data.DMatrixRMaj R
  • Constructor Details

    • LinearSolverQr_DDRM

      public LinearSolverQr_DDRM​(org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.DMatrixRMaj> decomposer)
      Creates a linear solver that uses QR decomposition.
  • Method Details

    • setMaxSize

      public void setMaxSize​(int maxRows, int maxCols)
      Changes the size of the matrix it can solve for
      Parameters:
      maxRows - Maximum number of rows in the matrix it will decompose.
      maxCols - Maximum number of columns in the matrix it will decompose.
    • setA

      public boolean setA​(org.ejml.data.DMatrixRMaj A)
      Performs QR decomposition on A
      Parameters:
      A - not modified.
    • quality

      public double quality()
    • solve

      public void solve​(org.ejml.data.DMatrixRMaj B, org.ejml.data.DMatrixRMaj X)
      Solves for X using the QR decomposition.
      Parameters:
      B - A matrix that is n by m. Not modified.
      X - An n by m matrix where the solution is written to. Modified.
    • modifiesA

      public boolean modifiesA()
    • modifiesB

      public boolean modifiesB()
    • getDecomposition

      public org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.DMatrixRMaj> getDecomposition()
    • getDecomposer

      public org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.DMatrixRMaj> getDecomposer()
    • getQ

      public org.ejml.data.DMatrixRMaj getQ()
    • getR

      public org.ejml.data.DMatrixRMaj getR()