Documentation of 'org.ejml.alg.dense.decompose.qr.QrHelperFunctions_CD64' Java class
QrHelperFunctions_CD64
org.ejml.alg.dense.decompose.qr

Class QrHelperFunctions_CD64



  • public class QrHelperFunctions_CD64
    extends java.lang.Object

    Contains different functions that are useful for computing the QR decomposition of a matrix.

    Two different families of functions are provided for help in computing reflectors. Internally both of these functions switch between normalization by division or multiplication. Multiplication is most often significantly faster than division (2 or 3 times) but produces less accurate results on very small numbers. It checks to see if round off error is significant and decides which one it should do.

    Tests were done using the stability benchmark in jmatbench and there doesn't seem to be any advantage to always dividing by the max instead of checking and deciding. The most noticeable difference between the two methods is with very small numbers.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static double computeTauGammaAndDivide(int start, int stop, double[] x, double max, Complex64F tau)
      Performs the following operations:
      static void divideElements(int j, int numRows, double[] u, int startU, double realA, double imagA)
      Performs the following operation:
      u[(startU+j):(startU+numRows)] /= A
      were u and A are a complex
      static double findMax(double[] u, int startU, int length)
      Returns the maximum magnitude of the complex numbers
      static void rank1UpdateMultL(CDenseMatrix64F A, double[] u, double gammaR, double gammaI, int colA0, int w0, int w1)
      Performs a rank-1 update operation on the submatrix specified by w with the multiply on the left.

      A = A(I - γ*u*uH)
      static void rank1UpdateMultR(CDenseMatrix64F A, double[] u, int offsetU, double gammaR, int colA0, int w0, int w1, double[] _temp)
      Performs a rank-1 update operation on the submatrix specified by w with the multiply on the right.

      A = (I - γ*u*uH)*A
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QrHelperFunctions_CD64

        public QrHelperFunctions_CD64()
    • Method Detail

      • findMax

        public static double findMax(double[] u,
                                     int startU,
                                     int length)
        Returns the maximum magnitude of the complex numbers
        Parameters:
        u - Array of complex numbers
        startU - first index to consider in u
        length - Number of complex numebrs to consider
        Returns:
        magnitude
      • divideElements

        public static void divideElements(int j,
                                          int numRows,
                                          double[] u,
                                          int startU,
                                          double realA,
                                          double imagA)
        Performs the following operation:
        u[(startU+j):(startU+numRows)] /= A
        were u and A are a complex
      • computeTauGammaAndDivide

        public static double computeTauGammaAndDivide(int start,
                                                      int stop,
                                                      double[] x,
                                                      double max,
                                                      Complex64F tau)
        Performs the following operations:
         x = x / max
         tau = x0*|x|/|xo|   adjust sign to avoid cancelation
         u = x; u0 = x0 + tau; u = u/u0  (x is not divided by x0)
         gamma = 2/|u|^2
         
        Note that u is not explicitly computed here.
        Parameters:
        start - Element in 'u' that it starts at.
        stop - Element in 'u' that it stops at.
        x - Array
        max - Max value in 'u' that is used to normalize it.
        tau - Storage for tau
        Returns:
        Returns gamma
      • rank1UpdateMultR

        public static void rank1UpdateMultR(CDenseMatrix64F A,
                                            double[] u,
                                            int offsetU,
                                            double gammaR,
                                            int colA0,
                                            int w0,
                                            int w1,
                                            double[] _temp)

        Performs a rank-1 update operation on the submatrix specified by w with the multiply on the right.

        A = (I - γ*u*uH)*A

        Parameters:
        A - matrix
        u - vector
        offsetU - offset added to w0 when indexing u. Multiplied by 2 since complex.
        gammaR - real component of gamma
        colA0 - first column in A sub-matrix.
        w0 - first index in sub-array in u and row sub-matrix in A
        w1 - last index + 1 in sub-array in u and row sub-matrix in A
        _temp - temporary storage. Same size as u.
      • rank1UpdateMultL

        public static void rank1UpdateMultL(CDenseMatrix64F A,
                                            double[] u,
                                            double gammaR,
                                            double gammaI,
                                            int colA0,
                                            int w0,
                                            int w1)

        Performs a rank-1 update operation on the submatrix specified by w with the multiply on the left.

        A = A(I - γ*u*uH)

        The order that matrix multiplies are performed has been carefully selected to minimize the number of operations.

        Before this can become a truly generic operation the submatrix specification needs to be made more generic.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.