Class GeneralizedInverse2

  • All Implemented Interfaces:
    java.io.Serializable

    public class GeneralizedInverse2
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double[][] A  
      private double eps  
      (package private) GeneralizedEigenvalue ge  
      private int[] iparms
      Found in routine xlaenv
      private double sfmin  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dbdsqr​(char uplo, int n, int ncvt, int nru, int ncc, double[] d, double[] e, double[][] VT, int ldvt, double[][] U, int ldu, double[][] C, int ldc, double[] work, int[] info)
      This is a port of version 3.2 LAPACK routine DBDSQR. -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- January 2007 ..
      void dbdt01​(int m, int n, int kd, double[][] A, int lda, double[][] Q, int ldq, double[] d, double[] e, double[][] PT, int ldpt, double[] work, double[] resid)
      This is a port of version 3.1 LAPACK test routine DBDT01.
      private void dbdt02​(int m, int n, double[][] B, int ldb, double[][] C, int ldc, double[][] U, int ldu, double[] work, double[] resid)
      This is a port of version 3.1 LAPACK test routine DBDT02.
      private void dbdt03​(char uplo, int n, int kd, double[] d, double[] e, double[][] U, int ldu, double[] s, double[][] VT, int ldvt, double[] work, double[] resid)
      This is a port of version 3.1 LAPACK test routine DBDT03.
      private void dchkbd​(int nsizes, int[] mval, int[] nval, int ntypes, boolean[] dotype, int nrhs, int[] iseed, double thresh, double[][] A, int lda, double[] bd, double[] be, double[] s1, double[] s2, double[][] X, int ldx, double[][] Y, double[][] Z, double[][] Q, int ldq, double[][] PT, int ldpt, double[][] U, double[][] VT, double[] work, int lwork, int[] iwork, int[] info)
      This is a port of most of version 3.1 LAPACK test routine DCHKBD.
      void dchkbd_test()
      This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive dchkbd in order to run dchkbd to test the singular value decomposition routines, dgebrd, dorgbr, and dbdsqr.
      private void dchklq​(boolean[] dotype, int nm, int[] mval, int nn, int[] nval, int nnb, int[] nbval, int[] nxval, int nrhs, double thresh, boolean tsterr, int nmax, double[][] A, double[][] AF, double[][] AQ, double[][] AL, double[][] AC, double[][] B, double[][] X, double[][] XACT, double[] tau, double[] work, double[] rwork, int[] iwork)
      This is a port of version 3.1 LAPACK test routine DCHKLQ.
      void dchklq_test()
      This dchklq_test routine is a port of a portion of the version 3.1.1 LAPACK test routine DCHKAA by Univ. of Tennessee, Univ.
      private void ddrvls​(boolean[] dotype, int nm, int[] mval, int nn, int[] nval, int nns, int[] nsval, int nnb, int[] nbval, int[] nxval, double thresh, boolean tsterr, double[][] A, double[][] COPYA, double[][] B, double[][] COPYB, double[][] C, double[] s, double[] copys, double[] work, int[] iwork)
      This is a port of that part of version 3.1.1 LAPACK test routine DDRVLS used for testing the least squares driver routine DGELSS.
      void ddrvls_test()
      This ddrvls_test routine is a port of a portion of the version 3.1.1 LAPACK test routine DCHKAA by Univ. of Tennessee, Univ.
      private void derrbd()
      This is a port of that portion of version 3.1 LAPACK test routine DERRBD used to test the error exits for dgebrd, dorgbr, dormbr, and dbdsqr.
      private void derrlq()
      This is a port of a portion of version 3.1 LAPACK routine DERRLQ
      private void derrls()
      This is a port of that portion of version 3.1 LAPACK test routine DERRLS used to test the error exits of the least squares driver routine DGELSS.
      void dgebd2​(int m, int n, double[][] A, int lda, double[] d, double[] e, double[] tauq, double[] taup, double[] work, int[] info)
      This is a port of version 3.2 LAPACK routine DGEBD2.
      void dgebrd​(int m, int n, double[][] A, int lda, double[] d, double[] e, double[] tauq, double[] taup, double[] work, int lwork, int[] info)  
      private void dgelq2​(int m, int n, double[][] A, int lda, double[] tau, double[] work, int[] info)
      This is a port of version 3.2 LAPACK routine DGELQ2 -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- November 2006 ..
      void dgelqf​(int m, int n, double[][] A, int lda, double[] tau, double[] work, int lwork, int[] info)
      This is a port of version 3.2 LAPACK routine DGELQF -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- November 2006 ..
      private void dgelqs​(int m, int n, int nrhs, double[][] A, int lda, double[] tau, double[][] B, int ldb, double[] work, int lwork, int[] info)
      This is a port of version 3.1 LAPACK routine DGELQS.
      void dgels​(char trans, int m, int n, int nrhs, double[][] A, int lda, double[][] B, int ldb, double[] work, int lwork, int[] info)  
      void dgelss​(int m, int n, int nrhs, double[][] A, int lda, double[][] B, int ldb, double[] s, double rcond, int[] rank, double[] work, int lwork, int[] info)  
      private void dlabrd​(int m, int n, int nb, double[][] A, int lda, double[] d, double[] e, double[] tauq, double[] taup, double[][] X, int ldx, double[][] Y, int ldy)  
      void dlaord​(char job, int n, double[] x, int incx)
      This is a port of version 3.1 LAPACK auxiliary routine DLAORD.
      private void dlaror​(char side, char init, int m, int n, double[][] A, int lda, int[] iseed, double[] x, int[] info)
      This is a port of version 3.1 LAPACK auxiliary test routine DLAROR.
      private void dlas2​(double[] f, double[] g, double[] h, double[] ssmin, double[] ssmax)
      This is a port of version 3.2 LAPACK auxiliary routine DLAS2.
      private void dlasq1​(int n, double[] d, double[] e, double[] work, int[] info)
      This is a port of version 3.2 LAPACK routine DLASQ1. -- -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- ..
      private void dlasq2​(int n, double[] z, int[] info)
      This is a port of version 3.2 LAPACK routine DLASQ2. -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- ..
      private void dlasq3​(int[] i0, int[] n0, double[] z, int[] pp, double[] dmin, double[] sigma, double[] desig, double qmax, int[] nfail, int[] iter, int[] ndiv, boolean ieee, int[] ttype, double[] dmin1, double[] dmin2, double[] dn, double[] dn1, double[] dn2, double[] g, double[] tau)
      This is a port of version 3.2 LAPACK routine DLASQ3 -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- ..
      private void dlasq4​(int i0, int n0, double[] z, int pp, int n0in, double dmin, double dmin1, double dmin2, double dn, double dn1, double dn2, double[] tau, int[] ttype, double[] g)
      This is a port of version 3.2 LAPACK routine DLASQ4. -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- ..
      private void dlasq5​(int i0, int n0, double[] z, int pp, double tau, double[] dmin, double[] dmin1, double[] dmin2, double[] dn, double[] dnm1, double[] dnm2, boolean ieee)
      This is a port of version 3.2 LAPACK routine DLASQ5 -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- ..
      private void dlasq6​(int i0, int n0, double[] z, int pp, double[] dmin, double[] dmin1, double[] dmin2, double[] dn, double[] dnm1, double[] dnm2)
      This is a port of version 3.2 LAPACK routine DLASQ6. -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- ..
      private void dlqt01​(int m, int n, double[][] A, double[][] AF, double[][] Q, double[][] L, int lda, double[] tau, double[] work, int lwork, double[] rwork, double[] result)
      This is a port of the version 3.1 LAPACK test routine DLQT01.
      private void dlqt02​(int m, int n, int k, double[][] A, double[][] AF, double[][] Q, double[][] L, int lda, double[] tau, double[] work, int lwork, double[] rwork, double[] result)
      This is a port of version 3.1 LAPACK routine DLQT02.
      private void dlqt03​(int m, int n, int k, double[][] AF, double[][] C, double[][] CC, double[][] Q, int lda, double[] tau, double[] work, int lwork, double[] rwork, double[] result)
      This is a port of version 3.1 LAPACK test routine DLQT03.
      void dorgbr​(char vect, int m, int n, int k, double[][] A, int lda, double[] tau, double[] work, int lwork, int[] info)
      This is a port of version 3.2 LAPACK routine DORGBR.
      private void dorgl2​(int m, int n, int k, double[][] A, int lda, double[] tau, double[] work, int[] info)  
      void dorglq​(int m, int n, int k, double[][] A, int lda, double[] tau, double[] work, int lwork, int[] info)
      This is a port of version 3.2 LAPACK routine DORGLQ.
      void dormbr​(char vect, char side, char trans, int m, int n, int k, double[][] A, int lda, double[] tau, double[][] C, int ldc, double[] work, int lwork, int[] info)  
      private void dorml2​(char side, char trans, int m, int n, int k, double[][] A, int lda, double[] tau, double[][] C, int ldc, double[] work, int[] info)  
      private void dormlq​(char side, char trans, int m, int n, int k, double[][] A, int lda, double[] tau, double[][] C, int ldc, double[] work, int lwork, int[] info)  
      void dort01​(char rowcol, int m, int n, double[][] U, int ldu, double[][] work, int lwork, double[] resid)
      This is the port of version 3.1 LAPACK test routine DORT01.
      private void dqrt13​(int scale, int m, int n, double[][] A, int lda, double[] norma, int[] iseed)  
      private double dqrt14​(char trans, int m, int n, int nrhs, double[][] A, int lda, double[][] X, int ldx, double[] work, int lwork)
      This is a port of version 3.1 LAPACK test routine DQRT14.
      private void dqrt15​(int scale, int rksel, int m, int n, int nrhs, double[][] A, int lda, double[][] B, int ldb, double[] s, int[] rank, double[] norma, double[] normb, int[] iseed, double[] work, int lwork)
      This is a port of version 3.1 LAPACK test routine DQRt15.
      private void dqrt16​(char trans, int m, int n, int nrhs, double[][] A, int lda, double[][] X, int ldx, double[][] B, int ldb, double[] rwork, double[] resid)
      This is a port of version 3.1 LAPACK test routine DQRT16.
      private double dqrt17​(char trans, int iresid, int m, int n, int nrhs, double[][] A, int lda, double[][] X, int ldx, double[][] B, int ldb, double[][] C)
      This is a port of version 3.1 LAPACK test routine DQRT17.
      void drscl​(int n, double sa, double[] sx, int incx)
      This is a port of version 3.2 LAPACK auxiliary routine DRSCL. -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- November 2006 ..
      private void dsvdch​(int n, double[] s, double[] e, double[] svd, double tol, int[] info)
      This is a port of version 3.1 LAPACK test routine DSVDCH.
      private void dsvdct​(int n, double[] s, double[] e, double shift, int[] num)
      This is a port of version 3.1 LAPACK test routine DSVDCT.
      private void dtrtrs​(char uplo, char trans, char diag, int n, int nrhs, double[][] A, int lda, double[][] B, int ldb, int[] info)  
      double[][] pinv()
      Slight modification of pinv in dtiFitTensor.c.
      private void xlaenv​(int ispec, int nvalue)
      This is a port of version 3.1 LAPACK auxiliary routine XLAENV.
      • Methods inherited from class java.lang.Object

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

      • A

        private double[][] A
      • eps

        private double eps
      • sfmin

        private double sfmin
      • iparms

        private int[] iparms
        Found in routine xlaenv
    • Constructor Detail

      • GeneralizedInverse2

        public GeneralizedInverse2()
      • GeneralizedInverse2

        public GeneralizedInverse2​(double[][] A1,
                                   int NR,
                                   int NC)
    • Method Detail

      • pinv

        public double[][] pinv()
        Slight modification of pinv in dtiFitTensor.c. This is an interface to the Java port of dgelss.
        Returns:
        n by m pseudoinverse of m by n matrix A
      • dgels

        public void dgels​(char trans,
                          int m,
                          int n,
                          int nrhs,
                          double[][] A,
                          int lda,
                          double[][] B,
                          int ldb,
                          double[] work,
                          int lwork,
                          int[] info)
      • dtrtrs

        private void dtrtrs​(char uplo,
                            char trans,
                            char diag,
                            int n,
                            int nrhs,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            int[] info)
      • dgelss

        public void dgelss​(int m,
                           int n,
                           int nrhs,
                           double[][] A,
                           int lda,
                           double[][] B,
                           int ldb,
                           double[] s,
                           double rcond,
                           int[] rank,
                           double[] work,
                           int lwork,
                           int[] info)
      • dgelqf

        public void dgelqf​(int m,
                           int n,
                           double[][] A,
                           int lda,
                           double[] tau,
                           double[] work,
                           int lwork,
                           int[] info)
        This is a port of version 3.2 LAPACK routine DGELQF -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- November 2006 .. Scalar Arguments .. INTEGER INFO, LDA, LWORK, M, N .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * ) .. Purpose ======= DGELQF computes an LQ factorization of a real M-by-N matrix A: A = L * Q. Arguments ========= M (input) INTEGER The number of rows of the matrix A. M >= 0. N (input) INTEGER The number of columns of the matrix A. N >= 0. A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the elements on and below the diagonal of the array contain the m-by-min(m,n) lower trapezoidal matrix L (L is lower triangular if m = max(1,M). TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details). WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,M). For optimum performance LWORK >= M*NB, where NB is the optimal blocksize. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. INFO (output) INTEGER = 0: successful exit
        • dgelq2

          private void dgelq2​(int m,
                              int n,
                              double[][] A,
                              int lda,
                              double[] tau,
                              double[] work,
                              int[] info)
          This is a port of version 3.2 LAPACK routine DGELQ2 -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- November 2006 .. Scalar Arguments .. INTEGER INFO, LDA, M, N .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * ) .. Purpose ======= DGELQ2 computes an LQ factorization of a real m by n matrix A: A = L * Q. Arguments ========= M (input) INTEGER The number of rows of the matrix A. M >= 0. N (input) INTEGER The number of columns of the matrix A. N >= 0. A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the m by n matrix A. On exit, the elements on and below the diagonal of the array contain the m by min(m,n) lower trapezoidal matrix L (L is lower triangular if m = max(1,M). TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details). WORK (workspace) DOUBLE PRECISION array, dimension (M) INFO (output) INTEGER = 0: successful exit
          • dbdsqr

            public void dbdsqr​(char uplo,
                               int n,
                               int ncvt,
                               int nru,
                               int ncc,
                               double[] d,
                               double[] e,
                               double[][] VT,
                               int ldvt,
                               double[][] U,
                               int ldu,
                               double[][] C,
                               int ldc,
                               double[] work,
                               int[] info)
            This is a port of version 3.2 LAPACK routine DBDSQR. -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- January 2007 .. Scalar Arguments .. CHARACTER UPLO INTEGER INFO, LDC, LDU, LDVT, N, NCC, NCVT, NRU .. .. Array Arguments .. DOUBLE PRECISION C( LDC, * ), D( * ), E( * ), U( LDU, * ), $ VT( LDVT, * ), WORK( * ) .. Purpose ======= DBDSQR computes the singular values and, optionally, the right and/or left singular vectors from the singular value decomposition (SVD) of a real N-by-N (upper or lower) bidiagonal matrix B using the implicit zero-shift QR algorithm. The SVD of B has the form B = Q * S * P**T where S is the diagonal matrix of singular values, Q is an orthogonal matrix of left singular vectors, and P is an orthogonal matrix of right singular vectors. If left singular vectors are requested, this subroutine actually returns U*Q instead of Q, and, if right singular vectors are requested, this subroutine returns P**T*VT instead of P**T, for given real input matrices U and VT. When U and VT are the orthogonal matrices that reduce a general matrix A to bidiagonal form: A = U*B*VT, as computed by DGEBRD, then A = (U*Q) * S * (P**T*VT) is the SVD of A. Optionally, the subroutine may also compute Q**T*C for a given real input matrix C. See "Computing Small Singular Values of Bidiagonal Matrices With Guaranteed High Relative Accuracy," by J. Demmel and W. Kahan, LAPACK Working Note #3 (or SIAM J. Sci. Statist. Comput. vol. 11, no. 5, pp. 873-912, Sept 1990) and "Accurate singular values and differential qd algorithms," by B. Parlett and V. Fernando, Technical Report CPAM-554, Mathematics Department, University of California at Berkeley, July 1992 for a detailed description of the algorithm. Arguments ========= UPLO (input) CHARACTER*1 = 'U': B is upper bidiagonal; = 'L': B is lower bidiagonal. N (input) INTEGER The order of the matrix B. N >= 0. NCVT (input) INTEGER The number of columns of the matrix VT. NCVT >= 0. NRU (input) INTEGER The number of rows of the matrix U. NRU >= 0. NCC (input) INTEGER The number of columns of the matrix C. NCC >= 0. D (input/output) DOUBLE PRECISION array, dimension (N) On entry, the n diagonal elements of the bidiagonal matrix B. On exit, if INFO=0, the singular values of B in decreasing order. E (input/output) DOUBLE PRECISION array, dimension (N-1) On entry, the N-1 offdiagonal elements of the bidiagonal matrix B. On exit, if INFO = 0, E is destroyed; if INFO > 0, D and E will contain the diagonal and superdiagonal elements of a bidiagonal matrix orthogonally equivalent to the one given as input. VT (input/output) DOUBLE PRECISION array, dimension (LDVT, NCVT) On entry, an N-by-NCVT matrix VT. On exit, VT is overwritten by P**T * VT. Not referenced if NCVT = 0. LDVT (input) INTEGER The leading dimension of the array VT. LDVT >= max(1,N) if NCVT > 0; LDVT >= 1 if NCVT = 0. U (input/output) DOUBLE PRECISION array, dimension (LDU, N) On entry, an NRU-by-N matrix U. On exit, U is overwritten by U * Q. Not referenced if NRU = 0. LDU (input) INTEGER The leading dimension of the array U. LDU >= max(1,NRU). C (input/output) DOUBLE PRECISION array, dimension (LDC, NCC) On entry, an N-by-NCC matrix C. On exit, C is overwritten by Q**T * C. Not referenced if NCC = 0. LDC (input) INTEGER The leading dimension of the array C. LDC >= max(1,N) if NCC > 0; LDC >=1 if NCC = 0. WORK (workspace) DOUBLE PRECISION array, dimension (4*N) INFO (output) INTEGER = 0: successful exit 0: if NCVT = NRU = NCC = 0, = 1, a split was marked by a positive value in E = 2, current block of Z not diagonalized after 30*N iterations (in inner while loop) = 3, termination criterion of outer while loop not met (program created more than N unreduced blocks) else NCVT = NRU = NCC = 0, the algorithm did not converge; D and E contain the elements of a bidiagonal matrix which is orthogonally similar to the input matrix B; if INFO = i, i elements of E have not converged to zero. Internal Parameters =================== TOLMUL DOUBLE PRECISION, default = max(10,min(100,EPS**(-1/8))) TOLMUL controls the convergence criterion of the QR loop. If it is positive, TOLMUL*EPS is the desired relative precision in the computed singular values. If it is negative, abs(TOLMUL*EPS*sigma_max) is the desired absolute accuracy in the computed singular values (corresponds to relative accuracy abs(TOLMUL*EPS) in the largest singular value. abs(TOLMUL) should be between 1 and 1/EPS, and preferably between 10 (for fast convergence) and .1/EPS (for there to be some accuracy in the results). Default is to lose at either one eighth or 2 of the available decimal digits in each computed singular value (whichever is smaller). MAXITR INTEGER, default = 6 MAXITR controls the maximum number of passes of the algorithm through its inner loop. The algorithms stops (and so fails to converge) if the number of passes through the inner loop exceeds MAXITR*N**2.
          • dlasq1

            private void dlasq1​(int n,
                                double[] d,
                                double[] e,
                                double[] work,
                                int[] info)
            This is a port of version 3.2 LAPACK routine DLASQ1. -- -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- .. Scalar Arguments .. INTEGER INFO, N .. .. Array Arguments .. DOUBLE PRECISION D( * ), E( * ), WORK( * ) .. Purpose ======= DLASQ1 computes the singular values of a real N-by-N bidiagonal matrix with diagonal D and off-diagonal E. The singular values are computed to high relative accuracy, in the absence of denormalization, underflow and overflow. The algorithm was first presented in "Accurate singular values and differential qd algorithms" by K. V. Fernando and B. N. Parlett, Numer. Math., Vol-67, No. 2, pp. 191-230, 1994, and the present implementation is described in "An implementation of the dqds Algorithm (Positive Case)", LAPACK Working Note. Arguments ========= N (input) INTEGER The number of rows and columns in the matrix. N >= 0. D (input/output) DOUBLE PRECISION array, dimension (N) On entry, D contains the diagonal elements of the bidiagonal matrix whose SVD is desired. On normal exit, D contains the singular values in decreasing order. E (input/output) DOUBLE PRECISION array, dimension (N) On entry, elements E(1:N-1) contain the off-diagonal elements of the bidiagonal matrix whose SVD is desired. On exit, E is overwritten. WORK (workspace) DOUBLE PRECISION array, dimension (4*N) INFO (output) INTEGER = 0: successful exit 0: the algorithm failed = 1, a split was marked by a positive value in E = 2, current block of Z not diagonalized after 30*N iterations (in inner while loop) = 3, termination criterion of outer while loop not met (program created more than N unreduced blocks)
          • dlasq2

            private void dlasq2​(int n,
                                double[] z,
                                int[] info)
            This is a port of version 3.2 LAPACK routine DLASQ2. -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- .. Scalar Arguments .. INTEGER INFO, N .. .. Array Arguments .. DOUBLE PRECISION Z( * ) .. Purpose ======= DLASQ2 computes all the eigenvalues of the symmetric positive definite tridiagonal matrix associated with the qd array Z to high relative accuracy are computed to high relative accuracy, in the absence of denormalization, underflow and overflow. To see the relation of Z to the tridiagonal matrix, let L be a unit lower bidiagonal matrix with subdiagonals Z(2,4,6,,..) and let U be an upper bidiagonal matrix with 1's above and diagonal Z(1,3,5,,..). The tridiagonal is L*U or, if you prefer, the symmetric tridiagonal to which it is similar. Note : DLASQ2 defines a logical variable, IEEE, which is true on machines which follow ieee-754 floating-point standard in their handling of infinities and NaNs, and false otherwise. This variable is passed to DLASQ3. Arguments ========= N (input) INTEGER The number of rows and columns in the matrix. N >= 0. Z (input/output) DOUBLE PRECISION array, dimension ( 4*N ) On entry Z holds the qd array. On exit, entries 1 to N hold the eigenvalues in decreasing order, Z( 2*N+1 ) holds the trace, and Z( 2*N+2 ) holds the sum of the eigenvalues. If N > 2, then Z( 2*N+3 ) holds the iteration count, Z( 2*N+4 ) holds NDIVS/NIN^2, and Z( 2*N+5 ) holds the percentage of shifts that failed. INFO (output) INTEGER = 0: successful exit 0: the algorithm failed = 1, a split was marked by a positive value in E = 2, current block of Z not diagonalized after 30*N iterations (in inner while loop) = 3, termination criterion of outer while loop not met (program created more than N unreduced blocks) Further Details =============== Local Variables: I0:N0 defines a current unreduced segment of Z. The shifts are accumulated in SIGMA. Iteration count is in ITER. Ping-pong is controlled by PP (alternates between 0 and 1).
          • dlasq3

            private void dlasq3​(int[] i0,
                                int[] n0,
                                double[] z,
                                int[] pp,
                                double[] dmin,
                                double[] sigma,
                                double[] desig,
                                double qmax,
                                int[] nfail,
                                int[] iter,
                                int[] ndiv,
                                boolean ieee,
                                int[] ttype,
                                double[] dmin1,
                                double[] dmin2,
                                double[] dn,
                                double[] dn1,
                                double[] dn2,
                                double[] g,
                                double[] tau)
            This is a port of version 3.2 LAPACK routine DLASQ3 -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- .. Scalar Arguments .. LOGICAL IEEE INTEGER I0, ITER, N0, NDIV, NFAIL, PP DOUBLE PRECISION DESIG, DMIN, DMIN1, DMIN2, DN, DN1, DN2, G, $ QMAX, SIGMA, TAU .. .. Array Arguments .. DOUBLE PRECISION Z( * ) .. Purpose ======= DLASQ3 checks for deflation, computes a shift (TAU) and calls dqds. In case of failure it changes shifts, and tries again until output is positive. Arguments ========= I0 (input/output) INTEGER First index. N0 (inputoutput) INTEGER Last index. Z (input) DOUBLE PRECISION array, dimension ( 4*N ) Z holds the qd array. PP (input/output) INTEGER PP=0 for ping, PP=1 for pong. PP=2 indicates that flipping was applied to the Z array and that the initial tests for deflation should not be performed. DMIN (output) DOUBLE PRECISION Minimum value of d. SIGMA (output) DOUBLE PRECISION Sum of shifts used in current segment. DESIG (input/output) DOUBLE PRECISION Lower order part of SIGMA QMAX (input) DOUBLE PRECISION Maximum value of q. NFAIL (output) INTEGER Number of times shift was too big. ITER (output) INTEGER Number of iterations. NDIV (output) INTEGER Number of divisions. IEEE (input) LOGICAL Flag for IEEE or non IEEE arithmetic (passed to DLASQ5). TTYPE (input/output) INTEGER Shift type. DMIN1, DMIN2, DN, DN1, DN2, G, TAU (input/output) DOUBLE PRECISION These are passed as arguments in order to save their values between calls to DLASQ3.
          • dlasq4

            private void dlasq4​(int i0,
                                int n0,
                                double[] z,
                                int pp,
                                int n0in,
                                double dmin,
                                double dmin1,
                                double dmin2,
                                double dn,
                                double dn1,
                                double dn2,
                                double[] tau,
                                int[] ttype,
                                double[] g)
            This is a port of version 3.2 LAPACK routine DLASQ4. -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- .. Scalar Arguments .. INTEGER I0, N0, N0IN, PP, TTYPE DOUBLE PRECISION DMIN, DMIN1, DMIN2, DN, DN1, DN2, G, TAU .. .. Array Arguments .. DOUBLE PRECISION Z( * ) .. Purpose ======= DLASQ4 computes an approximation TAU to the smallest eigenvalue using values of d from the previous transform. I0 (input) INTEGER First index. N0 (input) INTEGER Last index. Z (input) DOUBLE PRECISION array, dimension ( 4*N ) Z holds the qd array. PP (input) INTEGER PP=0 for ping, PP=1 for pong. NOIN (input) INTEGER The value of N0 at start of EIGTEST. DMIN (input) DOUBLE PRECISION Minimum value of d. DMIN1 (input) DOUBLE PRECISION Minimum value of d, excluding D( N0 ). DMIN2 (input) DOUBLE PRECISION Minimum value of d, excluding D( N0 ) and D( N0-1 ). DN (input) DOUBLE PRECISION d(N) DN1 (input) DOUBLE PRECISION d(N-1) DN2 (input) DOUBLE PRECISION d(N-2) TAU (output) DOUBLE PRECISION This is the shift. TTYPE (output) INTEGER Shift type. G (input/output) REAL G is passed as an argument in order to save its value between calls to DLASQ4. Further Details =============== CNST1 = 9/16
          • dlasq5

            private void dlasq5​(int i0,
                                int n0,
                                double[] z,
                                int pp,
                                double tau,
                                double[] dmin,
                                double[] dmin1,
                                double[] dmin2,
                                double[] dn,
                                double[] dnm1,
                                double[] dnm2,
                                boolean ieee)
            This is a port of version 3.2 LAPACK routine DLASQ5 -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- .. Scalar Arguments .. LOGICAL IEEE INTEGER I0, N0, PP DOUBLE PRECISION DMIN, DMIN1, DMIN2, DN, DNM1, DNM2, TAU .. .. Array Arguments .. DOUBLE PRECISION Z( * ) .. Purpose ======= DLASQ5 computes one dqds transform in ping-pong form, one version for IEEE machines another for non IEEE machines. Arguments ========= I0 (input) INTEGER First index. N0 (input) INTEGER Last index. Z (input) DOUBLE PRECISION array, dimension ( 4*N ) Z holds the qd array. EMIN is stored in Z(4*N0) to avoid an extra argument. PP (input) INTEGER PP=0 for ping, PP=1 for pong. TAU (input) DOUBLE PRECISION This is the shift. DMIN (output) DOUBLE PRECISION Minimum value of d. DMIN1 (output) DOUBLE PRECISION Minimum value of d, excluding D( N0 ). DMIN2 (output) DOUBLE PRECISION Minimum value of d, excluding D( N0 ) and D( N0-1 ). DN (output) DOUBLE PRECISION d(N0), the last value of d. DNM1 (output) DOUBLE PRECISION d(N0-1). DNM2 (output) DOUBLE PRECISION d(N0-2). IEEE (input) LOGICAL Flag for IEEE or non IEEE arithmetic.
          • dlasq6

            private void dlasq6​(int i0,
                                int n0,
                                double[] z,
                                int pp,
                                double[] dmin,
                                double[] dmin1,
                                double[] dmin2,
                                double[] dn,
                                double[] dnm1,
                                double[] dnm2)
            This is a port of version 3.2 LAPACK routine DLASQ6. -- Contributed by Osni Marques of the Lawrence Berkeley National -- -- Laboratory and Beresford Parlett of the Univ. of California at -- -- Berkeley -- -- November 2008 -- -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- .. Scalar Arguments .. INTEGER I0, N0, PP DOUBLE PRECISION DMIN, DMIN1, DMIN2, DN, DNM1, DNM2 .. .. Array Arguments .. DOUBLE PRECISION Z( * ) .. Purpose ======= DLASQ6 computes one dqd (shift equal to zero) transform in ping-pong form, with protection against underflow and overflow. Arguments ========= I0 (input) INTEGER First index. N0 (input) INTEGER Last index. Z (input) DOUBLE PRECISION array, dimension ( 4*N ) Z holds the qd array. EMIN is stored in Z(4*N0) to avoid an extra argument. PP (input) INTEGER PP=0 for ping, PP=1 for pong. DMIN (output) DOUBLE PRECISION Minimum value of d. DMIN1 (output) DOUBLE PRECISION Minimum value of d, excluding D( N0 ). DMIN2 (output) DOUBLE PRECISION Minimum value of d, excluding D( N0 ) and D( N0-1 ). DN (output) DOUBLE PRECISION d(N0), the last value of d. DNM1 (output) DOUBLE PRECISION d(N0-1). DNM2 (output) DOUBLE PRECISION d(N0-2).
          • dlas2

            private void dlas2​(double[] f,
                               double[] g,
                               double[] h,
                               double[] ssmin,
                               double[] ssmax)
            This is a port of version 3.2 LAPACK auxiliary routine DLAS2. Original DLAS2 created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 Purpose ======= DLAS2 computes the singular values of the 2-by-2 matrix [ F G ] [ 0 H ]. On return, SSMIN is the smaller singular value and SSMAX is the larger singular value. Arguments ========= F (input) DOUBLE PRECISION The (1,1) element of the 2-by-2 matrix. G (input) DOUBLE PRECISION The (1,2) element of the 2-by-2 matrix. H (input) DOUBLE PRECISION The (2,2) element of the 2-by-2 matrix. SSMIN (output) DOUBLE PRECISION The smaller singular value. SSMAX (output) DOUBLE PRECISION The larger singular value. Further Details =============== Barring over/underflow, all output quantities are correct to within a few units in the last place (ulps), even in the absence of a guard digit in addition/subtraction. In IEEE arithmetic, the code works correctly if one matrix element is infinite. Overflow will not occur unless the largest singular value itself overflows, or is within a few ulps of overflow. (On machines with partial overflow, like the Cray, overflow may occur if the largest singular value is within a factor of 2 of overflow.) Underflow is harmless if underflow is gradual. Otherwise, results may correspond to a matrix modified by perturbations of size near the underflow threshold.
          • dorgbr

            public void dorgbr​(char vect,
                               int m,
                               int n,
                               int k,
                               double[][] A,
                               int lda,
                               double[] tau,
                               double[] work,
                               int lwork,
                               int[] info)
            This is a port of version 3.2 LAPACK routine DORGBR. Original DORGBR created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 Purpose ======= DORGBR generates one of the real orthogonal matrices Q or P**T determined by DGEBRD when reducing a real matrix A to bidiagonal form: A = Q * B * P**T. Q and P**T are defined as products of elementary reflectors H(i) or G(i) respectively. If VECT = 'Q', A is assumed to have been an M-by-K matrix, and Q is of order M: if m >= k, Q = H(1) H(2) . . . H(k) and DORGBR returns the first n columns of Q, where m >= n >= k; if m = m >= k; if k >= n, P**T = G(n-1) . . . G(2) G(1) and DORGBR returns P**T as an N-by-N matrix. Arguments ========= VECT (input) CHARACTER*1 Specifies whether the matrix Q or the matrix P**T is required, as defined in the transformation applied by DGEBRD: = 'Q': generate Q; = 'P': generate P**T. M (input) INTEGER The number of rows of the matrix Q or P**T to be returned. M >= 0. N (input) INTEGER The number of columns of the matrix Q or P**T to be returned. N >= 0. If VECT = 'Q', M >= N >= min(M,K); if VECT = 'P', N >= M >= min(N,K). K (input) INTEGER If VECT = 'Q', the number of columns in the original M-by-K matrix reduced by DGEBRD. If VECT = 'P', the number of rows in the original K-by-N matrix reduced by DGEBRD. K >= 0. A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the vectors which define the elementary reflectors, as returned by DGEBRD. On exit, the M-by-N matrix Q or P**T. LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M). TAU (input) DOUBLE PRECISION array, dimension (min(M,K)) if VECT = 'Q' (min(N,K)) if VECT = 'P' TAU(i) must contain the scalar factor of the elementary reflector H(i) or G(i), which determines Q or P**T, as returned by DGEBRD in its array argument TAUQ or TAUP. WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,min(M,N)). For optimum performance LWORK >= min(M,N)*NB, where NB is the optimal blocksize. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. INFO (output) INTEGER = 0: successful exit
            • dorglq

              public void dorglq​(int m,
                                 int n,
                                 int k,
                                 double[][] A,
                                 int lda,
                                 double[] tau,
                                 double[] work,
                                 int lwork,
                                 int[] info)
              This is a port of version 3.2 LAPACK routine DORGLQ. Original DORGLQ created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 Purpose ======= DORGLQ generates an M-by-N real matrix Q with orthonormal rows, which is defined as the first M rows of a product of K elementary reflectors of order N Q = H(k) . . . H(2) H(1) as returned by DGELQF. Arguments ========= M (input) INTEGER The number of rows of the matrix Q. M >= 0. N (input) INTEGER The number of columns of the matrix Q. N >= M. K (input) INTEGER The number of elementary reflectors whose product defines the matrix Q. M >= K >= 0. A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the i-th row must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned by DGELQF in the first k rows of its array argument A. On exit, the M-by-N matrix Q. LDA (input) INTEGER The first dimension of the array A. LDA >= max(1,M). TAU (input) DOUBLE PRECISION array, dimension (K) TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by DGELQF. WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,M). For optimum performance LWORK >= M*NB, where NB is the optimal blocksize. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. INFO (output) INTEGER = 0: successful exit
              • dorgl2

                private void dorgl2​(int m,
                                    int n,
                                    int k,
                                    double[][] A,
                                    int lda,
                                    double[] tau,
                                    double[] work,
                                    int[] info)
              • dormlq

                private void dormlq​(char side,
                                    char trans,
                                    int m,
                                    int n,
                                    int k,
                                    double[][] A,
                                    int lda,
                                    double[] tau,
                                    double[][] C,
                                    int ldc,
                                    double[] work,
                                    int lwork,
                                    int[] info)
              • dorml2

                private void dorml2​(char side,
                                    char trans,
                                    int m,
                                    int n,
                                    int k,
                                    double[][] A,
                                    int lda,
                                    double[] tau,
                                    double[][] C,
                                    int ldc,
                                    double[] work,
                                    int[] info)
              • dgebrd

                public void dgebrd​(int m,
                                   int n,
                                   double[][] A,
                                   int lda,
                                   double[] d,
                                   double[] e,
                                   double[] tauq,
                                   double[] taup,
                                   double[] work,
                                   int lwork,
                                   int[] info)
              • dlabrd

                private void dlabrd​(int m,
                                    int n,
                                    int nb,
                                    double[][] A,
                                    int lda,
                                    double[] d,
                                    double[] e,
                                    double[] tauq,
                                    double[] taup,
                                    double[][] X,
                                    int ldx,
                                    double[][] Y,
                                    int ldy)
              • dgebd2

                public void dgebd2​(int m,
                                   int n,
                                   double[][] A,
                                   int lda,
                                   double[] d,
                                   double[] e,
                                   double[] tauq,
                                   double[] taup,
                                   double[] work,
                                   int[] info)
                This is a port of version 3.2 LAPACK routine DGEBD2. Original DGEBD2 created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 * .. Scalar Arguments .. INTEGER INFO, LDA, M, N .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), D( * ), E( * ), TAUP( * ), $ TAUQ( * ), WORK( * ) .. Purpose ======= DGEBD2 reduces a real general m by n matrix A to upper or lower bidiagonal form B by an orthogonal transformation: Q' * A * P = B. If m >= n, B is upper bidiagonal; if m = 0. N (input) INTEGER The number of columns in the matrix A. N >= 0. A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the m by n general matrix to be reduced. On exit, if m >= n, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrix B; the elements below the diagonal, with the array TAUQ, represent the orthogonal matrix Q as a product of elementary reflectors, and the elements above the first superdiagonal, with the array TAUP, represent the orthogonal matrix P as a product of elementary reflectors; if m = max(1,M). D (output) DOUBLE PRECISION array, dimension (min(M,N)) The diagonal elements of the bidiagonal matrix B: D(i) = A(i,i). E (output) DOUBLE PRECISION array, dimension (min(M,N)-1) The off-diagonal elements of the bidiagonal matrix B: if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n-1; if m = n, Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1) Each H(i) and G(i) has the form: H(i) = I - tauq * v * v' and G(i) = I - taup * u * u' where tauq and taup are real scalars, and v and u are real vectors; v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i); u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n); tauq is stored in TAUQ(i) and taup in TAUP(i). If m n): m = 5 and n = 6 (m
                • dormbr

                  public void dormbr​(char vect,
                                     char side,
                                     char trans,
                                     int m,
                                     int n,
                                     int k,
                                     double[][] A,
                                     int lda,
                                     double[] tau,
                                     double[][] C,
                                     int ldc,
                                     double[] work,
                                     int lwork,
                                     int[] info)
                • drscl

                  public void drscl​(int n,
                                    double sa,
                                    double[] sx,
                                    int incx)
                  This is a port of version 3.2 LAPACK auxiliary routine DRSCL. -- LAPACK is a software package provided by Univ. of Tennessee, -- -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- November 2006 .. Scalar Arguments .. INTEGER INCX, N DOUBLE PRECISION SA .. .. Array Arguments .. DOUBLE PRECISION SX( * ) .. Purpose ======= DRSCL multiplies an n-element real vector x by the real scalar 1/a. This is done without overflow or underflow as long as the final result x/a does not overflow or underflow. Arguments ========= N (input) INTEGER The number of components of the vector x. SA (input) DOUBLE PRECISION The scalar a which is used to divide each component of x. SA must be >= 0, or the subroutine will divide by zero. SX (input/output) DOUBLE PRECISION array, dimension (1+(N-1)*abs(INCX)) The n-element vector x. INCX (input) INTEGER The increment between successive values of the vector SX. > 0: SX(1) = X(1) and SX(1+(i-1)*INCX) = x(i), 1
                  • dchklq_test

                    public void dchklq_test()
                    This dchklq_test routine is a port of a portion of the version 3.1.1 LAPACK test routine DCHKAA by Univ. of Tennessee, Univ. Of California Berkeley and NAG Ltd., January, 2007. and some values from the test data file dtest.in.
                  • dchklq

                    private void dchklq​(boolean[] dotype,
                                        int nm,
                                        int[] mval,
                                        int nn,
                                        int[] nval,
                                        int nnb,
                                        int[] nbval,
                                        int[] nxval,
                                        int nrhs,
                                        double thresh,
                                        boolean tsterr,
                                        int nmax,
                                        double[][] A,
                                        double[][] AF,
                                        double[][] AQ,
                                        double[][] AL,
                                        double[][] AC,
                                        double[][] B,
                                        double[][] X,
                                        double[][] XACT,
                                        double[] tau,
                                        double[] work,
                                        double[] rwork,
                                        int[] iwork)
                    This is a port of version 3.1 LAPACK test routine DCHKLQ. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. LOGICAL TSTERR INTEGER NM, NMAX, NN, NNB, NOUT, NRHS DOUBLE PRECISION THRESH .. .. Array Arguments .. LOGICAL DOTYPE( * ) INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NVAL( * ), $ NXVAL( * ) DOUBLE PRECISION A( * ), AC( * ), AF( * ), AL( * ), AQ( * ), $ B( * ), RWORK( * ), TAU( * ), WORK( * ), $ X( * ), XACT( * ) .. Purpose ======= DCHKLQ tests DGELQF, DORGLQ and DORMLQ. Arguments ========= DOTYPE (input) LOGICAL array, dimension (NTYPES) The matrix types to be used for testing. Matrices of type j (for 1 = THRESH. To have every test ratio printed, use THRESH = 0. TSTERR (input) LOGICAL Flag that indicates whether error exits are to be tested. NMAX (input) INTEGER The maximum value permitted for M or N, used in dimensioning the work arrays. A (workspace) DOUBLE PRECISION array, dimension [NMAX][NMAX] AF (workspace) DOUBLE PRECISION array, dimension [NMAX][NMAX] AQ (workspace) DOUBLE PRECISION array, dimension [NMAX][NMAX] AL (workspace) DOUBLE PRECISION array, dimension [NMAX][NMAX] AC (workspace) DOUBLE PRECISION array, dimension [NMAX][NMAX] B (workspace) DOUBLE PRECISION array, dimension [NMAX][NRHS] X (workspace) DOUBLE PRECISION array, dimension [NMAX[NRHS] XACT (workspace) DOUBLE PRECISION array, dimension [NMAX][NRHS] TAU (workspace) DOUBLE PRECISION array, dimension (NMAX) WORK (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) RWORK (workspace) DOUBLE PRECISION array, dimension (NMAX) IWORK (workspace) INTEGER array, dimension (NMAX) NOUT (input) INTEGER The unit number for output.
                  • dgelqs

                    private void dgelqs​(int m,
                                        int n,
                                        int nrhs,
                                        double[][] A,
                                        int lda,
                                        double[] tau,
                                        double[][] B,
                                        int ldb,
                                        double[] work,
                                        int lwork,
                                        int[] info)
                    This is a port of version 3.1 LAPACK routine DGELQS. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER INFO, LDA, LDB, LWORK, M, N, NRHS .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), B( LDB, * ), TAU( * ), $ WORK( LWORK ) .. Purpose ======= Compute a minimum-norm solution min || A*X - B || using the LQ factorization A = L*Q computed by DGELQF. Arguments ========= M (input) INTEGER The number of rows of the matrix A. M >= 0. N (input) INTEGER The number of columns of the matrix A. N >= M >= 0. NRHS (input) INTEGER The number of columns of B. NRHS >= 0. A (input) DOUBLE PRECISION array, dimension (LDA,N) Details of the LQ factorization of the original matrix A as returned by DGELQF. LDA (input) INTEGER The leading dimension of the array A. LDA >= M. TAU (input) DOUBLE PRECISION array, dimension (M) Details of the orthogonal matrix Q. B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the m-by-nrhs right hand side matrix B. On exit, the n-by-nrhs solution matrix X. LDB (input) INTEGER The leading dimension of the array B. LDB >= N. WORK (workspace) DOUBLE PRECISION array, dimension (LWORK) LWORK (input) INTEGER The length of the array WORK. LWORK must be at least NRHS, and should be at least NRHS*NB, where NB is the block size for this environment. INFO (output) INTEGER = 0: successful exit
                    • derrlq

                      private void derrlq()
                      This is a port of a portion of version 3.1 LAPACK routine DERRLQ. * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006
                    • dlqt01

                      private void dlqt01​(int m,
                                          int n,
                                          double[][] A,
                                          double[][] AF,
                                          double[][] Q,
                                          double[][] L,
                                          int lda,
                                          double[] tau,
                                          double[] work,
                                          int lwork,
                                          double[] rwork,
                                          double[] result)
                      This is a port of the version 3.1 LAPACK test routine DLQT01. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER LDA, LWORK, M, N .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), AF( LDA, * ), L( LDA, * ), $ Q( LDA, * ), RESULT( * ), RWORK( * ), TAU( * ), $ WORK( LWORK ) .. Purpose ======= DLQT01 tests DGELQF, which computes the LQ factorization of an m-by-n matrix A, and partially tests DORGLQ which forms the n-by-n orthogonal matrix Q. DLQT01 compares L with A*Q', and checks that Q is orthogonal. Arguments ========= M (input) INTEGER The number of rows of the matrix A. M >= 0. N (input) INTEGER The number of columns of the matrix A. N >= 0. A (input) DOUBLE PRECISION array, dimension (LDA,N) The m-by-n matrix A. AF (output) DOUBLE PRECISION array, dimension (LDA,N) Details of the LQ factorization of A, as returned by DGELQF. See DGELQF for further details. Q (output) DOUBLE PRECISION array, dimension (LDA,N) The n-by-n orthogonal matrix Q. L (workspace) DOUBLE PRECISION array, dimension (LDA,max(M,N)) LDA (input) INTEGER The leading dimension of the arrays A, AF, Q and L. LDA >= max(M,N). TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors, as returned by DGELQF. WORK (workspace) DOUBLE PRECISION array, dimension (LWORK) LWORK (input) INTEGER The dimension of the array WORK. RWORK (workspace) DOUBLE PRECISION array, dimension (max(M,N)) RESULT (output) DOUBLE PRECISION array, dimension (2) The test ratios: RESULT(1) = norm( L - A*Q' ) / ( N * norm(A) * EPS ) RESULT(2) = norm( I - Q*Q' ) / ( N * EPS )
                    • dlqt02

                      private void dlqt02​(int m,
                                          int n,
                                          int k,
                                          double[][] A,
                                          double[][] AF,
                                          double[][] Q,
                                          double[][] L,
                                          int lda,
                                          double[] tau,
                                          double[] work,
                                          int lwork,
                                          double[] rwork,
                                          double[] result)
                      This is a port of version 3.1 LAPACK routine DLQT02. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER K, LDA, LWORK, M, N .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), AF( LDA, * ), L( LDA, * ), $ Q( LDA, * ), RESULT( * ), RWORK( * ), TAU( * ), $ WORK( LWORK ) .. Purpose ======= DLQT02 tests DORGLQ, which generates an m-by-n matrix Q with orthonornmal rows that is defined as the product of k elementary reflectors. Given the LQ factorization of an m-by-n matrix A, DLQT02 generates the orthogonal matrix Q defined by the factorization of the first k rows of A; it compares L(1:k,1:m) with A(1:k,1:n)*Q(1:m,1:n)', and checks that the rows of Q are orthonormal. Arguments ========= M (input) INTEGER The number of rows of the matrix Q to be generated. M >= 0. N (input) INTEGER The number of columns of the matrix Q to be generated. N >= M >= 0. K (input) INTEGER The number of elementary reflectors whose product defines the matrix Q. M >= K >= 0. A (input) DOUBLE PRECISION array, dimension (LDA,N) The m-by-n matrix A which was factorized by DLQT01. AF (input) DOUBLE PRECISION array, dimension (LDA,N) Details of the LQ factorization of A, as returned by DGELQF. See DGELQF for further details. Q (workspace) DOUBLE PRECISION array, dimension (LDA,N) L (workspace) DOUBLE PRECISION array, dimension (LDA,M) LDA (input) INTEGER The leading dimension of the arrays A, AF, Q and L. LDA >= N. TAU (input) DOUBLE PRECISION array, dimension (M) The scalar factors of the elementary reflectors corresponding to the LQ factorization in AF. WORK (workspace) DOUBLE PRECISION array, dimension (LWORK) LWORK (input) INTEGER The dimension of the array WORK. RWORK (workspace) DOUBLE PRECISION array, dimension (M) RESULT (output) DOUBLE PRECISION array, dimension (2) The test ratios: RESULT(1) = norm( L - A*Q' ) / ( N * norm(A) * EPS ) RESULT(2) = norm( I - Q*Q' ) / ( N * EPS )
                    • dlqt03

                      private void dlqt03​(int m,
                                          int n,
                                          int k,
                                          double[][] AF,
                                          double[][] C,
                                          double[][] CC,
                                          double[][] Q,
                                          int lda,
                                          double[] tau,
                                          double[] work,
                                          int lwork,
                                          double[] rwork,
                                          double[] result)
                      This is a port of version 3.1 LAPACK test routine DLQT03. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER K, LDA, LWORK, M, N .. .. Array Arguments .. DOUBLE PRECISION AF( LDA, * ), C( LDA, * ), CC( LDA, * ), $ Q( LDA, * ), RESULT( * ), RWORK( * ), TAU( * ), $ WORK( LWORK ) .. Purpose ======= DLQT03 tests DORMLQ, which computes Q*C, Q'*C, C*Q or C*Q'. DLQT03 compares the results of a call to DORMLQ with the results of forming Q explicitly by a call to DORGLQ and then performing matrix multiplication by a call to DGEMM. Arguments ========= M (input) INTEGER The number of rows or columns of the matrix C; C is n-by-m if Q is applied from the left, or m-by-n if Q is applied from the right. M >= 0. N (input) INTEGER The order of the orthogonal matrix Q. N >= 0. K (input) INTEGER The number of elementary reflectors whose product defines the orthogonal matrix Q. N >= K >= 0. AF (input) DOUBLE PRECISION array, dimension (LDA,N) Details of the LQ factorization of an m-by-n matrix, as returned by DGELQF. See SGELQF for further details. C (workspace) DOUBLE PRECISION array, dimension (LDA,N) CC (workspace) DOUBLE PRECISION array, dimension (LDA,N) Q (workspace) DOUBLE PRECISION array, dimension (LDA,N) LDA (input) INTEGER The leading dimension of the arrays AF, C, CC, and Q. TAU (input) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors corresponding to the LQ factorization in AF. WORK (workspace) DOUBLE PRECISION array, dimension (LWORK) LWORK (input) INTEGER The length of WORK. LWORK must be at least M, and should be M*NB, where NB is the blocksize for this environment. RWORK (workspace) DOUBLE PRECISION array, dimension (M) RESULT (output) DOUBLE PRECISION array, dimension (4) The test ratios compare two techniques for multiplying a random matrix C by an n-by-n orthogonal matrix Q. RESULT(1) = norm( Q*C - Q*C ) / ( N * norm(C) * EPS ) RESULT(2) = norm( C*Q - C*Q ) / ( N * norm(C) * EPS ) RESULT(3) = norm( Q'*C - Q'*C )/ ( N * norm(C) * EPS ) RESULT(4) = norm( C*Q' - C*Q' )/ ( N * norm(C) * EPS )
                    • ddrvls_test

                      public void ddrvls_test()
                      This ddrvls_test routine is a port of a portion of the version 3.1.1 LAPACK test routine DCHKAA by Univ. of Tennessee, Univ. Of California Berkeley and NAG Ltd., January, 2007. and some values from the test data file dtest.in.
                    • ddrvls

                      private void ddrvls​(boolean[] dotype,
                                          int nm,
                                          int[] mval,
                                          int nn,
                                          int[] nval,
                                          int nns,
                                          int[] nsval,
                                          int nnb,
                                          int[] nbval,
                                          int[] nxval,
                                          double thresh,
                                          boolean tsterr,
                                          double[][] A,
                                          double[][] COPYA,
                                          double[][] B,
                                          double[][] COPYB,
                                          double[][] C,
                                          double[] s,
                                          double[] copys,
                                          double[] work,
                                          int[] iwork)
                      This is a port of that part of version 3.1.1 LAPACK test routine DDRVLS used for testing the least squares driver routine DGELSS. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. January 2007 .. Scalar Arguments .. LOGICAL TSTERR INTEGER NM, NN, NNB, NNS, NOUT DOUBLE PRECISION THRESH .. .. Array Arguments .. LOGICAL DOTYPE( * ) INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NSVAL( * ), $ NVAL( * ), NXVAL( * ) DOUBLE PRECISION A( * ), B( * ), C( * ), COPYA( * ), COPYB( * ), $ COPYS( * ), S( * ), WORK( * ) .. Purpose ======= DDRVLS tests the least squares driver routines DGELS, DGELSS, DGELSX, DGELSY and DGELSD. Arguments ========= DOTYPE (input) LOGICAL array, dimension (NTYPES) The matrix types to be used for testing. Matrices of type j (for 1 0.1) taken from a uniform distribution (0,1). A is full rank. j=2: The same of 1, but A is scaled up. j=3: The same of 1, but A is scaled down. j=4: A = U*D*V where U and V are random orthogonal matrices and D has 3*min(M,N)/4 random entries (> 0.1) taken from a uniform distribution (0,1) and the remaining entries set to 0. A is rank-deficient. j=5: The same of 4, but A is scaled up. j=6: The same of 5, but A is scaled down. NM (input) INTEGER The number of values of M contained in the vector MVAL. MVAL (input) INTEGER array, dimension (NM) The values of the matrix row dimension M. NN (input) INTEGER The number of values of N contained in the vector NVAL. NVAL (input) INTEGER array, dimension (NN) The values of the matrix column dimension N. NNS (input) INTEGER The number of values of NRHS contained in the vector NSVAL. NSVAL (input) INTEGER array, dimension (NNS) The values of the number of right hand sides NRHS. NNB (input) INTEGER The number of values of NB and NX contained in the vectors NBVAL and NXVAL. The blocking parameters are used in pairs (NB,NX). NBVAL (input) INTEGER array, dimension (NNB) The values of the blocksize NB. NXVAL (input) INTEGER array, dimension (NNB) The values of the crossover point NX. THRESH (input) DOUBLE PRECISION The threshold value for the test ratios. A result is included in the output file if RESULT >= THRESH. To have every test ratio printed, use THRESH = 0. TSTERR (input) LOGICAL Flag that indicates whether error exits are to be tested. A (workspace) DOUBLE PRECISION array, dimension (MMAX*NMAX) where MMAX is the maximum value of M in MVAL and NMAX is the maximum value of N in NVAL. COPYA (workspace) DOUBLE PRECISION array, dimension (MMAX*NMAX) B (workspace) DOUBLE PRECISION array, dimension (MMAX*NSMAX) where MMAX is the maximum value of M in MVAL and NSMAX is the maximum value of NRHS in NSVAL. COPYB (workspace) DOUBLE PRECISION array, dimension (MMAX*NSMAX) C (workspace) DOUBLE PRECISION array, dimension (MMAX*NSMAX) S (workspace) DOUBLE PRECISION array, dimension (min(MMAX,NMAX)) COPYS (workspace) DOUBLE PRECISION array, dimension (min(MMAX,NMAX)) WORK (workspace) DOUBLE PRECISION array, dimension (MMAX*NMAX + 4*NMAX + MMAX). IWORK (workspace) INTEGER array, dimension (15*NMAX)
                    • derrls

                      private void derrls()
                      This is a port of that portion of version 3.1 LAPACK test routine DERRLS used to test the error exits of the least squares driver routine DGELSS.
                    • dqrt15

                      private void dqrt15​(int scale,
                                          int rksel,
                                          int m,
                                          int n,
                                          int nrhs,
                                          double[][] A,
                                          int lda,
                                          double[][] B,
                                          int ldb,
                                          double[] s,
                                          int[] rank,
                                          double[] norma,
                                          double[] normb,
                                          int[] iseed,
                                          double[] work,
                                          int lwork)
                      This is a port of version 3.1 LAPACK test routine DQRt15. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER LDA, LDB, LWORK, M, N, NRHS, RANK, RKSEL, SCALE DOUBLE PRECISION NORMA, NORMB .. .. Array Arguments .. INTEGER ISEED( 4 ) DOUBLE PRECISION A( LDA, * ), B( LDB, * ), S( * ), WORK( LWORK ) .. Purpose ======= DQRT15 generates a matrix with full or deficient rank and of various norms. Arguments ========= SCALE (input) INTEGER SCALE = 1: normally scaled matrix SCALE = 2: matrix scaled up SCALE = 3: matrix scaled down RKSEL (input) INTEGER RKSEL = 1: full rank matrix RKSEL = 2: rank-deficient matrix M (input) INTEGER The number of rows of the matrix A. N (input) INTEGER The number of columns of A. NRHS (input) INTEGER The number of columns of B. A (output) DOUBLE PRECISION array, dimension (LDA,N) The M-by-N matrix A. LDA (input) INTEGER The leading dimension of the array A. B (output) DOUBLE PRECISION array, dimension (LDB, NRHS) A matrix that is in the range space of matrix A. LDB (input) INTEGER The leading dimension of the array B. S (output) DOUBLE PRECISION array, dimension MIN(M,N) Singular values of A. RANK (output) INTEGER number of nonzero singular values of A. NORMA (output) DOUBLE PRECISION one-norm of A. NORMB (output) DOUBLE PRECISION one-norm of B. ISEED (input/output) integer array, dimension (4) seed for random number generator. WORK (workspace) DOUBLE PRECISION array, dimension (LWORK) LWORK (input) INTEGER length of work space required. LWORK >= MAX(M+MIN(M,N),NRHS*MIN(M,N),2*N+M)
                    • dlaord

                      public void dlaord​(char job,
                                         int n,
                                         double[] x,
                                         int incx)
                      This is a port of version 3.1 LAPACK auxiliary routine DLAORD. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. CHARACTER JOB INTEGER INCX, N .. .. Array Arguments .. DOUBLE PRECISION X( * ) .. Purpose ======= DLAORD sorts the elements of a vector x in increasing or decreasing order. Arguments ========= JOB (input) CHARACTER = 'I': Sort in increasing order = 'D': Sort in decreasing order N (input) INTEGER The length of the vector X. X (input/output) DOUBLE PRECISION array, dimension (1+(N-1)*INCX) On entry, the vector of length n to be sorted. On exit, the vector x is sorted in the prescribed order. INCX (input) INTEGER The spacing between successive elements of X. INCX >= 0.
                    • dlaror

                      private void dlaror​(char side,
                                          char init,
                                          int m,
                                          int n,
                                          double[][] A,
                                          int lda,
                                          int[] iseed,
                                          double[] x,
                                          int[] info)
                      This is a port of version 3.1 LAPACK auxiliary test routine DLAROR. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. CHARACTER INIT, SIDE INTEGER INFO, LDA, M, N .. .. Array Arguments .. INTEGER ISEED( 4 ) DOUBLE PRECISION A( LDA, * ), X( * ) .. Purpose ======= DLAROR pre- or post-multiplies an M by N matrix A by a random orthogonal matrix U, overwriting A. A may optionally be initialized to the identity matrix before multiplying by U. U is generated using the method of G.W. Stewart (SIAM J. Numer. Anal. 17, 1980, 403-409). Arguments ========= SIDE (input) CHARACTER*1 Specifies whether A is multiplied on the left or right by U. = 'L': Multiply A on the left (premultiply) by U = 'R': Multiply A on the right (postmultiply) by U' = 'C' or 'T': Multiply A on the left by U and the right by U' (Here, U' means U-transpose.) INIT (input) CHARACTER*1 Specifies whether or not A should be initialized to the identity matrix. = 'I': Initialize A to (a section of) the identity matrix before applying U. = 'N': No initialization. Apply U to the input matrix A. INIT = 'I' may be used to generate square or rectangular orthogonal matrices: For M = N and SIDE = 'L' or 'R', the rows will be orthogonal to each other, as will the columns. If M N, SIDE = 'L' produces a dense matrix whose columns are orthogonal and whose rows are not, while SIDE = 'R' produces a matrix whose columns are orthogonal, and whose first M rows are orthogonal, and whose remaining rows are zero. M (input) INTEGER The number of rows of A. N (input) INTEGER The number of columns of A. A (input/output) DOUBLE PRECISION array, dimension (LDA, N) On entry, the array A. On exit, overwritten by U A ( if SIDE = 'L' ), or by A U ( if SIDE = 'R' ), or by U A U' ( if SIDE = 'C' or 'T'). LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M). ISEED (input/output) INTEGER array, dimension (4) On entry ISEED specifies the seed of the random number generator. The array elements should be between 0 and 4095; if not they will be reduced mod 4096. Also, ISEED(4) must be odd. The random number generator uses a linear congruential sequence limited to small integers, and so should produce machine independent random numbers. The values of ISEED are changed on exit, and can be used in the next call to DLAROR to continue the same random number sequence. X (workspace) DOUBLE PRECISION array, dimension (3*MAX( M, N )) Workspace of length 2*M + N if SIDE = 'L', 2*N + M if SIDE = 'R', 3*N if SIDE = 'C' or 'T'. INFO (output) INTEGER An error flag. It is set to: = 0: normal return
                      • dqrt16

                        private void dqrt16​(char trans,
                                            int m,
                                            int n,
                                            int nrhs,
                                            double[][] A,
                                            int lda,
                                            double[][] X,
                                            int ldx,
                                            double[][] B,
                                            int ldb,
                                            double[] rwork,
                                            double[] resid)
                        This is a port of version 3.1 LAPACK test routine DQRT16. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. CHARACTER TRANS INTEGER LDA, LDB, LDX, M, N, NRHS DOUBLE PRECISION RESID .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), B( LDB, * ), RWORK( * ), $ X( LDX, * ) .. Purpose ======= DQRT16 computes the residual for a solution of a system of linear equations A*x = b or A'*x = b: RESID = norm(B - A*X) / ( max(m,n) * norm(A) * norm(X) * EPS ), where EPS is the machine epsilon. Arguments ========= TRANS (input) CHARACTER*1 Specifies the form of the system of equations: = 'N': A *x = b = 'T': A'*x = b, where A' is the transpose of A = 'C': A'*x = b, where A' is the transpose of A M (input) INTEGER The number of rows of the matrix A. M >= 0. N (input) INTEGER The number of columns of the matrix A. N >= 0. NRHS (input) INTEGER The number of columns of B, the matrix of right hand sides. NRHS >= 0. A (input) DOUBLE PRECISION array, dimension (LDA,N) The original M x N matrix A. LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M). X (input) DOUBLE PRECISION array, dimension (LDX,NRHS) The computed solution vectors for the system of linear equations. LDX (input) INTEGER The leading dimension of the array X. If TRANS = 'N', LDX >= max(1,N); if TRANS = 'T' or 'C', LDX >= max(1,M). B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the right hand side vectors for the system of linear equations. On exit, B is overwritten with the difference B - A*X. LDB (input) INTEGER The leading dimension of the array B. IF TRANS = 'N', LDB >= max(1,M); if TRANS = 'T' or 'C', LDB >= max(1,N). RWORK (workspace) DOUBLE PRECISION array, dimension (M) RESID (output) DOUBLE PRECISION The maximum over the number of right hand sides of norm(B - A*X) / ( max(m,n) * norm(A) * norm(X) * EPS ).
                      • dqrt17

                        private double dqrt17​(char trans,
                                              int iresid,
                                              int m,
                                              int n,
                                              int nrhs,
                                              double[][] A,
                                              int lda,
                                              double[][] X,
                                              int ldx,
                                              double[][] B,
                                              int ldb,
                                              double[][] C)
                        This is a port of version 3.1 LAPACK test routine DQRT17. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. CHARACTER TRANS INTEGER IRESID, LDA, LDB, LDX, LWORK, M, N, NRHS .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDB, * ), $ WORK( LWORK ), X( LDX, * ) .. Purpose ======= DQRT17 computes the ratio || R'*op(A) ||/(||A||*alpha*max(M,N,NRHS)*eps) where R = op(A)*X - B, op(A) is A or A', and alpha = ||B|| if IRESID = 1 (zero-residual problem) alpha = ||R|| if IRESID = 2 (otherwise). Arguments ========= TRANS (input) CHARACTER*1 Specifies whether or not the transpose of A is used. = 'N': No transpose, op(A) = A. = 'T': Transpose, op(A) = A'. IRESID (input) INTEGER IRESID = 1 indicates zero-residual problem. IRESID = 2 indicates non-zero residual. M (input) INTEGER The number of rows of the matrix A. If TRANS = 'N', the number of rows of the matrix B. If TRANS = 'T', the number of rows of the matrix X. N (input) INTEGER The number of columns of the matrix A. If TRANS = 'N', the number of rows of the matrix X. If TRANS = 'T', the number of rows of the matrix B. NRHS (input) INTEGER The number of columns of the matrices X and B. A (input) DOUBLE PRECISION array, dimension (LDA,N) The m-by-n matrix A. LDA (input) INTEGER The leading dimension of the array A. LDA >= M. X (input) DOUBLE PRECISION array, dimension (LDX,NRHS) If TRANS = 'N', the n-by-nrhs matrix X. If TRANS = 'T', the m-by-nrhs matrix X. LDX (input) INTEGER The leading dimension of the array X. If TRANS = 'N', LDX >= N. If TRANS = 'T', LDX >= M. B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) If TRANS = 'N', the m-by-nrhs matrix B. If TRANS = 'T', the n-by-nrhs matrix B. LDB (input) INTEGER The leading dimension of the array B. If TRANS = 'N', LDB >= M. If TRANS = 'T', LDB >= N. C (workspace) DOUBLE PRECISION array, dimension (LDB,NRHS)
                      • dqrt13

                        private void dqrt13​(int scale,
                                            int m,
                                            int n,
                                            double[][] A,
                                            int lda,
                                            double[] norma,
                                            int[] iseed)
                      • dqrt14

                        private double dqrt14​(char trans,
                                              int m,
                                              int n,
                                              int nrhs,
                                              double[][] A,
                                              int lda,
                                              double[][] X,
                                              int ldx,
                                              double[] work,
                                              int lwork)
                        This is a port of version 3.1 LAPACK test routine DQRT14. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. CHARACTER TRANS INTEGER LDA, LDX, LWORK, M, N, NRHS .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), WORK( LWORK ), X( LDX, * ) .. Purpose ======= DQRT14 checks whether X is in the row space of A or A'. It does so by scaling both X and A such that their norms are in the range [sqrt(eps), 1/sqrt(eps)], then computing a QR factorization of [A,X] (if TRANS = 'T') or an LQ factorization of [A',X]' (if TRANS = 'N'), and returning the norm of the trailing triangle, scaled by MAX(M,N,NRHS)*eps. Arguments ========= TRANS (input) CHARACTER*1 = 'N': No transpose, check for X in the row space of A = 'T': Transpose, check for X in the row space of A'. M (input) INTEGER The number of rows of the matrix A. N (input) INTEGER The number of columns of the matrix A. NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of X. A (input) DOUBLE PRECISION array, dimension (LDA,N) The M-by-N matrix A. LDA (input) INTEGER The leading dimension of the array A. X (input) DOUBLE PRECISION array, dimension (LDX,NRHS) If TRANS = 'N', the N-by-NRHS matrix X. IF TRANS = 'T', the M-by-NRHS matrix X. LDX (input) INTEGER The leading dimension of the array X. WORK (workspace) DOUBLE PRECISION array dimension (LWORK) LWORK (input) INTEGER length of workspace array required If TRANS = 'N', LWORK >= (M+NRHS)*(N+2); if TRANS = 'T', LWORK >= (N+NRHS)*(M+2).
                      • dchkbd_test

                        public void dchkbd_test()
                        This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive dchkbd in order to run dchkbd to test the singular value decomposition routines, dgebrd, dorgbr, and dbdsqr. Numerical values were obtained from the svd.in datafile. Original DCHKEE created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., January, 2007
                      • dchkbd

                        private void dchkbd​(int nsizes,
                                            int[] mval,
                                            int[] nval,
                                            int ntypes,
                                            boolean[] dotype,
                                            int nrhs,
                                            int[] iseed,
                                            double thresh,
                                            double[][] A,
                                            int lda,
                                            double[] bd,
                                            double[] be,
                                            double[] s1,
                                            double[] s2,
                                            double[][] X,
                                            int ldx,
                                            double[][] Y,
                                            double[][] Z,
                                            double[][] Q,
                                            int ldq,
                                            double[][] PT,
                                            int ldpt,
                                            double[][] U,
                                            double[][] VT,
                                            double[] work,
                                            int lwork,
                                            int[] iwork,
                                            int[] info)
                        This is a port of most of version 3.1 LAPACK test routine DCHKBD. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER INFO, LDA, LDPT, LDQ, LDX, LWORK, NOUT, NRHS, $ NSIZES, NTYPES DOUBLE PRECISION THRESH .. .. Array Arguments .. LOGICAL DOTYPE( * ) INTEGER ISEED( 4 ), IWORK( * ), MVAL( * ), NVAL( * ) DOUBLE PRECISION A( LDA, * ), BD( * ), BE( * ), PT( LDPT, * ), $ Q( LDQ, * ), S1( * ), S2( * ), U( LDPT, * ), $ VT( LDPT, * ), WORK( * ), X( LDX, * ), $ Y( LDX, * ), Z( LDX, * ) .. Purpose ======= DCHKBD checks the singular value decomposition (SVD) routines. DGEBRD reduces a real general m by n matrix A to upper or lower bidiagonal form B by an orthogonal transformation: Q' * A * P = B (or A = Q * B * P'). The matrix B is upper bidiagonal if m >= n and lower bidiagonal if m 0) P: min(M,N) x N B: min(M,N) x min(M,N) U, V: min(M,N) x min(M,N) S1, S2 diagonal, order min(M,N) X: M x NRHS For each generated matrix, 14 tests are performed: Test DGEBRD and DORGBR (1) | A - Q B PT | / ( |A| max(M,N) ulp ), PT = P' (2) | I - Q' Q | / ( M ulp ) (3) | I - PT PT' | / ( N ulp ) Test DBDSQR on bidiagonal matrix B (4) | B - U S1 VT | / ( |B| min(M,N) ulp ), VT = V' (5) | Y - U Z | / ( |Y| max(min(M,N),k) ulp ), where Y = Q' X and Z = U' Y. (6) | I - U' U | / ( min(M,N) ulp ) (7) | I - VT VT' | / ( min(M,N) ulp ) (8) S1 contains min(M,N) nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.) (9) | S1 - S2 | / ( |S1| ulp ), where S2 is computed without computing U and V. (10) 0 if the true singular values of B are within THRESH of those in S1. 2*THRESH if they are not. (Tested using DSVDCH) Test DBDSQR on matrix A (11) | A - (QU) S (VT PT) | / ( |A| max(M,N) ulp ) (12) | X - (QU) Z | / ( |X| max(M,k) ulp ) (13) | I - (QU)'(QU) | / ( M ulp ) (14) | I - (VT PT) (PT'VT') | / ( N ulp ) Test DBDSDC on bidiagonal matrix B (15) | B - U S1 VT | / ( |B| min(M,N) ulp ), VT = V' (16) | I - U' U | / ( min(M,N) ulp ) (17) | I - VT VT' | / ( min(M,N) ulp ) (18) S1 contains min(M,N) nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.) (19) | S1 - S2 | / ( |S1| ulp ), where S2 is computed without computing U and V. The possible matrix types are (1) The zero matrix. (2) The identity matrix. (3) A diagonal matrix with evenly spaced entries 1, ..., ULP and random signs. (ULP = (first number larger than 1) - 1 ) (4) A diagonal matrix with geometrically spaced entries 1, ..., ULP and random signs. (5) A diagonal matrix with "clustered" entries 1, ULP, ..., ULP and random signs. (6) Same as (3), but multiplied by SQRT( overflow threshold ) (7) Same as (3), but multiplied by SQRT( underflow threshold ) (8) A matrix of the form U D V, where U and V are orthogonal and D has evenly spaced entries 1, ..., ULP with random signs on the diagonal. (9) A matrix of the form U D V, where U and V are orthogonal and D has geometrically spaced entries 1, ..., ULP with random signs on the diagonal. (10) A matrix of the form U D V, where U and V are orthogonal and D has "clustered" entries 1, ULP,..., ULP with random signs on the diagonal. (11) Same as (8), but multiplied by SQRT( overflow threshold ) (12) Same as (8), but multiplied by SQRT( underflow threshold ) (13) Rectangular matrix with random entries chosen from (-1,1). (14) Same as (13), but multiplied by SQRT( overflow threshold ) (15) Same as (13), but multiplied by SQRT( underflow threshold ) Special case: (16) A bidiagonal matrix with random entries chosen from a logarithmic distribution on [ulp^2,ulp^(-2)] (I.e., each entry is e^x, where x is chosen uniformly on [ 2 log(ulp), -2 log(ulp) ] .) For *this* type: (a) DGEBRD is not called to reduce it to bidiagonal form. (b) the bidiagonal is min(M,N) x min(M,N); if M= THRESH. To have every test ratio printed, use THRESH = 0. Note that the expected value of the test ratios is O(1), so THRESH should be a reasonably small multiple of 1, e.g., 10 or 100. A (workspace) DOUBLE PRECISION array, dimension (LDA,NMAX) where NMAX is the maximum value of N in NVAL. LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,MMAX), where MMAX is the maximum value of M in MVAL. BD (workspace) DOUBLE PRECISION array, dimension (max(min(MVAL(j),NVAL(j)))) BE (workspace) DOUBLE PRECISION array, dimension (max(min(MVAL(j),NVAL(j)))) S1 (workspace) DOUBLE PRECISION array, dimension (max(min(MVAL(j),NVAL(j)))) S2 (workspace) DOUBLE PRECISION array, dimension (max(min(MVAL(j),NVAL(j)))) X (workspace) DOUBLE PRECISION array, dimension (LDX,NRHS) LDX (input) INTEGER The leading dimension of the arrays X, Y, and Z. LDX >= max(1,MMAX) Y (workspace) DOUBLE PRECISION array, dimension (LDX,NRHS) Z (workspace) DOUBLE PRECISION array, dimension (LDX,NRHS) Q (workspace) DOUBLE PRECISION array, dimension (LDQ,MMAX) LDQ (input) INTEGER The leading dimension of the array Q. LDQ >= max(1,MMAX). PT (workspace) DOUBLE PRECISION array, dimension (LDPT,NMAX) LDPT (input) INTEGER The leading dimension of the arrays PT, U, and V. LDPT >= max(1, max(min(MVAL(j),NVAL(j)))). U (workspace) DOUBLE PRECISION array, dimension (LDPT,max(min(MVAL(j),NVAL(j)))) V (workspace) DOUBLE PRECISION array, dimension (LDPT,max(min(MVAL(j),NVAL(j)))) WORK (workspace) DOUBLE PRECISION array, dimension (LWORK) LWORK (input) INTEGER The number of entries in WORK. This must be at least 3(M+N) and M(M + max(M,N,k) + 1) + N*min(M,N) for all pairs (M,N)=(MM(j),NN(j)) IWORK (workspace) INTEGER array, dimension at least 8*min(M,N) NOUT (input) INTEGER The FORTRAN unit number for printing out error messages (e.g., if a routine returns IINFO not equal to 0.) INFO (output) INTEGER If 0, then everything ran OK. -1: NSIZES
                        • derrbd

                          private void derrbd()
                          This is a port of that portion of version 3.1 LAPACK test routine DERRBD used to test the error exits for dgebrd, dorgbr, dormbr, and dbdsqr.
                        • dbdt01

                          public void dbdt01​(int m,
                                             int n,
                                             int kd,
                                             double[][] A,
                                             int lda,
                                             double[][] Q,
                                             int ldq,
                                             double[] d,
                                             double[] e,
                                             double[][] PT,
                                             int ldpt,
                                             double[] work,
                                             double[] resid)
                          This is a port of version 3.1 LAPACK test routine DBDT01. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER KD, LDA, LDPT, LDQ, M, N DOUBLE PRECISION RESID .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ), D( * ), E( * ), PT( LDPT, * ), $ Q( LDQ, * ), WORK( * ) .. Purpose ======= DBDT01 reconstructs a general matrix A from its bidiagonal form A = Q * B * P' where Q (m by min(m,n)) and P' (min(m,n) by n) are orthogonal matrices and B is bidiagonal. The test ratio to test the reduction is RESID = norm( A - Q * B * PT ) / ( n * norm(A) * EPS ) where PT = P' and EPS is the machine precision. Arguments ========= M (input) INTEGER The number of rows of the matrices A and Q. N (input) INTEGER The number of columns of the matrices A and P'. KD (input) INTEGER If KD = 0, B is diagonal and the array E is not referenced. If KD = 1, the reduction was performed by xGEBRD; B is upper bidiagonal if M >= N, and lower bidiagonal if M = max(1,M). Q (input) DOUBLE PRECISION array, dimension (LDQ,N) The m by min(m,n) orthogonal matrix Q in the reduction A = Q * B * P'. LDQ (input) INTEGER The leading dimension of the array Q. LDQ >= max(1,M). D (input) DOUBLE PRECISION array, dimension (min(M,N)) The diagonal elements of the bidiagonal matrix B. E (input) DOUBLE PRECISION array, dimension (min(M,N)-1) The superdiagonal elements of the bidiagonal matrix B if m >= n, or the subdiagonal elements of B if m = max(1,min(M,N)). WORK (workspace) DOUBLE PRECISION array, dimension (M+N) RESID (output) DOUBLE PRECISION The test ratio: norm(A - Q * B * P') / ( n * norm(A) * EPS )
                        • dort01

                          public void dort01​(char rowcol,
                                             int m,
                                             int n,
                                             double[][] U,
                                             int ldu,
                                             double[][] work,
                                             int lwork,
                                             double[] resid)
                          This is the port of version 3.1 LAPACK test routine DORT01. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. CHARACTER ROWCOL INTEGER LDU, LWORK, M, N DOUBLE PRECISION RESID .. .. Array Arguments .. DOUBLE PRECISION U( LDU, * ), WORK( * ) .. Purpose ======= DORT01 checks that the matrix U is orthogonal by computing the ratio RESID = norm( I - U*U' ) / ( n * EPS ), if ROWCOL = 'R', or RESID = norm( I - U'*U ) / ( m * EPS ), if ROWCOL = 'C'. Alternatively, if there isn't sufficient workspace to form I - U*U' or I - U'*U, the ratio is computed as RESID = abs( I - U*U' ) / ( n * EPS ), if ROWCOL = 'R', or RESID = abs( I - U'*U ) / ( m * EPS ), if ROWCOL = 'C'. where EPS is the machine precision. ROWCOL is used only if m = n; if m > n, ROWCOL is assumed to be 'C', and if m n or if m = n and ROWCOL = 'C'. U is checked for orthogonal rows if m = max(1,M). WORK (workspace) DOUBLE PRECISION array, dimension (min(m,n),min(m,n)) In ge.dlaset, ge.dsyrk, and ge.dlansy work must be 2D array. LWORK (input) INTEGER The length of the array WORK. For best performance, LWORK should be at least N*(N+1) if ROWCOL = 'C' or M*(M+1) if ROWCOL = 'R', but the test will be done even if LWORK is 0. RESID (output) DOUBLE PRECISION RESID = norm( I - U * U' ) / ( n * EPS ), if ROWCOL = 'R', or RESID = norm( I - U' * U ) / ( m * EPS ), if ROWCOL = 'C'.
                        • dbdt02

                          private void dbdt02​(int m,
                                              int n,
                                              double[][] B,
                                              int ldb,
                                              double[][] C,
                                              int ldc,
                                              double[][] U,
                                              int ldu,
                                              double[] work,
                                              double[] resid)
                          This is a port of version 3.1 LAPACK test routine DBDT02. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER LDB, LDC, LDU, M, N DOUBLE PRECISION RESID .. .. Array Arguments .. DOUBLE PRECISION B( LDB, * ), C( LDC, * ), U( LDU, * ), $ WORK( * ) .. Purpose ======= DBDT02 tests the change of basis C = U' * B by computing the residual RESID = norm( B - U * C ) / ( max(m,n) * norm(B) * EPS ), where B and C are M by N matrices, U is an M by M orthogonal matrix, and EPS is the machine precision. Arguments ========= M (input) INTEGER The number of rows of the matrices B and C and the order of the matrix Q. N (input) INTEGER The number of columns of the matrices B and C. B (input) DOUBLE PRECISION array, dimension (LDB,N) The m by n matrix B. LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,M). C (input) DOUBLE PRECISION array, dimension (LDC,N) The m by n matrix C, assumed to contain U' * B. LDC (input) INTEGER The leading dimension of the array C. LDC >= max(1,M). U (input) DOUBLE PRECISION array, dimension (LDU,M) The m by m orthogonal matrix U. LDU (input) INTEGER The leading dimension of the array U. LDU >= max(1,M). WORK (workspace) DOUBLE PRECISION array, dimension (M) RESID (output) DOUBLE PRECISION RESID = norm( B - U * C ) / ( max(m,n) * norm(B) * EPS ),
                        • dbdt03

                          private void dbdt03​(char uplo,
                                              int n,
                                              int kd,
                                              double[] d,
                                              double[] e,
                                              double[][] U,
                                              int ldu,
                                              double[] s,
                                              double[][] VT,
                                              int ldvt,
                                              double[] work,
                                              double[] resid)
                          This is a port of version 3.1 LAPACK test routine DBDT03. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. CHARACTER UPLO INTEGER KD, LDU, LDVT, N DOUBLE PRECISION RESID .. .. Array Arguments .. DOUBLE PRECISION D( * ), E( * ), S( * ), U( LDU, * ), $ VT( LDVT, * ), WORK( * ) .. Purpose ======= DBDT03 reconstructs a bidiagonal matrix B from its SVD: S = U' * B * V where U and V are orthogonal matrices and S is diagonal. The test ratio to test the singular value decomposition is RESID = norm( B - U * S * VT ) / ( n * norm(B) * EPS ) where VT = V' and EPS is the machine precision. Arguments ========= UPLO (input) CHARACTER*1 Specifies whether the matrix B is upper or lower bidiagonal. = 'U': Upper bidiagonal = 'L': Lower bidiagonal N (input) INTEGER The order of the matrix B. KD (input) INTEGER The bandwidth of the bidiagonal matrix B. If KD = 1, the matrix B is bidiagonal, and if KD = 0, B is diagonal and E is not referenced. If KD is greater than 1, it is assumed to be 1, and if KD is less than 0, it is assumed to be 0. D (input) DOUBLE PRECISION array, dimension (N) The n diagonal elements of the bidiagonal matrix B. E (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) superdiagonal elements of the bidiagonal matrix B if UPLO = 'U', or the (n-1) subdiagonal elements of B if UPLO = 'L'. U (input) DOUBLE PRECISION array, dimension (LDU,N) The n by n orthogonal matrix U in the reduction B = U'*A*P. LDU (input) INTEGER The leading dimension of the array U. LDU >= max(1,N) S (input) DOUBLE PRECISION array, dimension (N) The singular values from the SVD of B, sorted in decreasing order. VT (input) DOUBLE PRECISION array, dimension (LDVT,N) The n by n orthogonal matrix V' in the reduction B = U * S * V'. LDVT (input) INTEGER The leading dimension of the array VT. WORK (workspace) DOUBLE PRECISION array, dimension (2*N) RESID (output) DOUBLE PRECISION The test ratio: norm(B - U * S * V') / ( n * norm(A) * EPS )
                        • dsvdch

                          private void dsvdch​(int n,
                                              double[] s,
                                              double[] e,
                                              double[] svd,
                                              double tol,
                                              int[] info)
                          This is a port of version 3.1 LAPACK test routine DSVDCH. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER INFO, N DOUBLE PRECISION TOL .. .. Array Arguments .. DOUBLE PRECISION E( * ), S( * ), SVD( * ) .. Purpose ======= DSVDCH checks to see if SVD(1) ,..., SVD(N) are accurate singular values of the bidiagonal matrix B with diagonal entries S(1) ,..., S(N) and superdiagonal entries E(1) ,..., E(N-1)). It does this by expanding each SVD(I) into an interval [SVD(I) * (1-EPS) , SVD(I) * (1+EPS)], merging overlapping intervals if any, and using Sturm sequences to count and verify whether each resulting interval has the correct number of singular values (using DSVDCT). Here EPS=TOL*MAX(N/10,1)*MAZHEP, where MACHEP is the machine precision. The routine assumes the singular values are sorted with SVD(1) the largest and SVD(N) smallest. If each interval contains the correct number of singular values, INFO = 0 is returned, otherwise INFO is the index of the first singular value in the first bad interval. Arguments ========== N (input) INTEGER The dimension of the bidiagonal matrix B. S (input) DOUBLE PRECISION array, dimension (N) The diagonal entries of the bidiagonal matrix B. E (input) DOUBLE PRECISION array, dimension (N-1) The superdiagonal entries of the bidiagonal matrix B. SVD (input) DOUBLE PRECISION array, dimension (N) The computed singular values to be checked. TOL (input) DOUBLE PRECISION Error tolerance for checking, a multiplier of the machine precision. INFO (output) INTEGER =0 if the singular values are all correct (to within 1 +- TOL*MAZHEPS) >0 if the interval containing the INFO-th singular value contains the incorrect number of singular values.
                        • dsvdct

                          private void dsvdct​(int n,
                                              double[] s,
                                              double[] e,
                                              double shift,
                                              int[] num)
                          This is a port of version 3.1 LAPACK test routine DSVDCT. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER N, NUM DOUBLE PRECISION SHIFT .. .. Array Arguments .. DOUBLE PRECISION E( * ), S( * ) .. Purpose ======= DSVDCT counts the number NUM of eigenvalues of a 2*N by 2*N tridiagonal matrix T which are less than or equal to SHIFT. T is formed by putting zeros on the diagonal and making the off-diagonals equal to S(1), E(1), S(2), E(2), ... , E(N-1), S(N). If SHIFT is positive, NUM is equal to N plus the number of singular values of a bidiagonal matrix B less than or equal to SHIFT. Here B has diagonal entries S(1), ..., S(N) and superdiagonal entries E(1), ... E(N-1). If SHIFT is negative, NUM is equal to the number of singular values of B greater than or equal to -SHIFT. See W. Kahan "Accurate Eigenvalues of a Symmetric Tridiagonal Matrix", Report CS41, Computer Science Dept., Stanford University, July 21, 1966 Arguments ========= N (input) INTEGER The dimension of the bidiagonal matrix B. S (input) DOUBLE PRECISION array, dimension (N) The diagonal entries of the bidiagonal matrix B. E (input) DOUBLE PRECISION array of dimension (N-1) The superdiagonal entries of the bidiagonal matrix B. SHIFT (input) DOUBLE PRECISION The shift, used as described under Purpose. NUM (output) INTEGER The number of eigenvalues of T less than or equal to SHIFT.
                        • xlaenv

                          private void xlaenv​(int ispec,
                                              int nvalue)
                          This is a port of version 3.1 LAPACK auxiliary routine XLAENV. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. November 2006 .. Scalar Arguments .. INTEGER ISPEC, NVALUE .. Purpose ======= XLAENV sets certain machine- and problem-dependent quantities which will later be retrieved by ILAENV. Arguments ========= ISPEC (input) INTEGER Specifies the parameter to be set in the COMMON array IPARMS. = 1: the optimal blocksize; if this value is 1, an unblocked algorithm will give the best performance. = 2: the minimum block size for which the block routine should be used; if the usable block size is less than this value, an unblocked routine should be used. = 3: the crossover point (in a block routine, for N less than this value, an unblocked routine should be used) = 4: the number of shifts, used in the nonsymmetric eigenvalue routines = 5: the minimum column dimension for blocking to be used; rectangular blocks must have dimension at least k by m, where k is given by ILAENV(2,...) and m by ILAENV(5,...) = 6: the crossover point for the SVD (when reducing an m by n matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds this value, a QR factorization is used first to reduce the matrix to a triangular form) = 7: the number of processors = 8: another crossover point, for the multishift QR and QZ methods for nonsymmetric eigenvalue problems. = 9: maximum size of the subproblems at the bottom of the computation tree in the divide-and-conquer algorithm (used by xGELSD and xGESDD) =10: ieee NaN arithmetic can be trusted not to trap =11: infinity arithmetic can be trusted not to trap NVALUE (input) INTEGER The value of the parameter specified by ISPEC.