Documentation of 'org.ejml.alg.dense.decomposition.svd.implicitqr.SvdImplicitQrAlgorithm' Java class
SvdImplicitQrAlgorithm
org.ejml.alg.dense.decomposition.svd.implicitqr

Class SvdImplicitQrAlgorithm

  • Direct Known Subclasses:
    SvdImplicitQrAlgorithmSmart


    public class SvdImplicitQrAlgorithm
    extends java.lang.Object

    Computes the QR decomposition of a bidiagonal matrix. Internally this matrix is stored as two arrays. Shifts can either be provided to it or it can generate the shifts on its own. It optionally computes the U and V matrices. This comparability allows it to be used to compute singular values and associated matrices efficiently.

    A = U*S*VT
    where A is the original m by n matrix.

    Based off of the outline provided in:

    David S. Watkins, "Fundamentals of Matrix Computations," Second Edition. Page 404-411

    Note: To watch it process the matrix step by step uncomment commented out code.

    • Constructor Detail

      • SvdImplicitQrAlgorithm

        public SvdImplicitQrAlgorithm(boolean fastValues)
      • SvdImplicitQrAlgorithm

        public SvdImplicitQrAlgorithm()
    • Method Detail

      • setMatrix

        public void setMatrix(int numRows,
                              int numCols,
                              double[] diag,
                              double[] off)
      • swapDiag

        public double[] swapDiag(double[] diag)
      • swapOff

        public double[] swapOff(double[] off)
      • setMaxValue

        public void setMaxValue(double maxValue)
      • initParam

        public void initParam(int M,
                              int N)
      • process

        public boolean process()
      • process

        public boolean process(double[] values)
        Perform a sequence of steps based off of the singular values provided.
        Parameters:
        values -
        Returns:
      • _process

        public boolean _process()
      • incrementSteps

        public void incrementSteps()
      • isOffZero

        public boolean isOffZero(int i)
      • isDiagonalZero

        public boolean isDiagonalZero(int i)
      • resetSteps

        public void resetSteps()
      • nextSplit

        public boolean nextSplit()
        Tells it to process the submatrix at the next split. Should be called after the current submatrix has been processed.
      • performImplicitSingleStep

        public void performImplicitSingleStep(double scale,
                                              double lambda,
                                              boolean byAngle)
        Given the lambda value perform an implicit QR step on the matrix. B^T*B-lambda*I
        Parameters:
        lambda - Stepping factor.
      • setSubmatrix

        public void setSubmatrix(int x1,
                                 int x2)
      • selectWilkinsonShift

        public double selectWilkinsonShift(double scale)
        Selects the Wilkinson's shift for BTB. See page 410. It is guaranteed to converge and converges fast in practice.
        Parameters:
        scale - Scale factor used to help prevent overflow/underflow
        Returns:
        Shifting factor lambda/(scale*scale)
      • exceptionShift

        public void exceptionShift()
        It is possible for the QR algorithm to get stuck in a loop because of symmetries. This happens more often with larger matrices. By taking a random step it can break the symmetry and finish.
      • printMatrix

        public void printMatrix()
      • getNumberOfSingularValues

        public int getNumberOfSingularValues()
      • getSingularValue

        public double getSingularValue(int index)
      • setFastValues

        public void setFastValues(boolean b)
      • getSingularValues

        public double[] getSingularValues()
      • getDiag

        public double[] getDiag()
      • getOff

        public double[] getOff()
      • getMaxValue

        public double getMaxValue()

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.