Class LinearSolverQr_FDRM

  • All Implemented Interfaces:
    org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.FMatrixRMaj,​org.ejml.data.FMatrixRMaj>, org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj>
    Direct Known Subclasses:
    AdjLinearSolverQr_FDRM

    public class LinearSolverQr_FDRM
    extends LinearSolverAbstract_FDRM

    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.FMatrixRMaj Q  
      protected org.ejml.data.FMatrixRMaj R  
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.FMatrixRMaj> getDecomposer()  
      org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.FMatrixRMaj> getDecomposition()  
      org.ejml.data.FMatrixRMaj getQ()  
      org.ejml.data.FMatrixRMaj getR()  
      boolean modifiesA()  
      boolean modifiesB()  
      double quality()  
      boolean setA​(org.ejml.data.FMatrixRMaj 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.FMatrixRMaj B, org.ejml.data.FMatrixRMaj X)
      Solves for X using the QR decomposition.
      • Methods inherited from class java.lang.Object

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

      • maxRows

        protected int maxRows
      • maxCols

        protected int maxCols
      • Q

        protected org.ejml.data.FMatrixRMaj Q
      • R

        protected org.ejml.data.FMatrixRMaj R
    • Constructor Detail

      • LinearSolverQr_FDRM

        public LinearSolverQr_FDRM​(org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.FMatrixRMaj> decomposer)
        Creates a linear solver that uses QR decomposition.
    • Method Detail

      • 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.FMatrixRMaj A)
        Performs QR decomposition on A
        Parameters:
        A - not modified.
      • quality

        public double quality()
      • solve

        public void solve​(org.ejml.data.FMatrixRMaj B,
                          org.ejml.data.FMatrixRMaj 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.FMatrixRMaj> getDecomposition()
      • getDecomposer

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

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

        public org.ejml.data.FMatrixRMaj getR()