Class LinearSolverQr_CDRM

  • All Implemented Interfaces:
    org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.CMatrixRMaj,​org.ejml.data.CMatrixRMaj>, org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.CMatrixRMaj>

    public class LinearSolverQr_CDRM
    extends LinearSolverAbstract_CDRM

    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^H b

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int maxCols  
      protected int maxRows  
      protected org.ejml.data.CMatrixRMaj Q  
      protected org.ejml.data.CMatrixRMaj Qt  
      protected org.ejml.data.CMatrixRMaj R  
    • Constructor Summary

      Constructors 
      Constructor Description
      LinearSolverQr_CDRM​(org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.CMatrixRMaj> 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.CMatrixRMaj> getDecomposer()  
      org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.CMatrixRMaj> getDecomposition()  
      org.ejml.data.CMatrixRMaj getQ()  
      org.ejml.data.CMatrixRMaj getR()  
      boolean modifiesA()  
      boolean modifiesB()  
      double quality()  
      boolean setA​(org.ejml.data.CMatrixRMaj 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.CMatrixRMaj B, org.ejml.data.CMatrixRMaj 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.CMatrixRMaj Q
      • Qt

        protected org.ejml.data.CMatrixRMaj Qt
      • R

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

      • LinearSolverQr_CDRM

        public LinearSolverQr_CDRM​(org.ejml.interfaces.decomposition.QRDecomposition<org.ejml.data.CMatrixRMaj> 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.CMatrixRMaj A)
        Performs QR decomposition on A
        Parameters:
        A - not modified.
      • quality

        public double quality()
      • solve

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

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

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

        public org.ejml.data.CMatrixRMaj getR()