Class GeneralizedEigenvalue

  • All Implemented Interfaces:
    java.io.Serializable

    public class GeneralizedEigenvalue
    extends java.lang.Object
    implements java.io.Serializable
    This file contains 1 user callable eigenvalue function and 2 user callable generalized eigenvalue functions.

    The eigenvalue problem solves the equation: A*x = lambda*x, where A is an n-by-n matrix, x is an n-length column vector, and lambda is a scalar. The eigenvalues are the n values of lambda that solve the equation, and the corresponding values of x are the right eigenvectors. The function dsyev solves the eigenvalue problem for the case of real symmetric matrix A.

    The generalized eigenvalue problem solves the equation: A*x = lambda*B*x where both A and B are n-by-n matrices and lambda is a scalar. The generalized eigenvalues are the n values of lambda that solve the equation, and the corresponding values of x are the generalized right eigenvectors. The function dsygv solves the generalized eigenvalue problem for the case of real symmetric A, symmetric positive definite B. The funciton dggev solves the generalized eigenvalue problem for the case of real nonsymmetric A, real general B.

    The symmetric generalized eigenvalue driver dsygv was tested with dsygv_test. The statement All 882 tests for dsygv passed the threshold was repeated 3 times. dchkst_test was implemented to test the dsytrd, dorgtr, dsteqr, and dsterf routines belonging to the dsygv drver. The statement All 1134 tests for dchkst passed the threshold was repeated 5 times. ddrvst_test was implemented to test dsyev. The statement All 648 tests for ddrvst passed the threshold was repeated 5 times.

    The nonsymmetric generalized eigenvalue driver dggev was tested with dggev_test. The resulting statement was 21 out of 1092 dggev tests failed to pass the threshold. Note that updating dgeqr2 from 3.1 to 3.2 increased the number of errors from 17 to 21. dchkgl was implemented to test the dggbal balancing routine of dggev. All 8 tests showed no signficant error. dchkgk was implemented to test the dggbak backward balancing routine of dggev. All 8 tests showed no significant error. dchkgg_test was implemented to test the dgghrd, dhgeqz, and dtgevc routines of the dggev driver. The following output statements resulted: 15 out of 2121 dchkgg tests failed to pass the threshold. 10 out of 2156 dchkgg tests failed to pass the threshold. 8 out of 2149 dchkgg tests failed to pass the threshold. 9 out of 2156 dchkgg tests failed to pass the threshold. The errors in the nonsymmetric case would not occur for matrix sizes of 5 or less. Following one case in parallel in the FORTRAN on the WATCOM compiler and on Java revealed input variables that were identical up to about 9 signficant places yielding an output variable of 7.77E-16 on the FORTRAN and -2.61E-15 on the Java. So apparently the Java failures are due to the Java 64 bit arithmetic having a greater error than the FORTRAN 64 bit arithmetic.

    dchkqr.test() tests dgeqrf, dorgqr, and dormqr. All 30744 tests run passed the threshold.

    Running 8 self-tests: if (runTest) { GeneralizedEigenvalue ge = new GeneralizedEigenvalue(); //ge.dchkgg_test(); ge.dchkst_test(); //ge.ddrvst_test(); //ge.dggev_test(); //ge.dsygv_test(); //ge.dchkgl(); //ge.dchkgk(); //ge.dchkqr.test(); return; }

    There are basically 2 problems with Java precision. 1.) The Intel Pentium uses 80 bit numbers in floating point registers. However, Java must round each number back to 64 bits whenever a Java variable is assigned. There used to be a proposal to introduce a special keyword extendedfp to fully use whatever math the platform had, but it didn't get thru. Apparently the Java designers felt for Java being consistent is more important than being successful. 2.) Java also forbids the use of fused multiply-add (FMA) operations. This operation computes the quantity ax + y as a single floating-point operation. Operations of this type are found in many compute-intensive applications, particularly matrix operations. With this instruction, only a single rounding occurs for the two arithmetic operations, yielding a more accurate result in less time than would be required for two separate operations. Java's strict language definition does not permit use of FMAs and thus sacrifices up to 50% of performance on some platforms.

    The only obvious cure for this problem would be to use the Java BigDecimal class. However, the use of BigDecimal would involve much more work than just changing doubles to BigDecimals. For example, with doubles I would write: f = f/g; With BigDecimal I would write: f = f.divide(g, mc); where mc is the mathematical context settings. Likewise, instead of the ordinary arithmetic operators I would have to use add, compareTo, equals, negate, plus, remainder, and subtract. Using BigDecimal would undoubtedly slow the program down considerably.

    On significant change was made in the port of the nonsymmetric driver. In routine dhgeqz the number of maximum iterations maxit was increased from 30 * (ihi-ilo+1) to 300 * (ihi-ilo+1)


    Copyright (c) 1992-2007 The University of Tennessee. All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

    - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer listed in this license in the documentation and/or other materials provided with the distribution.

    - Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double badc1_dlatb4  
      private double badc2_dlatb4  
      private double base
      DOCUMENT ME!
      private double emax
      DOCUMENT ME!
      private double emin
      DOCUMENT ME!
      private double eps
      DOCUMENT ME!
      private double eps_dlatb4  
      private boolean first
      ------------------------ Class variables ------------------------ Double precision machine parameters found in routine dlamch.
      private boolean first_dlartg
      Double precison machine variables found in routine dlartg.
      private boolean first_dlatb4
      Found in routine dlatb4
      private int[] iparms
      DOCUMENT ME!
      private double[] large_dlatb4  
      private double prec
      DOCUMENT ME!
      private double rmax
      DOCUMENT ME!
      private double rmin
      DOCUMENT ME!
      private double rnd
      DOCUMENT ME!
      private double safmin
      DOCUMENT ME!
      private double safmn2
      DOCUMENT ME!
      private double safmx2
      DOCUMENT ME!
      private static long serialVersionUID
      Use serialVersionUID for interoperability.
      private double sfmin
      DOCUMENT ME!
      private double[] small_dlatb4  
      private double t
      DOCUMENT ME!
      private ViewUserInterface UI
      Common variables in testing routines.
    • Constructor Summary

      Constructors 
      Constructor Description
      GeneralizedEigenvalue()
      Creates a new GeneralizedEigenvalue object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void daxpy​(int n, double da, double[] dx, int incx, double[] dy, int incy)
      Port of 12/3/93 linpack routine daxpy Original version written by Jack Dongarra vector dy = vector dy + da * vector dx.
      private void dchkgg​(int nsizes, int[] nn, int ntypes, boolean[] dotype, int[] iseed, double thresh, boolean tstdif, double thrshn, double[][] A, int lda, double[][] B, double[][] H, double[][] T, double[][] S1, double[][] S2, double[][] P1, double[][] P2, double[][] U, int ldu, double[][] V, double[][] Q, double[][] Z, double[] alphr1, double[] alphi1, double[] beta1, double[] alphr3, double[] alphi3, double[] beta3, double[][] evectl, double[][] evectr, double[] work, int lwork, boolean[] llwork, double[] result, int[] info)
      This is a port of version 3.1 LAPACK test routine DCHKGG Original DCHKGG created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dchkgg checks the nonsymmetric generalized eigenvalue problem routines.
      void dchkgg_test()
      This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive dchkgg in order to run dchkgg to test the nonsymmetric generalized eigenvalue problem.
      void dchkgk()
      This is a port of version 3.1 LAPACK test routine DCHKGK Original DCHKGK created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 Sample data values obtained from the file dgbak.in dchkgk tests dggbak, a routine for backward balancing of a matrix pair (A, B).
      void dchkgl()
      This is a port of version 3.1 LAPACK test routine DCHKGL Original DCHKGL created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 Sample data values obtained from the file dgbal.in
      void dchkql​(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)  
      void dchkql_test()
      This dchkql_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 dchkqr​(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[][] AR, 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 DCHKQR Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
      void dchkqr_test()
      This dchkqr_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 dchkst​(int nsizes, int[] nn, int ntypes, boolean[] dotype, int[] iseed, double thresh, double[][] A, int lda, double[] AP, double[] SD, double[] SE, double[] D1, double[] D2, double[] D3, double[] D4, double[] D5, double[] WA1, double[] WA2, double[] WA3, double[] WR, double[][] U, int ldu, double[][] V, double[] VP, double[] tau, double[][] Z, double[] work, int lwork, int[] iwork, int liwork, double[] result, int[] info)
      This is a port of the porions of LAPACK version 3.1 test routine DCHKST used to test the symmetric eigenvalue routines dsytrd, dorgtr, dsteqr, dsterf, and dsteqr.
      void dchkst_test()
      This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive dchkst, that tests routines used in symmetric generalized eigenvalue problem.
      double ddot​(int n, double[] dx, int incx, double[] dy, int incy)
      Port of 12/3/93 linpack ddot routine Original version created by Jack Dongarra Forms the dot product of two vectors.
      private void ddrgev​(int nsizes, int[] nn, int ntypes, boolean[] dotype, int[] iseed, double thresh, double[][] A, int lda, double[][] B, double[][] S, double[][] T, double[][] Q, int ldq, double[][] Z, double[][] QE, int ldqe, double[] alphar, double[] alphai, double[] beta, double[] alphr1, double[] alphi1, double[] beta1, double[] work, int lwork, double[] result, int[] info)
      This is a port of version 3.1 LAPACK test routine DDRGEV Original DDRGEV created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2007 ddrgev checks the nonsymmetric generalized eigenvalue problem driver routine dggev.
      private void ddrvsg​(int nsizes, int[] nn, int ntypes, boolean[] dotype, int[] iseed, double thresh, double[][] A, int lda, double[][] B, int ldb, double[] D, double[][] Z, int ldz, double[][] AB, double[][] BB, double[] AP, double[] BP, double[] work, int nwork, int[] iwork, int liwork, double[] result, int[] info)
      This is a port of that portion of the version 3.1 LAPACK test routine DDRVSG that tests the DSYGV that computes all eigenvalues and, optionally, eigenvectors of a real symmetric-definite generalized eigenproblem.
      private void ddrvst​(int nsizes, int[] nn, int ntypes, boolean[] dotype, int[] iseed, double thresh, double[][] A, int lda, double[] D1, double[] D2, double[] D3, double[] D4, double[] eveigs, double[] WA1, double[] WA2, double[] WA3, double[][] U, int ldu, double[][] V, double[] tau, double[][] Z, double[] work, int lwork, int[] iwork, int liwork, double[] result, int[] info)
      This is a port of the part of version 3.1 LAPACK test routine DDRVST used to test dsyev.
      void ddrvst_test()
      This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive ddrvst, that tests symmetric generalized eigenvalue drivers.
      private void derrqr()
      This is a port of a portion of version 3.1 LAPACK routine DERRQR. * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
      void dgemm​(char transa, char transb, int m, int n, int k, double alpha, double[][] A, int lda, double[][] B, int ldb, double beta, double[][] C, int ldc)
      This is a port of the 2/8/89 Blas routine Original version written by: Jack Dongarra, Argonne National Laboratory Iain Duff, AERE Harwell.
      void dgemv​(char trans, int m, int n, double alpha, double[][] A, int lda, double[] x, int incx, double beta, double[] y, int incy)
      Routine ported from 10/22/86 blas dgemv subroutine Original version written by: Jack Dongarra, Argonne National Lab.
      boolean dgennd​(int m, int n, double[][] A, int lda)
      This is a port of version 3.1 LAPACK test routine DGENND.
      private void dgeql2​(int m, int n, double[][] A, int lda, double[] tau, double[] work, int[] info)  
      void dgeqlf​(int m, int n, double[][] A, int lda, double[] tau, double[] work, int lwork, int[] info)  
      private void dgeqls​(int m, int n, int nrhs, double[][] A, int lda, double[] tau, double[][] B, int ldb, double[] work, int lwork, int[] info)  
      void dgeqr2​(int m, int n, double[][] A, int lda, double[] tau, double[] work, int[] info)
      This is a port of the version 3.2 LAPACK routine DGEQR2 Original DGEQR2 created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd.
      void dgeqrf​(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 DGEQRF Original DGEQRF created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dgeqrf computes a QR factorization of a real m by n matrix A: A = Q * R.
      void dgeqrs​(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 DGEQRS.
      void dger​(int m, int n, double alpha, double[] x, int incx, double[] y, int incy, double[][] A, int lda)
      This is a port of the 10/22/86 Blas routine DGER Original version written by: Jack Dongarra, Argonne National Lab.
      void dget02​(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 DGET02.
      private void dget51​(int itype, int n, double[][] A, int lda, double[][] B, int ldb, double[][] U, int ldu, double[][] V, int ldv, double[] work, double[] result)
      This is a port of version 3.1 LAPACK test routine DGET51 Original DGET51 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dget51 generally checks a decomposition of the form A = U B V' where ' means transpose and U and V are orthogonal.
      private void dget52​(boolean left, int n, double[][] A, int lda, double[][] B, int ldb, double[][] E, int lde, double[] alphar, double[] alphai, double[] beta, double[] work, double[] result)
      This is a port of version 3.1 LAPACK test routine DGET52 Original DGET52 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dget52 does an eigenvector check for the generalized eigenvalue problem.
      private void dggbak​(char job, char side, int n, int ilo, int ihi, double[] lscale, double[] rscale, int m, double[][] V, int ldv, int[] info)
      This is a port of version 3.1 LAPACK routine DGGBAK Original DGGBAK created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dggbak forms the right or left eigenvectors of a real generalized eigenvalue problem A*x = lambda*B*x, by backward transformation on the computed eigenvectors of the balanced pair of matrices output by dggbal.
      private void dggbal​(char job, int n, double[][] A, int lda, double[][] B, int ldb, int[] ilo, int[] ihi, double[] lscale, double[] rscale, double[] work, int[] info)
      This is a port of the version 3.1 LAPACK routine DGGBAL Original DGGBAL created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dggbal balances a pair of general real matrices (A,B).
      void dggev​(char jobvl, char jobvr, int n, double[][] A, int lda, double[][] B, int ldb, double[] alphar, double[] alphai, double[] beta, double[][] vl, int ldvl, double[][] vr, int ldvr, double[] work, int lwork, int[] info)
      This is a port of the version 3.1 LAPACK driver routine DGGEV Original DGGEV created by Univ. of Tennessee, Univ.
      void dggev_test()
      This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive ddrgev in order to test DGGEV, that handles the nonsymmetric generalized eigenvalue problem.
      private void dgghrd​(char compq, char compz, int n, int ilo, int ihi, double[][] A, int lda, double[][] B, int ldb, double[][] Q, int ldq, double[][] Z, int ldz, int[] info)
      This is a port of version 3.1 LAPACK routine DGGHRD Original DGGHRD created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dgghrd reduces a pair of real matrices (A,B) to generalized upper Hessenberg form using orthogonal transformations, where A is a general matrix and B is upper triangular.
      private void dhgeqz​(char job, char compq, char compz, int n, int ilo, int ihi, double[][] H, int ldh, double[][] T, int ldt, double[] alphar, double[] alphai, double[] beta, double[][] Q, int ldq, double[][] Z, int ldz, double[] work, int lwork, int[] info)
      This is a port of version 3.1 LAPACK routine DHGEQZ Original DHGEQZ created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dhgeqz computes the eigenvalues of a real matrix pair (H,T), where H is an upper Hessenberg matrix and T is upper triangular, using the double-shift QZ method.
      void dlabad​(double[] small, double[] large)
      This is a port of the version 3.2 LAPACK auxiliary routine DLABAD Original DLABAD created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlabad takes as input the values computed by dlamch for underflow and overflow, and returns the square root of each of these values if the log of large is sufficiently big.
      void dlacpy​(char uplo, int m, int n, double[][] A, int lda, double[][] B, int ldb)
      This is a port of LAPACK version 3.2 auxiliary routine DLACPY.
      void dladiv​(double a, double b, double c, double d, double[] p, double[] q)
      This is a port of version 3.7.0 LAPACK auxiliary routine DLADIV Original DLADIV created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., Januaary, 2013 dladiv performs complex division in real arithmetic p + i*q = (a + i*b) / (c + i*d) The algorithm is due to Michael Baudin and RObert L.
      private void dladiv1​(double a, double b, double c, double d, double[] p, double[] q)
      LAPACK auxiliary routine (version 3.7.0) LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd, January, 2013.
      private double dladiv2​(double a, double b, double c, double d, double r, double t)
      LAPACK auxiliary routine version 3.7.0 LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd, January, 2013.
      void dlae2​(double a, double b, double c, double[] rt1, double[] rt2)
      This is a port of the version 3.1 LAPACK auxiliary routine DLAE2 Original DLAE2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlae2 computes the eigenvalues of a 2-by-2 symmetric matrix [ A B ] [ B C ] On return, rt1[0] is the eigenvalue of the larger absolute value, and rt2[0] is the eigenvalue of the smaller absolute value.
      void dlaev2​(double a, double b, double c, double[] rt1, double[] rt2, double[] cs1, double[] sn1)
      This is a port of version 3.1 LAPACK auxiliary routine DLAEV2 Original DLAEV2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlaev2 computes the eigendecomposition of a 2-by-2 symmetric matrix [ a b ] [ b c ] On return rt1[0] is the eigenvalue of the larger absolute value, rt2[0] is the eigenvalue of the smaller absolute value, and (cs1, sn1) is the unit right eigenvector for rt1[0], giving the decomposition [ cs1 sn1 ] [ a b ] [cs1 -sn1] = [rt1 0 ] [-sn1 cs1 ] [ b c ] [sn1 cs1] [ 0 rt2]
      void dlafts​(java.lang.String type, int m, int n, int imat, int ntests, double[] result, int[] iseed, double thresh, int[] ie)
      This is a port of the version 3.1 LAPACK auxiliary test routine DLAFTS Original DLAFTS created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlafts tests the result vector against the threshold value to see which tests for this matrix type failed to pass the threshold.
      private void dlag2​(double[][] A, int lda, double[][] B, int ldb, double safmin, double[] scale1, double[] scale2, double[] wr1, double[] wr2, double[] wi)
      This is a port of the version 3.1 LAPACK auxiliary routine DLAG2 Original DLAG2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlag2 computes eigenvalues of a 2 x 2 generalized eigenvalue problem A - w B, with scaling as necessary to avoid over-/underflow.
      void dlagge​(int m, int n, int kl, int ku, double[] D, double[][] A, int lda, int[] iseed, double[] work, int[] info)
      This is a port of version 3.1 LAPACK auxiliary test routine DLAGGE Original DLAGGE created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlagge generates a real general m by n matrix A, by pre- and post- multiplying a real diagonal matrix D with random orthogonal matrices: A = U*D*V.
      void dlagsy​(int n, int k, double[] D, double[][] A, int lda, int[] iseed, double[] work, int[] info)
      This is a port of version 3.1 LAPACK auxiliary test routine dlagsy Original DLAGSY created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlagsy generates a real symmetric matrix A, by pre- and post- multiplying a real diagonal matrix D with a random orthogonal matrix: A = U*D*U'.
      private void dlahd2​(java.lang.String path)
      Port of some code contained in the version 2.0 LAPACK auxiliary test routine DLAHD2 Original DLAHD2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlahd2 prints header information for the different test paths
      private void dlaln2​(boolean ltrans, int na, int nw, double smin, double ca, double[][] A, int lda, double d1, double d2, double[][] B, int ldb, double wr, double wi, double[][] X, int ldx, double[] scale, double[] xnorm, int[] info)
      This is a port of version 3.1 LAPACK auxiliary routine DLALN2 Original DLALN2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlaln2 solves a system of the form (ca A - w D) X = s B or (ca A' - w D) X = s B with possible scaling ("s") and perturbation of A.
      private void dlamc1​(int[] beta, int[] t, boolean[] rnd, boolean[] ieee1)
      Port of version 3.2 LAPACK auxiliary routine DLAMC1 Original DLAMC1 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamc1 determines the machine parameters given by beta, t, rnd, and ieee1.
      private void dlamc2​(int[] beta, int[] t, boolean[] rnd, int[] emin, int[] emax)
      Port of LAPACK version 3.2 auxiliary routine DLAMC2 Original DLAMC2 created by Univ. of Tennessee, Univ. of California Berkeley, nad NAG Ltd., November, 2006 Determines machine parameters 3 globals are determined: 1.) eps double The smallest positive number such that computed value(1.0 - eps) < 1.0 2.) rmin double The smallest normalized number for the machine, given by base**(emin - 1), where base is the floating point value of beta. 3.)
      double dlamc3​(double a, double b)
      This is a port of the LAPACK version 3.2 auxiliary routine DLAMC3 Original DLAMC3 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamc3 is intended to force a and b to be stored prior to doing the addition of a and b, for use in situations where optimizers might hold one of these in a register
      private void dlamc4​(int[] emin, double start, int base)
      This is a port of version 3.2 LAPACK auxiliary routine DLAMC4 Original DLAMC4 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamc4 is a service routine for dlamc2
      private void dlamc5​(int beta, int p, int emin, boolean ieee, int[] emax, double[] rmax)
      This is a port of the version 3.2 LAPACK auxiliary routine DLAMC5 Original DLAMC5 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamc5 attempts to compute rmax, the largest machine floating-point number, without overflow.
      double dlamch​(char cmach)
      This is a port of the version 3.2 LAPACK auxiliary routine DLAMCH Original DLAMCH created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamch determines double precision machine parameters.
      double dlangb​(char norm, int n, int kl, int ku, double[][] ab, int ldab, double[] work)
      This is a port of version 3.2 LAPACK auxiliary routine DLANGB Original DLANGB created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlangb returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of an n by n band matrix A, with kl sub-diagonals and ku super-diagonals.
      double dlange​(char norm, int m, int n, double[][] A, int lda, double[] work)
      This is a port of the version 3.2 LAPACK auxiliary routine DLANGE Original DLANGE created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlange returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of the largest absolute value of a real matrix A.
      double dlanhs​(char norm, int n, double[][] A, int lda, double[] work)
      This is a port the the version 3.1 LAPACK auxiliary routine DLANHS Original DLANHS created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlanhs returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hessenberg matrix A.
      double dlansb​(char norm, char uplo, int n, int k, double[][] ab, int ldab, double[] work)
      This is a port of version 3.2 LAPACK auxiliary routine DLANSB Original DLANSB created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlansb retruns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of an n by n symmetric band matrix A, with k super-diagonals.
      double dlansp​(char norm, char uplo, int n, double[] ap, double[] work)
      This is a port of the version 3.2 LAPACK auxiliary routine DLANSP Original DLANSP created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlansp returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric matrix A, supplied in packed form.
      double dlanst​(char norm, int n, double[] d, double[] e)
      This is a port of version 3.1 LAPACK auxiliary routine DLANST Original DLANST created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlanst returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of the largest absolute value of a real symmetric tridiagonal matrix A
      double dlansy​(char norm, char uplo, int n, double[][] A, int lda, double[] work)
      This is a port of the version 3.2 LAPACK auxiliary routine DLANSY.
      double dlapy2​(double x, double y)
      This is a port of the version 3.2 LAPACK auxiliary routine DLAPY2 Original DLAPY2 created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlapy2 returns sqrt(x**2 + y**2), taking care not to cause unnecessary overflow.
      private double dlapy3​(double x, double y, double z)
      dlapy3 is a port of hte version 3.1 LAPLACK auxiliary routine DLAPY3 Original DLAPY3 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlapy3 returns sqrt(x**2+y**2+z**2), taking care not to cause unnecessary overflow.
      double dlaran​(int[] iseed)
      This is a port of version 3.1 LAPACK auxiliary routine DLARAN Original DLAAN created by Univ. of Tennessee, Univ.
      void dlarf​(char side, int m, int n, double[] v, int incv, double tau, double[][] C, int ldc, double[] work)
      This is a port of the version 3.2 LAPACK auxiliary routine DLARF Original DLARF created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarf applies a real elementary reflector H to a real m by n matrix C, from either the left or right.
      void dlarfb​(char side, char trans, char direct, char storev, int m, int n, int k, double[][] V, int ldv, double[][] T, int ldt, double[][] C, int ldc, double[][] work, int ldwork)
      This is a port of version 3.2 LAPACK auxiliary routine DLARFB Original DLARFB created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarfb applies a real block reflector H or its transpose H' to a real m by n matrix C, from either the left or the right.
      void dlarfg​(int n, double[] alpha, double[] x, int incx, double[] tau)
      This is a port of version 3.2 LAPACK auxiliary routine DLARFG Original DLARFG created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlarfg generates a real elementary reflector H of order n, such that H * (alpha) = (beta), H' * H = I. ( x ) ( 0 ) where alpha and beta are scalars, and x is an (n-1)-element real vector.
      void dlarfp​(int n, double[] alpha, double[] x, int incx, double[] tau)
      This is a port of version 3.2 LAPACK auxiliary routine DLARFP Original DLARFP created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarfp generates a real elementary reflector H of order n, such that H * (alpha) = (beta), H' * H = I. ( x ) ( 0 ) where alpha and beta are scalars, beta is non-negative, and x is an (n-1)-element real vector.
      void dlarft​(char direct, char storev, int n, int k, double[][] V, int ldv, double[] tau, double[][] T, int ldt)
      This is a port of the version 3.2 LAPACK auxiliary routine DLARFT Original DLARFT created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarft forms the triangular factor T of a real block reflector H of order n, which is defined as the product of k elementary reflectors.
      private void dlarfy​(char uplo, int n, double[] v, int incv, double tau, double[][] C, int ldc, double[] work)
      This is a port of version 3.1 LAPACK auxiliary test routine DLARFY Original DLARFY created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlarfy applies an elementary reflector, or Householder matrix, H, to an n by n symmetric matrix C, from both the left and the right.
      double dlarnd​(int idist, int[] iseed)
      This is a port of version 3.1 LAPACK auxiliary routine DLARND Original DLARND created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlarnd returns a random real number from a uniform or normal distribution.
      void dlarnv​(int idist, int[] iseed, int n, double[] x)
      This is a port of version 3.2 LAPACK auxiliary routine DLARNV Original DLARNV created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarnv returns a vector of n random real numbers from a uniform or normal distribution
      void dlarot​(boolean lrows, boolean lleft, boolean lright, int nl, double c, double s, double[] A, int lda, double[] xleft, double[] xright)
      This is a port of version 3.1 LAPACK auxiliary test routine DLAROT Original DLAROT created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlarot applies a (Givens) rotation to two adjacent rows or columns, where one element of the first and/or last column/row may be a separate variable.
      void dlartg​(double f, double g, double[] cs, double[] sn, double[] r)
      This is a port of version 3.2 LAPACK auxiliary routine DLARTG Original DLARTG created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlartg generates a plane rotation so that [ cs sn ] . [ f ] = [ r ] where cs*cs + sn*sn = 1. [ -sn cs ] [ g ] [ 0 ] If g = 0, then cs = 1 and sn = 0.
      void dlaruv​(int[] iseed, int n, double[] x)
      This is a port of version 3.2 LAPACK auxiliary routine DLARUV Original DLARUV created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlaruv returns a vector of n random real numbers from a uniform (0,1) distribution (n <= 128).
      void dlascl​(char type, int kL, int ku, double cfrom, double cto, int m, int n, double[][] A, int lda, int[] info)
      This is a port of the version 3.2 LAPACK auxiliary routine DLASCL Original DLASCL created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlascl multiplies the m by n real matrix A by the real scalar cto/cfrom.
      void dlaset​(char uplo, int m, int n, double alpha, double beta, double[][] A, int lda)
      This is a port of version 3.2 auxiliary routine DLASET.
      void dlasr​(char side, char pivot, char direct, int m, int n, double[] c, double[] s, double[][] A, int lda)
      This is a port of version 3.2 LAPACK auxiliary routine DLASR Original DLASR created by Univ. of Tennessee, Univ.
      void dlasrt​(char id, int n, double[] d, int[] info)
      This is a port of the version 3.2 LAPACK auxiliary routine DLASRT Original DLASRT created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlasrt sorts the numbers in d in increasing order if id == 'I' or in decreasing order if id == 'D'.
      void dlassq​(int n, double[] x, int incx, double[] scale, double[] sumsq)
      This is a port of version 3.2 LAPACK auxiliary routine DLASSQ Original DLASSQ created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlassq returns the values scl and smsq such that (scl**2)*smsq = x[0]**2 + x[incx]**2 + ... + x[(n-1)*incx]**2 + (scale**2)*sumsq The value of sumsq is assumed to be non-negative and scl returns the value scl = max(scale,abs(x[i])). scale and sumsq refer to the original supplied values in scale[] and sumsq[]. scl and smsq are the returned values in scale[] and sumsq[] that overwrite the orginal values.
      void dlasv2​(double f, double g, double h, double[] ssmin, double[] ssmax, double[] snr, double[] csr, double[] snl, double[] csl)
      This is a port of version 3.2 LAPACK auxiliary routine DLASV2 Original DLASV2 created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlasv2 computes the singular value decomposition of a 2-by-2 triangular matrix [ f g ] [ 0 h ].
      void dlatb4​(java.lang.String path, int imat, int m, int n, char[] type, int[] kl, int[] ku, double[] anorm, int[] mode, double[] cndnum, char[] dist)
      This is a port of version 3.4.0 LAPACK test routine DLATB4.
      void dlatm1​(int mode, double cond, int irsign, int idist, int[] iseed, double[] D, int n, int[] info)
      This is a port of version 3.1 LAPACK auxiliary test routine DLATM1 Original DLATM1 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatm1 computes the entries of D[0...n-1] as specified by mode, cond, and irsign. idist and iseed determine the generation of random numbers. dlatm1 is called by dlatmr to generate random test matrices for LAPACK programs.
      double dlatm2​(int m, int n, int i, int j, int kl, int ku, int idist, int[] iseed, double[] D, int igrade, double[] dl, double[] dr, int ipvtng, int[] iwork, double sparse)
      This is a port of version 3.1 LAPACK auxiliary test routine DLATM2 Original DLATM2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatm2 returns the (i,j) entry of a random matrix of dimension (m,n) described by the other parameters.
      double dlatm3​(int m, int n, int i, int j, int[] isub, int[] jsub, int kl, int ku, int idist, int[] iseed, double[] D, int igrade, double[] dl, double[] dr, int ipvtng, int[] iwork, double sparse)
      This is the port of the version 3.1 LAPACK auxiliary test routine DLATM3 Original DLATM3 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatm3 returns the (isub, jsub) entry of a random matrix of dimension (m,n) described by the other parameters.
      private void dlatm4​(int itype, int n, int nz1, int nz2, int isign, double amagn, double rcond, double triang, int idist, int[] iseed, double[][] A, int lda)
      This is a port of version 3.1 LAPACK auxiliary test routine DLATM4 Original DLATM4 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatm4 generates basic square matrices, which may later be multiplied by others in order to produce test matrices.
      void dlatmr​(int m, int n, char dist, int[] iseed, char sym, double[] D, int mode, double cond, double dmax, char rsign, char grade, double[] dl, int model, double condl, double[] dr, int moder, double condr, char pivtng, int[] ipivot, int kl, int ku, double sparse, double anorm, char pack, double[][] A, int lda, int[] iwork, int[] info)
      This is a port of version 3.1 LAPACK test routine DLATMR Original DLATMR created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatmr generates random matrices of various types for testing LAPACK programs. dlatmr operates by applying the following sequence of operations: 1.)
      void dlatms​(int m, int n, char dist, int[] iseed, char sym, double[] D, int mode, double cond, double dmax, int kl, int ku, char pack, double[][] A, int lda, double[] work, int[] info)
      This is a port of version 3.1 LAPACK test routine DLATMS Original DLATMS created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatms generates random matrices with specified singular values (or symmetric/hermitian with specified eigenvalues) for testing LAPACK programs.
      private void dlatrd​(char uplo, int n, int nb, double[][] A, int lda, double[] e, double[] tau, double[][] W, int ldw)
      This is a port of version 3.1 LAPACK auxiliary routine DLATRD Original DLATRD created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatrd reduces nb rows and columns of a real symmetric matrix A to symmetric tridiagonal form by an orthogonal similarity transformation Q'*A*Q, and returns the matrices V and W which are needed to apply the transformation to the unreduced part of A.
      double dnrm2​(int n, double[] x, int incx)
      This is a port of the 10/14/93 DNRM2 function Original code written by Sven Hammarling, Nag Ltd. dnrm2 returns the euclidean norm of a vector via the function sqrt(x'*x)
      private void dorg2l​(int m, int n, int k, double[][] A, int lda, double[] tau, double[] work, int[] info)
      This is a port of version 3.1 LAPACK routine DORG2L Original DORG2L created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dorg2l generates an m by n real matrix Q with orthonormal columns, which is defined as the last n columns of a product of k elementary reflectors of order m Q = H[k-1] ...
      void dorg2r​(int m, int n, int k, double[][] A, int lda, double[] tau, double[] work, int[] info)
      This is a port of version 3.2 LAPACK routine DORG2R Original DORG2R created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dorg2r generates an m by n real matrix Q with orthonormal columns, which is defined as the first n columns of a product of k elementary reflectors of order m Q = H[0] H[1] ...
      private void dorgql​(int m, int n, int k, double[][] A, int lda, double[] tau, double[] work, int lwork, int[] info)
      This is a port of the version 3.1 LAPACK routine DORGQL Original DORGQL created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dorgql generates the m-by-n real matrix Q with orthonormal columns, which is defined as the last n columns of a product of k elementary reflectors of order m Q = H[k-1] ...
      void dorgqr​(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 DORGQR Original DORGQR created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dorgqr generates an m-by-n real matrix Q with orthonormal columns, which is defined as the first n columns of a product of k elementary reflectors of order m Q = H[0] H[1] ...
      void dorgtr​(char uplo, int n, double[][] A, int lda, double[] tau, double[] work, int lwork, int[] info)
      This is a port of version 3.1 LAPACK routine DORGTR Original DORGTR created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dorgtr generates a real orthogonal matrix Q which is defined as the product of n-1 elementary reflectors of order N, as returned by dsytrd: If uplo = 'U', Q = H[n-2] ...
      void dorm2l​(char side, char trans, int m, int n, int k, double[][] A, int lda, double[] tau, double[][] C, int ldc, double[] work, int[] info)
      This is a port of the version 3.1 LAPACK routine DORM2L Original DORM2L created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dorm2l overwrites the general real m by n matrix C with Q * C if side == 'L' and trans == 'N', or Q' * C if side == 'L' and trans == 'T', or C * Q if side == 'R' and trans == 'N', or C * Q' if side == 'R' and trans == 'T' where Q is a real orthogonal matrix defined as a product of k elementary reflectors Q = H[k-1] ...
      void dorm2r​(char side, char trans, int m, int n, int k, double[][] A, int lda, double[] tau, double[][] C, int ldc, double[] work, int[] info)
      This is a port of the version 3.2 LAPACK routine DORM2R Original DORM2R created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dorm2r overwrites the general real m by n matrix C with Q * C if side = 'L' and trans = 'N', or Q'* C if side = 'L' and trans = 'T', or C * Q if side = 'R' and trans = 'N', or C * Q' if side = 'R' and trans = 'T', where Q is a real orthogonal matrix defined as the product of k elementary reflectors Q = H(0) H(1) . . .
      void dormqr​(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)
      This is a port of version 3.2 LAPACK routine DORMQR Original DORMQR created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dormqr overwrites the general real m by n matrix C with side = 'L' side = 'R' trans = 'N': Q * C C * Q trans = 'T': Q**T * C C * Q**T where Q is a real orthogonal matrix defined as the product of k elementary reflectors Q = H(0) H(1) . . .
      private void dpotf2​(char uplo, int n, double[][] A, int lda, int[] info)
      This is a port of the version 3.1 LAPACK routine DPOTF2 Original DPOTF2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dpotf2 computes the Cholesky factorization of a real symmetric positive definite matrix A.
      void dpotrf​(char uplo, int n, double[][] A, int lda, int[] info)
      This is a port of the DPOTRF version 3.1 LAPACK routine Original DPOTRF created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dpotrf computes the Cholesky factorization of a real symmetric positive definite matrix A
      private void dqlt01​(int m, int n, double[][] A, double[][] AF, double[][] Q, double[][] L, int lda, double[] tau, double[] work, int lwork, double[] rwork, double[] result)  
      private void dqlt02​(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)  
      private void dqlt03​(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)  
      private void dqrt01​(int m, int n, double[][] A, double[][] AF, double[][] Q, double[][] R, int lda, double[] tau, double[] work, int lwork, double[] rwork, double[] result)
      This is a port of version 3.1 LAPACK test routine DQRT01.
      private void dqrt02​(int m, int n, int k, double[][] A, double[][] AF, double[][] Q, double[][] R, int lda, double[] tau, double[] work, int lwork, double[] rwork, double[] result)
      This is a port of version 3.1 LAPACK test routine DQRT02.
      private void dqrt03​(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 DQRT03.
      void drot​(int n, double[] dx, int incx, double[] dy, int incy, double c, double s)
      This is a port of the 3/11/78 linpack routine drot Original code written by Jack Dongarra.
      void dscal​(int n, double da, double[] dx, int incx)
      Routine ported from 12/3/93 linpack dscal Original version written by Jack Dongarra Scales a vector by a constant.
      private void dsgt01​(int itype, char uplo, int n, int m, double[][] A, int lda, double[][] B, int ldb, double[][] Z, int ldz, double[] D, double[] work, double[] result)
      This is a port of the version 3.1 LAPACK test routine DSGT01 Original DSGT01 created by Univ. of Tennessee, Univ.
      private void dstech​(int n, double[] A, double[] B, double[] eig, double tol, double[] work, int[] info)
      This is a port of version 3.1 LAPACK test routine DSTECH Original DSTECH created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 Let T be the tridiagonal matrix with diagonal entries A[0] ,..., A[n-1] and offdiagonal entries B[0] ,..., B[n-2]). dstech checks to see if eig[0], ..., eig[n-1] are indeed accurate eigenvalues of T.
      private void dstect​(int n, double[] A, double[] B, double shift, int[] num)
      This is a port of version 3.1 LAPACK test routine DSTECT Original DSTECT created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dstect counts the number num of eigenvalues of a tridiagonal matrix T which are less than or equal to shift.
      void dsteqr​(char compz, int n, double[] d, double[] e, double[][] Z, int ldz, double[] work, int[] info)
      This is a port of version 3.1 LAPACK routine DSTEQR Original DSTEQR created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsteqr computes all eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal matrix using the implicit QL or QR method.
      void dsterf​(int n, double[] d, double[] e, int[] info)
      This is a port of version 3.1 LAPACK routine DSTERF Original DSTERF created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsterf computes all the eigenvalues of a symmetric tridiagonal matrix using the Pal-Walker-Kahan variant of the QL or QR algorithm.
      void dstt21​(int n, int kband, double[] AD, double[] AE, double[] SD, double[] SE, double[][] U, int ldu, double[] work, double[] result)
      This is a port of version 3.1 LAPACK test routine DSTT21 Original DSTT21 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dstt21 checks a decomposition of the form A = U S U' where ' means transpose, A is symmetric tridiagonal, U is orthogonal, and S is diagonal (if kband == 0) or symmetric tridagonal (if kband == 1).
      void dsyev​(char jobz, char uplo, int n, double[][] A, int lda, double[] w, double[] work, int lwork, int[] info)
      This is a port of the version 3.1 LAPACK DSYEV routine Original DSYEV created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsyev computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A.
      private void dsygs2​(int itype, char uplo, int n, double[][] A, int lda, double[][] B, int ldb, int[] info)
      This is a port of the LAPACK version 3.1 DSYGS2 routine Original DSYGS2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 DSYGS2 reduces a real symmetric-definite generalized eigenproblem to standard form.
      private void dsygst​(int itype, char uplo, int n, double[][] A, int lda, double[][] B, int ldb, int[] info)
      This routine is a port of the version 3.1 LAPACK routine DSYGST Original DSYGST created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsygst reduces a real symmetric-definite generalized eigenproblem to standard form.
      void dsygv​(int itype, char jobz, char uplo, int n, double[][] A, int lda, double[][] B, int ldb, double[] w, double[] work, int lwork, int[] info)
      DYSGV is ported from the version 3.1 LAPACK driver routine Original DSYGV created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 DSYGV computes all the eigenvalues, and optionally, the eigenvectors of a real generalized symmetric-definite eigenproblem, of the form A*x = (lambda)*B*x, A*Bx = (lambda)*x, or B*A*x = (lambda)*x.
      void dsygv_test()
      This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive ddrvsg in order to test DSYGV, that handles the symmetric generalized eigenvalue problem.
      void dsygv_test2()
      DOCUMENT ME!
      void dsygv_test3​(ViewUserInterface UI)
      DOCUMENT ME!
      void dsymm​(char side, char uplo, int m, int n, double alpha, double[][] A, int lda, double[][] B, int ldb, double beta, double[][] C, int ldc)
      This is a port of the 2/8/89 Blas routine DSYMM Original version written by: Jack Dongarra, Argonne National Lab.
      void dsymv​(char uplo, int n, double alpha, double[][] A, int lda, double[] x, int incx, double beta, double[] y, int incy)
      This is a port of the 10/22/86 Blas routine DSYMV Original code written by: Jack Dongarra, Argonne Nationa Lab.
      void dsyr​(char uplo, int n, double alpha, double[] x, int incx, double[][] A, int lda)
      This is a port of level 2 Blas routine DSYR Original routine written on 22-October-1986 by Jack Dongarra, Argonne National Lab.
      void dsyr2​(char uplo, int n, double alpha, double[] x, int incx, double[] y, int incy, double[][] A, int lda)
      Port of 10/22/86 Blas DSYR2 routine Original version written by: Jack Dongarra, Argonne National Lab.
      private void dsyr2k​(char uplo, char trans, int n, int k, double alpha, double[][] A, int lda, double[][] B, int ldb, double beta, double[][] C, int ldc)
      This is a port of the 2/8/89 Blas routine DSYR2K Original version written by: Jack Dongarra, Argonne National Lab.
      void dsyrk​(char uplo, char trans, int n, int k, double alpha, double[][] A, int lda, double beta, double[][] C, int ldc)
      dsyrk is the port of the 2/8/89 blas DSYRK routine.
      void dsyt21​(int itype, char uplo, int n, int kband, double[][] A, int lda, double[] D, double[] E, double[][] U, int ldu, double[][] V, int ldv, double[] tau, double[] work, double[] result)
      This is a port of version 3.1 LAPACK test routine DSYT21 Original DSYT21 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsyt21 generally checks a decomposition of the form A = U S U' where ' means transpose, A is symmetric, U is orthogonal, and S is diagonal (if kband == 0) or symmetric tridiagonal (if kband == 1).
      private void dsytd2​(char uplo, int n, double[][] A, int lda, double[] d, double[] e, double[] tau, int[] info)
      This is a port of the version 3.1 LAPACK routine DSYTD2 Original DSYTD2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsytd2 reduces a real symmetric matrix A to symmetric tridiagonal form T by an orthogonal similarity transformation: Q' * A * Q = T.
      void dsytrd​(char uplo, int n, double[][] A, int lda, double[] d, double[] e, double[] tau, double[] work, int lwork, int[] info)
      This is a port of the version 3.1 LAPACK routine DSYTRD Original DSYTRD created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsytrd reduces a real symmetric matrix A to a real symmetric tridiagonal form T by an orthogonal similarity transformation.
      private void dtgevc​(char side, char howmny, boolean[] select, int n, double[][] S, int lds, double[][] P, int ldp, double[][] vl, int ldvl, double[][] vr, int ldvr, int mm, int[] m, double[] work, int[] info)
      This is a port of version 3.1 LAPACK routine DTGEVC Original DTGEVC created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dtgevc computes some or all of the right and/or left eigenvectors of a pair of real eigenvectors of a pair of real matrices (S,P), where S is a quasi-triangular matrix and P is upper triangular.
      void dtrmm​(char side, char uplo, char transa, char diag, int m, int n, double alpha, double[][] A, int lda, double[][] B, int ldb)
      This is a port of the 2/8/89 Blas routine DTRMM Original code written by: Jack Dongarra, Argonne National Laboratory Iain Duff, AERE Harwell.
      void dtrmv​(char uplo, char trans, char diag, int n, double[][] A, int lda, double[] x, int incx)
      This is a port of the 10/22/86 blas routine DTRMV Original version written by: Jack Dongarra, Argonne National Lab.
      void dtrsm​(char side, char uplo, char transa, char diag, int m, int n, double alpha, double[][] A, int lda, double[][] B, int ldb)
      This is a port of the 2/8/89 Blas routine DTRSM Original code written by: Jack Dongarra, Argonne National Laboratory Iain Duff, AERE Harwell.
      void dtrsv​(char uplo, char trans, char diag, int n, double[][] A, int lda, double[] x, int incx)
      This is a port of the 10/22/86 Blas routine DTRSV Original version written by: Jack Dongarra, Argonne National Lab.
      double getSafmin()  
      private int ieeeck​(int ispec, double zero, double one)
      Version 3.2 auxiliary routine ported form LAPACK Original IEEECK created by Univ. of Tennessee, Univ. of California Berkeley, University of Colorado Denver, and NAG Ltd., November, 2006 ieeeck is called form the ilaenv routine to verify that infinity and possibly NaN arithmetic is safe (i.e. will not trap)
      private int iladlc​(int m, int n, double[][] A, int lda)
      This is a port of LAPACK auxiliary routine (version 3.2.1) ILADLC, April 2009 Original ILADLC created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd.
      private int iladlr​(int m, int n, double[][] A, int lda)
      This is a port of LAPACK auxiliary routine (version 3.2.1) ILADLR, April 2009 Original ILADLR created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd.
      int ilaenv​(int ispec, java.lang.String name, java.lang.String opts, int n1, int n2, int n3, int n4)
      ilaenv is ported from the version 3.2.1 LAPACK auxiliary routine Original ILAENV created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd., April, 2009
      void setSafmin​(double safmin)  
      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

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • base

        private double base
        DOCUMENT ME!
      • emax

        private double emax
        DOCUMENT ME!
      • emin

        private double emin
        DOCUMENT ME!
      • eps

        private double eps
        DOCUMENT ME!
      • first

        private boolean first
        ------------------------ Class variables ------------------------ Double precision machine parameters found in routine dlamch.
      • first_dlartg

        private boolean first_dlartg
        Double precison machine variables found in routine dlartg.
      • first_dlatb4

        private boolean first_dlatb4
        Found in routine dlatb4
      • eps_dlatb4

        private double eps_dlatb4
      • small_dlatb4

        private final double[] small_dlatb4
      • large_dlatb4

        private final double[] large_dlatb4
      • badc1_dlatb4

        private double badc1_dlatb4
      • badc2_dlatb4

        private double badc2_dlatb4
      • iparms

        private int[] iparms
        DOCUMENT ME!
      • prec

        private double prec
        DOCUMENT ME!
      • rmax

        private double rmax
        DOCUMENT ME!
      • rmin

        private double rmin
        DOCUMENT ME!
      • rnd

        private double rnd
        DOCUMENT ME!
      • safmin

        private double safmin
        DOCUMENT ME!
      • safmn2

        private double safmn2
        DOCUMENT ME!
      • safmx2

        private double safmx2
        DOCUMENT ME!
      • sfmin

        private double sfmin
        DOCUMENT ME!
      • t

        private double t
        DOCUMENT ME!
    • Constructor Detail

      • GeneralizedEigenvalue

        public GeneralizedEigenvalue()
        Creates a new GeneralizedEigenvalue object.
    • Method Detail

      • setSafmin

        public void setSafmin​(double safmin)
      • getSafmin

        public double getSafmin()
      • dchkgg_test

        public void dchkgg_test()
        This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive dchkgg in order to run dchkgg to test the nonsymmetric generalized eigenvalue problem. Tests dgghrd, dhgeqz, and dtgevc. Numerical values were obtained from the dgg.in datafile. Original DCHKEE created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., January, 2007
      • dchkgk

        public void dchkgk()
        This is a port of version 3.1 LAPACK test routine DCHKGK Original DCHKGK created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 Sample data values obtained from the file dgbak.in dchkgk tests dggbak, a routine for backward balancing of a matrix pair (A, B).
      • dchkgl

        public void dchkgl()
        This is a port of version 3.1 LAPACK test routine DCHKGL Original DCHKGL created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 Sample data values obtained from the file dgbal.in

        dchkgl tests dggbal, a routine for balancing a matrix pair (A, B)

      • dchkql_test

        public void dchkql_test()
        This dchkql_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.
      • dchkql

        public void dchkql​(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)
      • dqlt01

        private void dqlt01​(int m,
                            int n,
                            double[][] A,
                            double[][] AF,
                            double[][] Q,
                            double[][] L,
                            int lda,
                            double[] tau,
                            double[] work,
                            int lwork,
                            double[] rwork,
                            double[] result)
      • dqlt02

        private void dqlt02​(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)
      • dqlt03

        private void dqlt03​(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)
      • dgeqls

        private void dgeqls​(int m,
                            int n,
                            int nrhs,
                            double[][] A,
                            int lda,
                            double[] tau,
                            double[][] B,
                            int ldb,
                            double[] work,
                            int lwork,
                            int[] info)
      • dchkqr

        private void dchkqr​(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[][] AR,
                            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 DCHKQR 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( * ), AQ( * ), AR( * ), $ B( * ), RWORK( * ), TAU( * ), WORK( * ), $ X( * ), XACT( * ) .. Purpose ======= DCHKQR tests DGEQRF, DORGQR and DORMQR. Arguments ========= DOTYPE (input) LOGICAL array, dimension (NTYPES) The matrix types to be used for testing. Matrices of type j (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. 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. 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. NRHS (input) INTEGER The number of right hand side vectors to be generated for each linear system. 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. 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] AR (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)
      • dchkqr_test

        public void dchkqr_test()
        This dchkqr_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.
      • dchkst_test

        public void dchkst_test()
        This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive dchkst, that tests routines used in symmetric generalized eigenvalue problem. The routines tested are dsytrd, dorgtr, dsteqr, and dsterf. Numerical values were obtained from the sep.in datafile. Original DCHKEE created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., January, 2007
      • ddrvst_test

        public void ddrvst_test()
        This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive ddrvst, that tests symmetric generalized eigenvalue drivers. The driver tested is dsyev. Numerical values were obtained from the sep.in datafile. Original DCHKEE created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., January, 2007
      • derrqr

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

        public void dgeqrs​(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 DGEQRS. 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 ======= Solve the least squares problem min || A*X - B || using the QR factorization A = Q*R computed by DGEQRF. 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. M >= N >= 0. NRHS (input) INTEGER The number of columns of B. NRHS >= 0. A (input) DOUBLE PRECISION array, dimension (LDA,N) Details of the QR factorization of the original matrix A as returned by DGEQRF. LDA (input) INTEGER The leading dimension of the array A. LDA >= M. TAU (input) DOUBLE PRECISION array, dimension (N) 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 >= M. 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 < 0: if INFO = -i, the i-th argument had an illegal value
      • dget02

        public void dget02​(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 DGET02. 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 ======= DGET02 computes the residual for a solution of a system of linear equations A*x = b or A'*x = b: RESID = norm(B - A*X) / ( 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) / ( norm(A) * norm(X) * EPS ).
      • dggev

        public void dggev​(char jobvl,
                          char jobvr,
                          int n,
                          double[][] A,
                          int lda,
                          double[][] B,
                          int ldb,
                          double[] alphar,
                          double[] alphai,
                          double[] beta,
                          double[][] vl,
                          int ldvl,
                          double[][] vr,
                          int ldvr,
                          double[] work,
                          int lwork,
                          int[] info)
        This is a port of the version 3.1 LAPACK driver routine DGGEV Original DGGEV created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dggev computes for a pair of n by n real nonsymmetric matrices (A,B) the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.

        A generalized eigenvalue for a pair of matrices (A,B) is a scalar lambda or a ratio alpha/beta = lambda, such that A - lambda*B is singular. It is usually represented as the pair (alpha, beta), as there is a reasonable interpretation for beta = 0, and even for both being zero.

        The right eigenvector v[j] corresponding to the eigenvalue lambda[j] of (A,B) satisfies A * v[j] = lambda[j] * B * v[j] The left eigenvector u[j] corresponding to the eigenvalue lambda[j] of (A,B) satisfies u[j]**H * A = lambda[j] * u[j]**H * B where u[j]**H is the conjugate-transpose of u[j].

        Parameters:
        jobvl - input char = 'N': do not compute the left generalized eigenvectors = 'V': compute the left generalized eigenvectors
        jobvr - input char = 'N': do not compute the right generalized eigenvectors = 'V': compute the right generalized eigenvectors
        n - input int The order of the matrices A, B, vl, and vr. n >= 0.
        A - input/output double[][] of dimension (lda,n) On entry, the matrix A in the pair (A,B). On exit, A has been overwritten.
        lda - input int The leading dimension of A. lda >= max(1,n).
        B - input/output double[][] of dimension (ldb,n). On entry, the matrix B in the pair (A,B). On exit, B has been overwritten.
        ldb - input int The leading dimension of B. ldb >= max(1,n).
        alphar - output double[] of dimension n
        alphai - output double[] of dimension n
        beta - output double[] of dimension n On exit, (alphar[j] + alphai[j]*i)/beta[j], j = 0,...,n-1 will be the generalized eigenvalues. If alphai[j] is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with alphai[j+1] negative.

        Note: the quotients alphar[j]/beta[j] and alphai[j]/beta[j] may easily over- or underflow, and beta[j] may even be zero. Thus, the user should avoid naively computing the ratio alpha/beta. However, alphar and alphai will be always less than and usually comparable with norm(A) in magnitude, and beta always less than and usually comparable with norm(B).

        vl - output double[][] of dimension (ldvl,n) If jobvl = 'V', the left eigenvectors u[j] are stored one after another in the columns of vl, in the same order as their eigenvalues. If the j-th eigenvalue is real, then u[j] = vl(:,j), the j-th column of vl. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then u[j] = vl(:,j) + i*vl(:,j+1) and u[j+1] = vl(:,j) - i*vl(:,j+1). Each eigenvector will be scaled so the largest component have abs(real part) + abs(imag part) = 1. Not referenced if jobvl = 'N'.
        ldvl - input int The leading dimension of matrix vl. ldvl >= 1, and if jobvl = 'V', ldvl >= n.
        vr - output double[][] of dimension (ldvr,n) If jobvr = 'V', the right eigenvectors v[j] are stored one after another in the columns of vr, in the same order as their eigenvalues. If the j-th eigenvalue is real, then v[j] = vr(:,j), the j-th column of vr. If the j-th and (j+1)-th eigenvalues form a complex pair, then v[j] = vr(:,j) + i*vr(:,j+1) and v[j+1] = vr(:,j) - i*vr(:,j+1). Each eigenvector will be scaled so the largest component have abs(real part) + abs(imag part) = 1. Not referenced if jobvr = 'N'.
        ldvr - input int The leading dimension of matrix vr. ldvr >= 1, and if jobvr = 'V', ldvr >= n.
        work - (workspace/output) double[] of dimension max(1,lwork) On exit, if info[0] = 0, work[0] returns the optimal lwork.
        lwork - input int The dimension of the array work. lwork >= max(1,8*n). For good performance, lwork must generally be larger. 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.
        info - output int[] = 0: successful exit < 0: if info[0] = -i, the i-th argument had an illegal value = 1,...,n: The QZ iteration failed. No eigenvectors have been calculated, but alphar[j] , alphai[j], and beta[j] should be correct for j = info[0],...,n-1. > n: = n+1: other than QZ iteration failed in DHGEQZ. = n+2: error return from dtgevc.
      • dggev_test

        public void dggev_test()
        This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive ddrgev in order to test DGGEV, that handles the nonsymmetric generalized eigenvalue problem. Numerical values were obtained from the dgv section in the dgd.in datafile. Original DCHKEE created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., January, 2007
      • dsyev

        public void dsyev​(char jobz,
                          char uplo,
                          int n,
                          double[][] A,
                          int lda,
                          double[] w,
                          double[] work,
                          int lwork,
                          int[] info)
        This is a port of the version 3.1 LAPACK DSYEV routine Original DSYEV created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsyev computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A.
        Parameters:
        jobz - input char = 'N': Compute eigenvalues only = 'V': Compute eigenvalues and eigenvectors.
        uplo - input char = 'U': Upper triangle of A is stored = 'L': Lower triangle of A is stored
        n - input int The order of the matrix A. n >= 0.
        A - input/output double[][] of dimension lda by n On entry, the symmetric matrix A. If uplo = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A. If uplo = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of matrix A. On exit, if jobz = 'V', then if info = 0, A contains the orthonormal eigenvectors of the matrix A. If jobz = 'N', then on exit the lower triangle (if uplo = 'L') or the upper triangle (if uplo = 'U') of A, including the diagonal, is destroyed.
        lda - input int The leading dimension of array A. lda >= max(1,n).
        w - output double[] of dimension n. If info = 0, the eigenvalues are in ascending order.
        work - (workspace/output) double[] of dimension max(1,lwork). On exit, if info[0] = 0, then work[0] returns the optimal lwork.
        lwork - input int The length of the array work. lwork >= max(1,3*n-1). For optimal efficiency , lwork >= (nb+2)*n, where nb is the blocksize for dsytrd returned by ilaenv.

        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.

        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value. > 0: If info[0] = i, the algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
      • dsygv

        public void dsygv​(int itype,
                          char jobz,
                          char uplo,
                          int n,
                          double[][] A,
                          int lda,
                          double[][] B,
                          int ldb,
                          double[] w,
                          double[] work,
                          int lwork,
                          int[] info)
        DYSGV is ported from the version 3.1 LAPACK driver routine Original DSYGV created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 DSYGV computes all the eigenvalues, and optionally, the eigenvectors of a real generalized symmetric-definite eigenproblem, of the form A*x = (lambda)*B*x, A*Bx = (lambda)*x, or B*A*x = (lambda)*x. Here A and B are assumed to be symmetric and B is also positive definite
        Parameters:
        itype - input integer specifies the problem type to be solved: = 1: A*x = (lambda)*B*x = 2: A*B*x = (lambda)*x ' = 3: B*A*x = (lambda)*x
        jobz - input char = 'N': Compute eigenvalues only = 'V': Compute eigenvalues and eigenvectors
        uplo - input char = 'U': Upper triangles of A and B are stored = 'L': Lower triangles of A and B are stored
        n - input integer The order of matrices A and B. n >= 0.
        A - (input/output) double[][], dimension lda by n On entry, the symmetric matrix A. If uplo = 'U', the leading n by n upper triangular part of A contains the upper triangular part of the matrix A. If uplo = 'L', the leading n by n lower triangular part of A contains the lower triangular part of the matrix A.

        On exit, if jobz = 'V', then if info[0] = 0, A contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows: If itype = 1 or 2, Z**T*B*Z = I; If itype = 3, Z**T*inv(B)*Z = I. If jobz = 'N', then on exit the upper triangle (if uplo = 'U') or the lower triangle (if uplo = 'L') of A, including the diagonal, is destroyed.

        lda - input integer The leading dimension of array A. lda >= max(1,n).
        B - (input/output) double[][], dimension ldb by n On entry, the symmetric positive definite matrix B. If uplo = 'U', the leading n by n upper triangular part of B contains the upper triangular part of the matrix B. If uplo = 'L', the leading n by n lower triangular part of B contains the lower triangular part of the matrix B.

        On exit, if info <= n, the part of B containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = U**T*U or B = L*L**T.

        ldb - input integer The leading dimension of the array B. ldb >= max(1,n).
        w - output double[] of dimension n If info = 0, the eigenvalues in ascending order.
        work - (workspace/output) double[] of dimension max(1,lwork) On exit, if info = 0, work[0] returns the optimal lwork.
        lwork - input integer The length of the array work. lwork >= max(1,3*n-1). For optimal efficiency, lwork >= (nb+2)*n, where nb is the blocksize for dsytrd returned by ilaenv.

        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.

        info - output integer[] = 0: successful exit < 0: if info = -i, the i-th argument had an illegal value > 0: dpotrf or dsyev returned an error code: <= n: If info = i, dsyev failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero; > n: If info = n + i, for 1 <= i <= n, then the leading minor of order i of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed.
      • dsygv_test

        public void dsygv_test()
        This routine is an extraction from the FORTRAN program version 3.1.1 DCHKEE of the code needed to drive ddrvsg in order to test DSYGV, that handles the symmetric generalized eigenvalue problem. Numerical values were obtained from the dsg.in datafile. Original DCHKEE created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., January, 2007
      • dsygv_test2

        public void dsygv_test2()
        DOCUMENT ME!
      • dsygv_test3

        public void dsygv_test3​(ViewUserInterface UI)
        DOCUMENT ME!
        Parameters:
        UI - DOCUMENT ME!
      • daxpy

        public void daxpy​(int n,
                          double da,
                          double[] dx,
                          int incx,
                          double[] dy,
                          int incy)
        Port of 12/3/93 linpack routine daxpy Original version written by Jack Dongarra vector dy = vector dy + da * vector dx.
        Parameters:
        n - input int
        da - inut double
        dx - input double[]
        incx - input int
        dy - input/output double[]
        incy - input int
      • dchkgg

        private void dchkgg​(int nsizes,
                            int[] nn,
                            int ntypes,
                            boolean[] dotype,
                            int[] iseed,
                            double thresh,
                            boolean tstdif,
                            double thrshn,
                            double[][] A,
                            int lda,
                            double[][] B,
                            double[][] H,
                            double[][] T,
                            double[][] S1,
                            double[][] S2,
                            double[][] P1,
                            double[][] P2,
                            double[][] U,
                            int ldu,
                            double[][] V,
                            double[][] Q,
                            double[][] Z,
                            double[] alphr1,
                            double[] alphi1,
                            double[] beta1,
                            double[] alphr3,
                            double[] alphi3,
                            double[] beta3,
                            double[][] evectl,
                            double[][] evectr,
                            double[] work,
                            int lwork,
                            boolean[] llwork,
                            double[] result,
                            int[] info)
        This is a port of version 3.1 LAPACK test routine DCHKGG Original DCHKGG created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dchkgg checks the nonsymmetric generalized eigenvalue problem routines.

        dgghrd factors A and B as U H Vtranspose and U T Vtranspose, where H is hessenberg, T is triangular, and U and V are orthogonal.

        dhgeqz factors H and T as Q S Ztranspose and Q P Ztranspose, where P is upper triangular, S is in generalized Schur form (block upper triangular, with 1x1 and 2x2 blocks on the diagonal, the 2x2 blocks corresponding to complex conjugate pairs of generalized eigenvalues), and Q and Z are orthogonal. It also computes the generalized eigenvalues (alpha[0], beta[0]),...,(alpha[n-1], beta[n-1]), where alpha[j] = S[j][j] and beta[j] = P[j][j] -- thus, w[j] = alpha[j]/beta[j] is a root of the generalized eigenvalue problem det(A - w[j] B ) = 0 and m[j] = beta[j]/alpha[j] is a root of the essentially equivalent problem det(m[j] A - B ) = 0

        dtgevc computes the matrix L of left eigenvectors and the matrix R of right eigenvectors for the matrix pair (S, P). In the description below, L and R are left and right eigenvectors corresponding to the generalized eigenvalues (alpha, beta).

        When dchkgg is called, a number of matrix "sizes" ("n's") and a number of matrix "types" are specified. For each size ("n") and each type of matrix, one matrix will be generated and used to test the nonsymmetric eigenroutines. For each matrix, 15 tests will be performed. The first twelve "test ratios" should be small -- O(1). They will be compared with the threshold thresh: (1) | A - U H Vtrans| / ( |A| n ulp) (2) | B - U T Vtrans| / ( |B| n ulp) (3) | I - UUtrans| / (n ulp) (4) | I - VVtrans| / (n ulp) (5) | H - Q S Ztrans| / ( |H| n ulp) (6) | T - Q P Ztrans| / ( |T| n ulp) (7) | I - QQtrans| / (n ulp) (8) | I - ZZtrans| / (n ulp) (9) max over all left eigenvalue/-vector pairs (beta/alpha, L) of | L**H * (beta S - alpha P) | / (ulp max( |beta S|, |alpha P| )) (10) max over all left eigenvalue/-vector pairs (beta/alpha, L') of | L'**H * (beta H - alphatranspose T) | / (ulp max( |beta H|, |alpha T| )) where the eigenvectors L' are the result of passing Q to dtgevc and back transforming (howmny = 'B'). (11) max over all right eigenvalue/-vector pairs (beta/alpha, R) of | (beta S - alpha T) R | / (ulp max( |beta S|, |alpha T| )) (12) max over all right eigenvalue/-vector pairs (beta/alpha, R') of | (beta H - alpha T) R' | / ( ulp max( |beta H|, |alpha T| )) where the eigenvectors R' are the result of passing Z to dtgevc and back transforming (howmny = 'B'). The last three test ratios will usually be small, but there is no mathematical requirement that they be so. They are therefore compared with thresh only if tstdif is true. (13) | S(Q,Z computed) - S(Q,Z not computed) | / ( |S| ulp ) (14) | P(Q,Z computed) - P(Q,Z not computed) | / ( |P| ulp ) (15) max( |alpha(Q,Z computed) - alpha(Q,Z not computed)|/|S|, |beta(Q,Z computed) - beta(Q,Z not computed)|/|P| ) / ulp In addition, the normalization of L and R are checked, and compared with the threshold thrshn.

        Test Matrices The sizes of the test matrices are specified by an array nn[0:sizes-1]; the value of each element nn[j] specifies one size. The "types" are specified by a boolean array dotype(0:ntypes-1); if dotype[j] is true, then a matrix type "j" will be generated. Currently, the list of possible types is: (1) (0, 0) (a pair of zero matrices) (2) (I, 0) (an identity and a zero matrix) (3) (0, I) (a zero and an identity matrix) (4) (I, I) (a pair of identity matrices) (5) (Jtranspose, Jtranspose) (a pair of transposed Jordan blocks) (6) (X, Y) where X = (Jtranspose 0) and Y = (I 0 ) (0 I) (0 Jtranspose) and I is a k by k identity and J a (k+1) by (k+1) Jordan block; k = (N-1)/2 (7) (D, I) where D is diag(0, 1,..., N-1) (a diagonal matrix with those diagonal entries.) (8) (I, D) (9) (big*D, small*I) where "big" is near overflow and small = 1/big (10) (small*D, big*I) (11) (big*I, small*D) (12) (small*I, big*D) (13) (big*D, big*I) (14) (small*D, small*I) (15) (D1, D2) where D1 is diag(0, 0, 1, ..., N-3, 0) and D2 is diag(0, N-3, N-4,..., 1, 0, 0) (16) U (Jtranspose, Jtranspose) V where U and V are random orthogonal matrices. (17) U (T1, T2) V where T1 and T2 are upper triangular matrices with random O(1) entries above the diagonal and diagonal entries diag(T1) = (0, 0, 1, ..., N-3, 0) and diag(T2) = (0, N-3, N-4, ..., 1, 0, 0) (18) U (T1, T2) V diag(T1) = (0, 0, 1, 1, s, ..., s, 0) diag(T2) = (0, 1, 0, 1, ..., 1, 0) s = machine precision (19) U (T1, T2) V diag(T1) = (0,0,1,1, 1-d, ..., 1 - (N-5)*d=s, 0) diag(T2) = (0, 1, 0, 1, ..., 1, 0) (20) U (T1, T2) V diag(T1) = (0,0,1,1,a, ..., a**(N-5)=s, 0) diag(T2) = (0, 1, 0, 1, ..., 1, 0, 0) (21) U (T1, T2) V diag(T1) = (0, 0, 1, r1, r2, ..., r(N-4), 0) diag(T2) = (0, 1, 0, 1, ..., 1, 0, 0) where r1, ..., r(N-4) are random. (22) U (big*T1, small*T2) V diag(T1) = (0, 0, 1, ..., N-3, 0) diag(T2) = (0, 1, ..., 1, 0, 0) (23) U (small*T1, big*T2) V diag(T1) = (0, 0, 1, ..., N-3, 0) diag(T2) = (0, 1, ..., 1, 0, 0) (24) U (small*T1, small*T2) V diag(T1) = (0, 0, 1, ..., N-3, 0) diag(T2) = (0, 1, ..., 1, 0, 0) (25) U (big*T1, big*T2) V diag(T1) = (0, 0, 1, ..., N-3, 0) diag(T2) = (0, 1, ..., 1, 0, 0) (26) U(T1, T2) V where T1 and T2 are random upper-triangular matrices.

        Parameters:
        nsizes - input int The number of sizes of matrices to use. If it is zero, dchkgg does nothing. It must be at least zero.
        nn - input int[] of dimension (nsizes) An array containing the sizes to be used for matrices. Zero values will be skipped. The values must be at least zero.
        ntypes - input int The number of elements in dotype. If it is zero, dchkgg does nothing. It must be at least zero. If it is maxtyp+1 and nsizes is 1, then an additional type, maxtyp+1 is defined, which is to use whatever matrix is in A. This is only useful if dotype(0:maxtyp-1) is false and dotype[maxtyp] is true.
        dotype - input boolean[] of dimension (ntypes) If dotype[j] is true, then for each size in nn a matrix of that size and of type j will be generated. If ntypes is smaller than the maximum number of types defined(parameter maxtyp), then types ntypes+1 through maxtyp will not be generated. If ntypes is larger than maxtyp, dotype[maxtyp] through dotype[ntypes-1] will be ignored.
        iseed - (input/ouptut) int[] of 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[3] 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 dchkgg to continue the same random number sequence.
        thresh - input double A test will count as "failed" if the "error", computed as described above, exceeds thresh. Note that the error is scaled to be O(1), so thresh should be a reasonably small multiple of 1, e.g., 10 or 100. In particular, it should not depend on the precision (single vs. double) or the size of the matrix. It must be at least zero.
        tstdif - input boolean Specifies whether the ratios 13-15 will be computed and compared with thresh. = false: Only test ratios 1-12 will be computed and tested. Ratios 13-15 will be set to zero. = true: All the test ratios 1-15 will be computed and tested.
        thrshn - input double Threshold for reporting eigenvector normalization error. If the normalization of any eigenvector differs from one by nore than thrshn*ulp, then a special error message will be printed. (This is handled separately from the other tests, since only a compiler or programming error should cause an error message, at least if thrshn is at least 5--10.)
        A - (input/workspace) double[][] of dimension (lda, max(nn)) Used to hold the original A matrix. Used as input only if ntypes = maxtyp+1, dotype[0:maxtyp-1] = false, and dotype[maxtyp] = true.
        lda - input int The leaeding dimension of A, B, H, T, S1, P1, S2, and P2. It must be at least 1 and at least max(nn).
        B - (input/workspace) double[][] of dimension (lda, max(nn)) Used to hold the original B matrix. Used as input only if ntypes= maxtyp+1, dotype[0:maxtyp-1] = false, and dotype[maxtyp] = true.
        H - (workspace) double[][] of dimension (lda, max(nn)) The upper Hessenberg matrix computed from A by dgghrd.
        T - (workspace) double[][] of dimension (lda, max(nn)) The upper triangular matrix computed from B by dgghrd.
        S1 - (workspace) double[][] of dimension (lda, max(nn)) The Schur (block upper triangular) matrix computed from H by dhgeqz when Q and Z are also computed.
        S2 - (workspace) double[][] of dimension (lda, max(nn)) The Schur (block upper triangular) matrix computed from H by dhgeqz when Q and Z are not computed.
        P1 - (workspace) double[][] of dimension (lda, max(nn)) The upper triangular matrix computed from T by dhgeqz when Q and Z are also computed.
        P2 - (workspace) double[][] of dimension (lda, max(nn)) The upper triangular matrix computed from T by dhgeqz when Q and Z are not computed.
        U - (workspace) double[][] of dimension (ldu, max(nn)) The (left) orthogonal matrix computed by dgghrd.
        ldu - input int The leading dimension of U, V, Q, Z, evectl, and evectr. It must be at least 1 and at least max(nn).
        V - (workspace) double[][] of dimension (ldu, max(nn)) The (right) orthogonal matrix computed by dgghrd.
        Q - (workspace) double[][] of dimesnion (ldu, max(nn)) The (left) orthogonal matrix computed by dhgeqz.
        Z - (workspace) double[][] of dimension (ldu, max(nn)) The (left) orthogonal matrix computed by dhgeqz.
        alphr1 - (workspace) double[] of dimension (max(nn))
        alphi1 - (workspace) double[] of dimension (max(nn))
        beta1 - (workspace) double[] of dimension (max(nn)) The generalized eigenvalues of (A,B) computed by dhgeqz when Q, Z, and the full Schur matrices are computed. On exit, (alphr1[k] + alphi1[k]*i) /beta1[k] is the (k+1)-st generalized eigenvalue of the matrices in A and B.
        alphr3 - (workspace) double[] of dimension (max(nn))
        alphi3 - (workspace) double[] of dimension (max(nn))
        beta3 - (workspace) double[] of dimension (max(nn))
        evectl - (workspace) double[][] of dimension (ldu, max(nn)) The (block lower triangular) left eigenvector matrix for the matrices in S1 and P1. (See dtgevc for the format.)
        evectr - (workspace) double[][] of dimesnion (ldu, max(nn)) The (block upper triangular) right eigenvector matrix for the matrices in S1 and P1. (See dtgevc for the format.)
        work - (workspace) double[] of dimension (lwork)
        lwork - input int The number of entries in work. This must be at least max(2*n**2, 6*n, 1), for all n = nn[j].
        llwork - (workspace) boolean[] of dimension max(nn))
        result - (output) double[] of dimension (15) The values computed by the tests described above. The values are currently limited to 1/ulp, to avoid overflow.
        info - (output) int[] = 0: successful exit < 0: If info[0] == -i, then i-th argument had an illegal value. > 0: A routine returned an error code. info is the absolute value of the info value returned.
      • dchkst

        private void dchkst​(int nsizes,
                            int[] nn,
                            int ntypes,
                            boolean[] dotype,
                            int[] iseed,
                            double thresh,
                            double[][] A,
                            int lda,
                            double[] AP,
                            double[] SD,
                            double[] SE,
                            double[] D1,
                            double[] D2,
                            double[] D3,
                            double[] D4,
                            double[] D5,
                            double[] WA1,
                            double[] WA2,
                            double[] WA3,
                            double[] WR,
                            double[][] U,
                            int ldu,
                            double[][] V,
                            double[] VP,
                            double[] tau,
                            double[][] Z,
                            double[] work,
                            int lwork,
                            int[] iwork,
                            int liwork,
                            double[] result,
                            int[] info)
        This is a port of the porions of LAPACK version 3.1 test routine DCHKST used to test the symmetric eigenvalue routines dsytrd, dorgtr, dsteqr, dsterf, and dsteqr. Original DCHKST created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006

        dsytrd factors A as U S U', where ' means transpose, S is symmetric diagonal, and U is orthogonal. dsytrd can use either just the lower or just the upper triangle of A; dchkst checks both cases. U is represented as a product of the Householder transformations, whose vectors are stored in the first n-1 columns of V, and whose scale factors are in TAU.

        dorgtr constructs the matrix U from the contents of V and TAU.

        dsteqr factors S as Z D1 Z', where Z is the orthogonal matrix of eigenvectors and D1 is a diagonal matrix with the eigenvalues on the diagonal. D2 is the matrix of eigenvalues computed when Z is not computed.

        dsterf computes D3, the matrix of eigenvalues, by the PWK method, which does not yield eigenvectors

        When dchkst is called, a number of matrix "sizes" ("n's") and a number of matrix "types" are specified. For each size ("n") and each type of matrix, one matrix will be generated and used to test the symmetric eigenroutines. For each matrix, a number of tests will be performed: (1) | A - V S V' | / ( |A| n ulp ) dsytrd(uplo = 'U', ... ) (2) | I - UV' | / ( n ulp ) dorgtr( uplo = 'U', ... ) (3) | A - V S V' | / ( |A| n ulp ) dsytrd( uplo = 'L', ... ) (4) | I - UV' | / ( n ulp ) dorgtr( uplo = 'L', ... ) (5) | S - Z D Z' | / ( |S| n ulp) dsteqr('V', ...) (6) | I - ZZ' | / ( n ulp ) dsteqr('V', ...) (7) | D1 - D2 | / ( |D1| ulp ) dsteqr('N', ...) (8) | D1 - D3 | / ( |D1| ulp ) dsterf (9) 0 if the true eigenvalues (computed by sturm count) of S are within thresh of those in D1. 2*thresh if they are not. (Tested using dstech) The "sizes" are specified by an array nn(0:nsizes-1); the value of each element nn[j] specifies one size. The "types" are specified by a boolean array dotype(0:ntypes-1); if dotype[j] is true, then the matrix type "j" will be generated. Currently, the list of possible types is: (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 geomtrically spaced entries 1, ..., ulp and random signs. (5) A diagonal matrix with "clustered" entries 1, ulp, ..., ulp and random signs. (6) Same as (4), but multiplied by sqrt( overflow threshold ) (7) Same as (4), but multiplied by sqrt( underflow threshold ) (8) A matrix of the form U' D U, where U is orthogonal and D has evenly spaced entries 1, ..., ulp with random signs on the diagonal. (9) A matrix of the form U' D U, where U is orthogonal and D has geometrically spaced entries 1, ..., ulp with random signs on the diagonal. (10) A matrix of the form U' D U, where U is 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) Symmetric 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) (16) Same as (8), but diagonal elements are all positive. (17) Same as (9), but diagonal elements are all positive. (18) Same as (10), but diagonal elements are all positive. (19) Same as (16), but multiplied by sqrt( overflow threshold) (20) Same as (16), but multiplied by sqrt( underflow threshold) (21) A diagonally dominant tridiagonal matrix with geometrically spaced diagonal entries 1, ..., ulp.

        Parameters:
        nsizes - (input) int The number of sizes of matrices to use. If it is zero, dchkst does nothing. It must be at least zero.
        nn - (input) int[] of dimension (nsizes) An array containing the sizes to be used for the matrices. Zero values will be skipped. The values must be at least zero.
        ntypes - (input) int The number of elements in dotype. If it is zero, dchkst does nothing. It must be at least zero. If it is maxtyp+1 and nsizes is 1, then an additional type, maxtyp+1 is defined, which is to use whatever matrix is in A. This is only useful if dotype(0:maxtyp-1) is false and dotype[maxtyp] is true.
        dotype - (input) boolean[] of dimension (ntypes) If dotype[j] is true, then for each size in nn a matrix of that size and of type j will be generated. If ntypes is smaller than the maximum number of types defined (parameter maxtyp), then types ntypes+1 through maxtyp will not be generated. If ntypes is larger than maxtyp, dotype[maxtyp] through dotype[ntypes-1] will be ignored.
        iseed - (input/output) int[] of 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[3] must be odd. The random number generator uses an 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 dchkst to continue the same random number sequence.
        thresh - (input) double A test will count as "failed" if the "error", computed as described above, exceeds thresh. Note that the error is scaled to be O(1), so thresh should be a reasonably small multiple of 1, e.g., 10 or 100. In particular, it should not depend on the precision (single vs. double) or the size of the matrix. It must be at least zero.
        A - (input/workspace/output) double[][] of dimension (lda, max(nn)) Used to hold the matrix whose eigenvalues are to be computed. On exit, A contains the last matrix actually used.
        lda - (input) int The leading dimension of A. It must be at least 1 and at least max(nn).
        AP - (workspace) double[] of dimension (max(nn)*max(nn+1)/2) The matrix A stored in packed format.
        SD - (workspace/output) double[] of dimension (max(nn)) The diagonal of the tridiagonal matrix computed by dsytrd. On exit, SD and SE contain the tridiagonal form of the matrix in A.
        SE - (workspace/output) double[] of dimension (max(nn)) The off-diagonal of the tridiagonal matrix computed by dsytrd. On exit, SD and SE contain the tridiagonal form of the matrix in A.
        D1 - (workspace/output) double[] of dimension (max(nn)) The eigenvalues of A, as computed by dsteqr simultaneously with Z. On exit, the eigenvalues in D1 correspond with the matrix in A.
        D2 - (workspace/output) double[] of dimension (max(nn)) The eigenvalues of A, as computed by dsteqr if Z is not computed. On exit, the eigenvalues in D2 correspond with the matrix in A.
        D3 - (workspace/output) double[] of dimension max(nn)) The eigenvalues of A, as computed by dsterf. On exit, the eigenvalues in D3 correspond with the matrix in A.
        D4 - double[]
        D5 - double[]
        WA1 - double[]
        WA2 - double[]
        WA3 - double[]
        WR - double[]
        U - (workspace/output) double[][] of dimension (ldu, max(nn)) The orthogonal matrix computed by dsytrd + dorgtr.
        ldu - (input) int The leading dimension of U, Z and V. It must be at least 1 and at least max(nn).
        V - (workspace/output) double[][] of dimension (ldu, max(nn)) The Householder vectors computed by dsytrd in reducing A to tridiagonal form. The vectors computed with uplo = 'U' are in the upper triangle, and the vectors computed with uplo = 'L' are in the lower triangle. (As described in dsytrd, the sub- and superdiagonal are not set to 1, although the true Householder vector has a 1 in that position. The routines that use V, such as dorgtr, set those entries to 1 before using them, and then restore them later.)
        VP - (workspace) double[] of dimension(max(nn)*max(nn+1)/2) The matrix V stored in packed format.
        tau - (workspace/output) double[] of dimension max(nn) The Householder factors computed by dsytrd in reducing A to tridiagonal form.
        Z - (workspace/output) double[][] of dimension (ldu, max(nn)) The orthogonal matrix of eigenvectors computed by dsteqr.
        work - (workspace/output) double[] of dimension (lwork)
        lwork - (input) int The number of entries in work. This must be at least 1 + 4*nmax + 2 * nmax * lg nmax + 3 * nmax**2 where nmax = max(nn[j], 2) and lg = log base 2.
        iwork - (workspace/output) int[] dimension (6+ 6*nmax + 5 * nmax * lg nmax) where nmax = max(nn[j], 2) and lg = log base 2
        liwork - (input) int length of iwork
        result - (output) double[] of dimension (26) The values computed by the tests described above. The values are currently limited to 1/ulp, to avoid overflow.
        info - (output) int[] If 0, then everything ran OK. -1: nsizes < 0 -2: Some nn[j] < 0 -3: ntypes < 0 -5: thresh < 0 -9: lda < 1 or lda < nmax, where nmax is max(nn[j]) -23: ldu < 1 or ldu < nmax -29: lwork too small. If dlatmr, dlatms, dsytrd, dorgtr, dsteqr, ssterf, or dormc2 returns an error code, the absolute value of it is returned.
      • ddot

        public double ddot​(int n,
                           double[] dx,
                           int incx,
                           double[] dy,
                           int incy)
        Port of 12/3/93 linpack ddot routine Original version created by Jack Dongarra Forms the dot product of two vectors.
        Parameters:
        n - int
        dx - double[]
        incx - int
        dy - double[]
        incy - int
        Returns:
        double answer
      • ddrgev

        private void ddrgev​(int nsizes,
                            int[] nn,
                            int ntypes,
                            boolean[] dotype,
                            int[] iseed,
                            double thresh,
                            double[][] A,
                            int lda,
                            double[][] B,
                            double[][] S,
                            double[][] T,
                            double[][] Q,
                            int ldq,
                            double[][] Z,
                            double[][] QE,
                            int ldqe,
                            double[] alphar,
                            double[] alphai,
                            double[] beta,
                            double[] alphr1,
                            double[] alphi1,
                            double[] beta1,
                            double[] work,
                            int lwork,
                            double[] result,
                            int[] info)
        This is a port of version 3.1 LAPACK test routine DDRGEV Original DDRGEV created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2007 ddrgev checks the nonsymmetric generalized eigenvalue problem driver routine dggev.

        dggev computes for a pair of n-by-n nonsymmetric matrices (A,B) the generalized eigenvalues and, optionally, the left and right eigenvectors.

        A generalized eigenvalue for a pair of matrices (A,B) is a scalar w or a ratio alpha/beta = w, such that A - w*B is singular. It is usually represented as the pair (alpha, beta), as there is reasonable interpretation for beta = 0, and even for both being zero.

        A right generalized eigenvector corresponding to a generalized eigenvalue w for a pair of matrices (A, B) is a vector r such that (A - wB) * r = 0. A left generalized eigenvector is a vector L such that L**H * (A - wB) = 0, where L**H is the conjugate-transpose of L.

        When ddrgev is called, a number of matrix "sizes" ("n's") and a number of matrix "types" are specified. For each size ("n") and each type of matrix, a pair of matrices (A, B) will be generated and used for testing. For each matrix pair, the following tests will be performed and compared with the threshold thresh.

        Results from dggev: (1) max over all left eigenvalue/-vector pairs (alpha/beta, L) of | VL**H * (beta A - alpha B) |/ (ulp max(|beta A|, |alpha B|)) where VL**H is the conjugate-transpose of VL. (2) | |VL(i)| - 1 | / ulp and whether largest component real VL(i) denotes the i-th column of VL. (3) max over all right eigenvalue/-vector pairs (alpha/beta, r) of | (beta A - alpha B) * VR | / ( ulp max(|beta A|, |alpha B|) ) (4) | |VR(i) - 1 | / ulp and whether largest component real VR(i) denotes the i-th column of VR. (5) W(full) = W(partial) W(full) denotes the eigenvalues computed when both L and r are also computed, and W(partial) denotes the eigenvalues computed when only W, only W and r, or only W and L are computed. (6) VL(full) = VL(partial) VL(full) denotes the left eigenvectors computed when both L and r are computed, and VL(partial) denotes the result when only L is computed. (7) VR(full) = VR(partial) VR(full) denotes the right eigenvectors computed when both L and r are also computed, and VR(partial) denotes the result when only r is computed.

        Test Matrices: The sizes of the test matrices are specified by an array nn(0:nsizes-1); the value of each element nn[j] specifies one size. The "types" are specified by a boolean array dotype(0:ntypes-1); if dotype[j] is true, then a matrix type "j" will be generated. Currently, the list of possible types is: (1) (0, 0) (a pair of zero matrices) (2) (I, 0) (an identity and a zero matrix) (3) (0, I) (a zero and an identity matrix) (4) (I, I) (a pair of identity matrices) (5) (Jtranspose, Jtranspose) (a pair of transposed Jordan blocks) (6) (X, Y) where X = (Jtranspose 0) and Y = (I 0 ) (0 I) (0 Jtranspose) and I is a k by k identity and J a (k+1) by (k+1) Jordan block; k = (N-1)/2 (7) (D, I) where D is diag(0, 1,..., N-1) (a diagonal matrix with those diagonal entries.) (8) (I, D) (9) (big*D, small*I) where "big" is near overflow and small = 1/big (10) (small*D, big*I) (11) (big*I, small*D) (12) (small*I, big*D) (13) (big*D, big*I) (14) (small*D, small*I) (15) (D1, D2) where D1 is diag(0, 0, 1, ..., N-3, 0) and D2 is diag(0, N-3, N-4,..., 1, 0, 0) (16) Q (Jtranspose, Jtranspose) Z where Q and Z are random orthogonal matrices. (17) Q (T1, T2) Z where T1 and T2 are upper triangular matrices with random O(1) entries above the diagonal and diagonal entries diag(T1) = (0, 0, 1, ..., N-3, 0) and diag(T2) = (0, N-3, N-4, ..., 1, 0, 0) (18) Q (T1, T2) Z diag(T1) = (0, 0, 1, 1, s, ..., s, 0) diag(T2) = (0, 1, 0, 1, ..., 1, 0) s = machine precision (19) Q (T1, T2) Z diag(T1) = (0,0,1,1, 1-d, ..., 1 - (N-5)*d=s, 0) diag(T2) = (0, 1, 0, 1, ..., 1, 0) (20) Q (T1, T2) Z diag(T1) = (0,0,1,1,a, ..., a**(N-5)=s, 0) diag(T2) = (0, 1, 0, 1, ..., 1, 0, 0) (21) Q (T1, T2) Z diag(T1) = (0, 0, 1, r1, r2, ..., r(N-4), 0) diag(T2) = (0, 1, 0, 1, ..., 1, 0, 0) where r1, ..., r(N-4) are random. (22) Q (big*T1, small*T2) Z diag(T1) = (0, 0, 1, ..., N-3, 0) diag(T2) = (0, 1, ..., 1, 0, 0) (23) Q (small*T1, big*T2) Z diag(T1) = (0, 0, 1, ..., N-3, 0) diag(T2) = (0, 1, ..., 1, 0, 0) (24) Q (small*T1, small*T2) Z diag(T1) = (0, 0, 1, ..., N-3, 0) diag(T2) = (0, 1, ..., 1, 0, 0) (25) Q (big*T1, big*T2) Z diag(T1) = (0, 0, 1, ..., N-3, 0) diag(T2) = (0, 1, ..., 1, 0, 0) (26) Q(T1, T2) Z where T1 and T2 are random upper-triangular matrices.

        Parameters:
        nsizes - input int The number of sizes of matrices to use. If it is zero, ddrgev does nothing. nsizes >= 0.
        nn - input int[] of dimension (nsizes) An array containing the sizes to be used for the matrices. Zero values will be skipped. nn >= 0.
        ntypes - input int The number of elements in dotype. If it is zero, ddrgev does nothing. It must be at least zero. If it is maxtyp+1 and nsizes is 1, then an additional type, maxtyp+1 is defined, which is to use whatever matrix is in A. This is only useful if dotype(0:maxtyp-1) is false and dotype(maxtyp) is true.
        dotype - input boolean[] of dimension (ntypes) If dotype[j] is true, then for each size in nn a matrix of that size and of type j will be generated. If ntypes is smaller than the maximum number of types defined(maxtyp), then types ntypes+1 through maxtyp will not be generated. If ntypes is larger than maxtyp, dotype[maxtyp] through dotype[ntypes-1] will be ignored.
        iseed - (input/output) int[] of 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[3] 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 ddrgev to continue the same random number sequence.
        thresh - input double A test will count as "failed" if the "error", computed as described above, exceeds thresh. Note that the error is scaled to O(1), so thresh should be a reasonably small multiple of 1, e.g., 10 or 100. In particular, it should not depend on the precision (single vs. double) or the size of the matrix. It must be at least zero.
        A - (input/workspace) double[][] of dimension (lda, max(nn)) Used to hold the original A matrix. Used as input only if ntypes = maxtyp+1, dotype(0:maxtyp-1) = false, and dotype[maxtyp] = true.
        lda - input int The leading dimension of A, B, S, and T. It must be at least 1 and at least max(nn).
        B - (input/workspace) double[][] of dimension (lda, max(nn)) Used to hold the original B matrix. Used as input only if ntypes = maxtyp+1, dotype(0:maxtyp-1) = false, and dotype[maxtyp] = true.
        S - workspace double[][] of dimension (lda, max(nn)) The Schur form matrix computed from A by dggev. On exit, S contains the Schur form matrix corresponding to the matrix in A.
        T - workspace double[][] of dimension (lda, max(nn)) The upper triangular matrix computed from B by dggev.
        Q - workspace double[][] of dimension (ldq, max(nn)) The (left) eigenvectors matrix computed by dggev.
        ldq - input int The leading dimension of Q and Z. It must be at least 1 and at least max(nn).
        Z - Z (workspace) double[][] of dimension (ldq, max(nn)) The (right) orthogonal matrix computed by dggev.
        QE - QE (workspace) double[][] of dimension (ldqe, max(nn)) QE holds the computed right or left eigenvectors.
        ldqe - input int The leading dimension of QE. ldqe >= max(1,max(nn))
        alphar - workspace double[] of dimension (max(nn))
        alphai - workspace double[] of dimension (max(nn))
        beta - workspace double[] of dimension (max(nn)) The generalized eigenvalues of (A,B) computed by dggev. (alphar[k-1] + alphai[k-1]*i)/ beta[k-1] is the k-th generalized eigenvalue of A and B.
        alphr1 - workspace double[] of dimension (max(nn))
        alphi1 - workspace double[] of dimension (max(nn))
        beta1 - workspace double[] of dimension (max(nn)) Like alphar, alphai, and beta, these arrays contain the eigenvalues of A and B, but those computed when dggev only computes a partial eigendecomposition, i.e. not the eigenvalues and left and right eigenvectors.
        work - workspace double[] of dimension (lwork)
        lwork - input int The nuber of entries in work. lwork >= max(8*N, N*(N+1)).
        result - output double[] of dimension (2) The values are computed by the tests described above. The values are currently limited to 1/ulp, to avoid overflow.
        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value. > 0: A routine returned an error code.
      • ddrvsg

        private void ddrvsg​(int nsizes,
                            int[] nn,
                            int ntypes,
                            boolean[] dotype,
                            int[] iseed,
                            double thresh,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            double[] D,
                            double[][] Z,
                            int ldz,
                            double[][] AB,
                            double[][] BB,
                            double[] AP,
                            double[] BP,
                            double[] work,
                            int nwork,
                            int[] iwork,
                            int liwork,
                            double[] result,
                            int[] info)
        This is a port of that portion of the version 3.1 LAPACK test routine DDRVSG that tests the DSYGV that computes all eigenvalues and, optionally, eigenvectors of a real symmetric-definite generalized eigenproblem. Original DDRVSG created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 When ddrvsg is called, a number of matrix "sizes" ("n's") and a number of matrix "types" are specified. For each size ("n") and each type of matrix, one matrix A of the given type will be generated; a random well- conditioned matrix B is also generated and the pair (A,B) is used to test the drivers. For each pair (A,B), the following tests are performed: (1) dsygv with itype = 1 and uplo = 'U': |A Z - B Z D | / (|A| |Z| n ulp) (2) dysgv with itype = 1 and uplo = 'L' (3) dsygv with itype = 2 and uplo = 'U' |A B Z - Z D |/ (|A| |Z| n ulp) (4) dsygv with itype = 2 and uplo = 'L' (5) dsygv with itype = 3 and uplo = 'U' | B A Z - Z D | / ( |A| |Z| n ulp) (6) dsygv with itype = 3 and uplo = 'L'

        The "sizes" are specified by an array nn(0:nsizes-1); the value of each element nn[j] specifies one size. The "types" are specified by a logical array dotype(0:ntypes-1); if dotype[j] is true, then matrix type "j" will be generated. This type is used for the matrix A which has half-bandwidth ka. B is generated as a well-conditioned positive definite matrix with half-bandwidth kb (<= ka). Currently, the list of possible types for A is: (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 (4), but multiplied by sqrt(overflow threshold) (7) Same as (4), but multiplied by sqrt(underflow threshold) (8) A matrix of the form U* D U, where U is orthogonal and D has evenly spaced entries 1, ..., ulp with random signs on the diagonal. (9) A matrix of the form U* D U, where U is orthogonal and D has geometrically spaced entries 1, ..., ulp with random signs on the diagonal. (10) A matrix of the form U* D U, where U is orthgonal 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) Symmetric 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). (16) Same as (8), but with ka = 1 and kb = 1. (17) Same as (8), but with ka = 2 and kb = 1. (18) Same as (8), but with ka = 2 and kb = 2. (19) Same as (8), but with ka = 3 and kb = 1. (20) Same as (8), but with ka = 3 and kb = 2. (21) Same as (8), but with ka = 3 and kb = 3.

        Parameters:
        nsizes - input int The number of sizes of matrices to use. If it is zero, ddrvsg does nothing. It must be at least zero.
        nn - input int[] of dimension nsizes. An array containing the sizes to be used for the matrices. Zero values will be skipped. The values must be at least zero.
        ntypes - input int The number of elements in dotype. If it is zero, ddrvsg does nothing. It must be at least zero. If it is maxtyp+1 and nsizes is 1, then an addtional type, maxtyp+1 is defined, which is to use whatever matrix is in A. This is only useful if dotype(0:maxtyp-1) is false and dotype(maxtyp) is true.
        dotype - input boolean[] of dimension ntypes. If dotype[j-1] is true, then for each size in nn a matrix of that size and of type j will be generated. If ntypes is smaller than the maximum number of types defined by maxtyp, then types ntypes+1 through maxtyp will not be generated. If ntypes is larger than maxtyp, dotype[maxtyp] through dotype[ntypes-1] will be ignored.
        iseed - input/output int[] of 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[3] 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 ddrvsg to continue the same random number sequence.
        thresh - input double A test will count as "failed" if the "error", computed as described above, exceeds thres. Note that the error is scaled to be O(1), so thresh should be a reasonably small multiple of 1, e.g., 10 or 100. In particular, it should not depend on the precision (single vs. double) or the size of the matrix. It must be at least zero.
        A - input/output double[][] of dimension lda by max(nn). Used to hold the matrix whose eigenvalues are to be computed. On exit, A contains the last matrix actually used.
        lda - input int The leading dimension of A and AB. It must be at least 1 and at least max(nn).
        B - input/output double[][] of dimension ldb by max(nn). Used to hold the symmetric positive definite matrix for the generalized problem. On exit, B contains the last matrix actually used.
        ldb - input int The leading dimension of B and BB. It must be at least 1 and at least max(nn).
        D - input/output double[] of dimension max(nn). The eigenvalues of A. On exit, the eigevalues in D must correspond with the matrix in A.
        Z - input/output double[][] of dimension ldz by max(nn). The matrix of eigenvectors.
        ldz - input int The leading dimension of Z. It must be at least 1 and at least max(nn).
        AB - workspace double[][] of dimension lda by max(nn).
        BB - workspace double[][] of dimension ldb by max(nn).
        AP - workspace double[] of dimension (max(nn)**2)
        BP - workspace double[] of dimension (max(nn)**2)
        work - workspace double[] of dimension nwork.
        nwork - input int The number of entries in work. This must be at least 1 + 5*n + 2*n*lg(n) + 3*n**2 where n = max(nn[j]) and lg(n) = smallest integer k such that 2**k >= n.
        iwork - workspace int[] of dimension liwork.
        liwork - input int The number of entries in iwork. This must be at least 6*n.
        result - output double[] of dimension 70. The values computed by the tests described above.
        info - output int[] If 0, then everything ran OK. -1: nsizes < 0 -2: Some nn[j] < 0 -3: ntypes < 0 -5: thresh < 0 -9: lda < 1 or lda < nmax, where nmax is max(nn[j]). -16: ldz < 1 or ldz < nmax. -21: nwork too small. -23: liwork too small. If dsygv returns an error code, the absolute value of it is returned.
      • ddrvst

        private void ddrvst​(int nsizes,
                            int[] nn,
                            int ntypes,
                            boolean[] dotype,
                            int[] iseed,
                            double thresh,
                            double[][] A,
                            int lda,
                            double[] D1,
                            double[] D2,
                            double[] D3,
                            double[] D4,
                            double[] eveigs,
                            double[] WA1,
                            double[] WA2,
                            double[] WA3,
                            double[][] U,
                            int ldu,
                            double[][] V,
                            double[] tau,
                            double[][] Z,
                            double[] work,
                            int lwork,
                            int[] iwork,
                            int liwork,
                            double[] result,
                            int[] info)
        This is a port of the part of version 3.1 LAPACK test routine DDRVST used to test dsyev. Original DDRVST created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 ddrvst checks the symmetric eigenvalue problem driver dsyev. dsyev computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix.

        When ddrvst is called, a number of matrix "sizes" ("n's") and a number of matrix "types" are specified. For each size ("n") and each type of matrix, one matrix will be generated and used to test the dsyev driver. For each matrix, the following tests will be performed: (1) | A - Z D Z' | / ( |A| n ulp ) (2) | I - Z Z' | / ( n ulp ) (3) | D1 - D2 | / ( |D1| ulp ) where Z is the matrix of eigenvectors returned when the eigenvector option is given and D1 and D2 are the eigenvalues returned with and without the eigenvector option.

        The "sizes" are specified by an array nn(0:nsizes-1); the value of each element nn[j] specifies one size. The "types" are specified by a boolean array dotype(0:ntypes-1); if dotype[j] is true, then matrix type "j" will be generated. Currently, the list of possible types is: (1) The zero matrix. (2) The identity matrix. (3) A diagonal matrix with evenly spaced eigenvalues 1, ..., ulp and random signs. (ulp = (first number larger than 1) - 1) (4) A diagonal matrix with geometrically spaced eigenvalues 1, ..., ulp and random signs. (5) A diagonal matrix with "clustered" eigenvalues 1, ulp, ..., ulp and random signs. (6) Same as (4), but multiplied by sqrt(overflow threshold) (7) Same as (4), but multiplied by sqrt(underflow threshold) (8) A matrix of the form U' D U, where U is orthogonal and D has evenly spaced entries 1, ..., ulp with random signs on the diagonal. (9) A matrix of the form U' D U, where U is orthogonal and D has geometrically spaced entries 1, ..., ulp with random signs on the diagonal. (10) A matrix of the form U' D U, where U is 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) Symmetric 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) (16) A band matrix with half bandwidth randomly chosen between 0 and n-1, with evenly spaced eigenvalues 1, ..., ulp with random signs. (17) Same as (16), but multiplied by sqrt(overflow threshold) (18) Same as (16), but multiplied by sqrt(underflow threshold)

        The tests performed are: (1) | A - U S U' | / ( |A| n ulp ) dsyev('L', 'V', ... ) (2) | I - U U' | / ( n ulp ) dsyev('L', 'V', ... ) (3) |D(with Z) - D(w/o Z)| / (|D| ulp) dsyev('L', 'N', ... ) Tests 1 through 3 are repeated with uplo = 'U'

        Parameters:
        nsizes - (input) int The number of sizes of matrices to use. If it is zero, ddrvst does nothing. It must be at least zero.
        nn - (input) int[] of dimension (nsizes) An array containing the sizes to be used for the matrices. Zero values will be skipped. The values must be at least zero.
        ntypes - (input) int The number of elements in dotype. If it is zero, ddrvst does nothing. It must be at least zero. If it is maxtyp+1 and nsizes is 1, then an additional type, maxtyp+1 is defined, which is to use whatever matrix is in A. This is only useful if dotype(0:maxtyp-1) is false and dotype[maxtyp] is true.
        dotype - (input) boolean[] of dimension (ntypes) If dotype[j] is true, then for each size in nn a matrix of that size and of type j will be generated. If ntypes is smaller than the maximum number of types defined (parameter maxtyp), then types ntypes+1 through maxtyp will not be generated. If ntypes is larger than maxtyp, dotype[maxtyp] through dotype[ntypes-1] will be ignored.
        iseed - (input/output) int[] of 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[3] 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 ddrvst to continue the same random number sequence.
        thresh - (input) double A test will count as "failed" if the "error", computed as described above, exceeds thresh. Note that the error is scaled to be O(1), so thresh should be a reasonably small multiple of 1, e.g., 10 or 100. In particular, it should not depend on the precision (single vs. double) or the size of the matrix. It must be at least zero.
        A - (input/workspace/output) double[][] of dimension (lda, max(nn)) Used to hold the matrix whose eigenvalues are to be computed. On exit, A contains the last matrix actually used.
        lda - (input) int The leading dimension of A. It must be at least 1 and at least max(nn).
        D1 - (workspace/output) double[] of dimension (max(nn)) The eigenvalues of A, as computed by dsteqr simultaneously with Z. On exit, the eigenvalues in D1 correspond with the matrix in A.
        D2 - (workspace/output) double[] of dimension (max(nn)) The eigenvalues of A, as computed by dsteqr if Z is not computed. On exit, the eigenvalues in D2 correspond with the matrix in A.
        D3 - (workspace/output) double[] of dimension max(nn)) The eigenvalues of A, as computed by dsterf. On exit, the eigenvalues in D3 correspond with the matrix in A.
        D4 - double[] of dimension (max(nn))
        eveigs - double[] of dimension (max(nn)) The eigenvalues as computed by dstev('N', ... )
        WA1 - double[]
        WA2 - double[]
        WA3 - double[]
        U - (workspace/output) double[][] of dimension (ldu, max(nn)) The orthogonal matrix computed by dsytrd + dorgtr.
        ldu - (input) int The leading dimension of U, Z and V. It must be at least 1 and at least max(nn).
        V - (workspace/output) double[][] of dimension (ldu, max(nn)) The Householder vectors computed by dsytrd in reducing A to tridiagonal form.
        tau - (workspace/output) double[] of dimension max(nn) The Householder factors computed by dsytrd in reducing A to tridiagonal form.
        Z - (workspace/output) double[][] of dimension (ldu, max(nn)) The orthogonal matrix of eigenvectors computed by dsteqr.
        work - (workspace/output) double[] of dimension (lwork)
        lwork - (input) int The number of entries in work. This must be at least 1 + 4*nmax + 2 * nmax * lg nmax + 4 * nmax**2 where nmax = max(nn[j], 2) and lg = log base 2.
        iwork - workspace int[] of dim (6 + 6*nmax + 5* nmax * lg nmax) where nmax = max(nn[j], 2) and lg = log base 2.
        liwork - (input) int length of iwork
        result - (output) double[] of dimension (105) The values computed by the tests described above. The values are currently limited to 1/ulp, to avoid overflow.
        info - (output) int[] If 0, then everything ran OK. -1: nsizes < 0 -2: Some nn[j] < 0 -3: ntypes < 0 -5: thresh < 0 -9: lda < 1 or lda < nmax, where nmax is max(nn[j]) -16: ldu < 1 or ldu < nmax -21: lwork too small. If dlatmr, dlatms, dsytrd, dorgtr, dsteqr, dsterf, or dormtr returns an error code, the absolute value of it is returned.
      • dgemm

        public void dgemm​(char transa,
                          char transb,
                          int m,
                          int n,
                          int k,
                          double alpha,
                          double[][] A,
                          int lda,
                          double[][] B,
                          int ldb,
                          double beta,
                          double[][] C,
                          int ldc)
        This is a port of the 2/8/89 Blas routine Original version written by: Jack Dongarra, Argonne National Laboratory Iain Duff, AERE Harwell. Jeremy Du Croz, Numerical Algorithms Group Ltd. Sven Hammarling, Numerical Algorithms Group Ltd. dgemm performs one of the matrix-matrix operations C = alpha*op(A)*op(B) + beta*C, where op(X) is one of op(X) = X or op(X) = X', alpha and beta are scalars, and A, B, and C are matrices, with op(A) an m by k matrix, op(B) a k by n matrix, and C an m by n matrix.
        Parameters:
        transa - input char On entry, transa specifies the form of op(A) to be used in the matrix multiplication as follows:' = 'N' or 'n', op(A) = A. = 'T' or 't', op(A) = A'. = 'C' or 'c', op(A) = A'.
        transb - input char On entry, transb specifies the form of op(B) to be used in the matrix multiplication as follows: = 'N' or 'n', op(B) = B. = 'T' or 't', op(B) = B'. = 'C' or 'c', op(B) = B'.
        m - input int On entry, m specifies the number of rows of the matrix op(A) and of the matrix C. m must be at least zero.
        n - input int On entry, n specifies the number of columns of the matrix op(B) and the number of columns of the matrix C. n must be at least zero.
        k - input int On entry, k specifies the number of columns of the matrix op(A) and the number of rows of the matrix op(B). k must be at least zero.
        alpha - input double specified scalar
        A - input double[][] dimension lda by ka, where ka is k when transa = 'N' or 'n', and is m otherwise. Before entry with transa = 'N' or 'n', the leading m by k part of the array A must contain the matrix A, otherwise the leading k by m part of the array A must contain the matrix A
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. When transa = 'N' or 'n' then lda must be at least max(1,m), otherwise lda must be at least max(1,k)
        B - input double[][] dimension ldb by kb, where kb is n when transb = 'N' or 'n', and is k otherwise. Before entry with transb = 'N' or 'n', the leading k by n part of the array B must contain the matrix B, otherwise the leading n by k part of the array B must contain the matrix B
        ldb - input int On entry, ldb specifies the first dimension of B as declared in the calling (sub) program. When transb = 'N' or 'n' then ldb must be at least max(1,k), otherwise ldb must be at least max(1,n).
        beta - input double specified scalar When beta is supplied as zero, then C need not be set on input.
        C - input/output double[][] dimension ldc by n. Before entry, the leading m by n part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the array C is overwritten by the m by n matrix (alpha*op(A)*op(B) + beta*C).
        ldc - input int On entry, ldc specifies the first dimension of C as declared in the calling (sub) program. ldc must be at least max(1,m).
      • dgemv

        public void dgemv​(char trans,
                          int m,
                          int n,
                          double alpha,
                          double[][] A,
                          int lda,
                          double[] x,
                          int incx,
                          double beta,
                          double[] y,
                          int incy)
        Routine ported from 10/22/86 blas dgemv subroutine Original version written by: Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs. dgemv performs one of the matrix-vector operations y = alpha*A*x + beta*y, or y = alpha*A'*x + beta*y, where alpha and beta are scalars, x and y are vectors, and A is an m by n matrix
        Parameters:
        trans - input char On entry, trans specifies the operation to be performed as follows: = 'N' or 'n' y = alpha*A*x + beta*y = 'T' or 't' y = alpha*A'*x + beta*y = 'C' or 'c' y = alpha*A'*x + beta*y
        m - input int On entry, m specifies the mumber of rows of matrix A. m must be at least zero.
        n - input int On entry, n specifies the number of columns of matrix A. n must be at least zero.
        alpha - input double specified scalar
        A - input double[][] dimension lda by n Before entry, the leading m by n part of the array A must contain the matrix of coefficients.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. lda must be at least max(1, m).
        x - input double[] array of dimension at least (1 + (n-1)*abs(incx)) when trans = 'N' or 'n' and at least (1 + (m-1)*abs(incx)) otherwise. Before entry, the incremented array x must contain the vector x.
        incx - input int On entry, incx specifies the increment for the elements of x. incx must not be zero.
        beta - input double specified scalar When beta is supplied as zero, then y need not be set on input.
        y - input/output double[] array of dimension at least (1 + (m-1)*abs(incy)) when trans = 'N' or 'n' and at least (1 + (n-1)*abs(incy)) otherwise. Before entry with beta non-zero, the incremented array y must contain the vector y. On exit, array y is overwritten with the updated vector y.
        incy - input int On entry, incy specifies the increment for the elements of y. incy must not be zero.
      • dgennd

        public boolean dgennd​(int m,
                              int n,
                              double[][] A,
                              int lda)
        This is a port of version 3.1 LAPACK test routine DGENND. Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. February 2008 .. Scalar Arguments .. INTEGER M, N, LDA .. .. Array Arguments .. DOUBLE PRECISION A( LDA, * ) .. Purpose ======= DGENND tests that its argument has a non-negative diagonal. Arguments ========= M (input) INTEGER The number of rows in A. N (input) INTEGER The number of columns in A. A (input) DOUBLE PRECISION array, dimension (LDA, N) The matrix. LDA (input) INTEGER Leading dimension of A.
      • dgeqr2

        public void dgeqr2​(int m,
                           int n,
                           double[][] A,
                           int lda,
                           double[] tau,
                           double[] work,
                           int[] info)
        This is a port of the version 3.2 LAPACK routine DGEQR2 Original DGEQR2 created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd. November, 2006 dgeqr2 computes a QR factorization of a real m by n matrix A: A = Q * R
        Parameters:
        m - input int The number of rows of the matrix A. m >= 0.
        n - input int The number of columns of the matrix A. n >= 0.
        A - (input/output) double[][] of dimension (lda,n) On entry, the m by n matrix A. On exit, the elements on and above the diagonal of the array contain the min(m,n) by n upper trapezoidal matrix R (R is upper triangular if m >= n). The elements below the diagonal, with the array tau, represent the orthogonal matrix Q as a product of elementary reflectors. The matrix Q is represented as a product of elementary reflectors Q = H(1) H(2) . . . H(k), where k = min(m,n). Each H(i) has the form H(i) = I - tau * v * v' where tau is a real scalar, and v is a real vector with v(0:i-2) = 0 and v(i-1) = 1; v(i:m-1) is stored on exit in A(i:m-1, i-1), and tau in tau[i-1].
        lda - input int The leading dimension of the array A. lda >= max(1,m).
        tau - output double[] of dimension min(m,n) The scalar factors of the elementary reflectors.
        work - (workspace) double[] of dimension (n)
        info - output int[] = 0: successful exit, < 0: If info[0] = -i, the i-th argument had an illegal value.
      • dgeqlf

        public void dgeqlf​(int m,
                           int n,
                           double[][] A,
                           int lda,
                           double[] tau,
                           double[] work,
                           int lwork,
                           int[] info)
      • dgeql2

        private void dgeql2​(int m,
                            int n,
                            double[][] A,
                            int lda,
                            double[] tau,
                            double[] work,
                            int[] info)
      • dgeqrf

        public void dgeqrf​(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 DGEQRF Original DGEQRF created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dgeqrf computes a QR factorization of a real m by n matrix A: A = Q * R.
        Parameters:
        m - input int The number of rows of the matrix A. m >= 0.
        n - input int The number of columns of the matrix A. n >= 0.
        A - input/output double[][] of dimension (lda,n) On entry, the m by n matrix A. On exit, the elements on and above the diagonal of the array contain the min(m,n)-by-n upper trapezoidal matrix R ( R is upper triangular if m >= n); the elements below the diagonal, with the array tau, represent the orthogonal matrix Q as a product of min(m,n) elementary reflectors. The matrix Q is represented as a product of elementary reflectors Q = H(1) H(2) . . . H(k), where k = min(m,n) Each H(i) has the form H(i) = I - tau * v * v' where tau is a real scalar, and v is a real vector with v(0:i-2) = 0 and v(i-1) = 1; v(i:m-1) is stored on exit in A(i:m-1,i-1), and tau in tau[i-1].
        lda - input int The leading dimension of the array A. lda >= max(1,m).
        tau - output double[] of dimension min(m,n). The scalar factors of the elementary reflectors.
        work - (workspace/output) double[] of dimension (max(1,lwork)) On exit, if info[0] = 0, work[0] returns the optimal lwork.
        lwork - input int The dimension of the array work. lwork >= max(1,n). For optimum performance, lwork >= 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 output.
        info - output int[] = 0: successful exit, < 0: If info[0] = -i, the i-th argument had an illegal value
      • dger

        public void dger​(int m,
                         int n,
                         double alpha,
                         double[] x,
                         int incx,
                         double[] y,
                         int incy,
                         double[][] A,
                         int lda)
        This is a port of the 10/22/86 Blas routine DGER Original version written by: Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs. dger performs the rank 1 operation A = alpha*x*y' + A, where alpha is a scalar, x is an m element vector, y is an n element vector, and A is an m by n matrix.
        Parameters:
        m - input int On entry, m specifies the number of rows of the matrix A. m must be at least zero.
        n - input int On entry, n specifies the number of columns of the matrix A. n must be at least zero.
        alpha - input double Specified scalar
        x - input double[] of dimension at least (1 + (m-1)*abs(incx)). Before entry, the incremented array x must contain the m element vector x.
        incx - input int On entry, incx specifies the increment for the elements of x. incx must not be zero.
        y - input double[] of dimension at least (1 + (n-1)*abs(incy)). Before entry, the incremented array y must contain the n element vector y.
        incy - input int On entry, incy specifies the increment for the elements of y. incy must not be zero.
        A - double[][] of dimension lda by n. Before entry, the leading m by n part of the array A must contain the matrix of coefficients. On exit, A is overwritten by the updated matrix.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. lda must be at least max(1,m).
      • dget51

        private void dget51​(int itype,
                            int n,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            double[][] U,
                            int ldu,
                            double[][] V,
                            int ldv,
                            double[] work,
                            double[] result)
        This is a port of version 3.1 LAPACK test routine DGET51 Original DGET51 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dget51 generally checks a decomposition of the form A = U B V' where ' means transpose and U and V are orthogonal. Specifically, if itype = 1 result = | A - U B V' | / ( |A| n ulp ) If itype = 2, then: result = | A - B | / ( |A| n ulp ) If itype = 3, then: result = | I - UU' | / ( n ulp )
        Parameters:
        itype - input int Specifies the type of tests to be performed. = 1: result = | A - U B V' | / ( |A| n ulp ) = 2: result = | A - B | / ( |A| n ulp ) = 3: result = | I - UU' | / ( n ulp )
        n - input int The size of the matrix. If it is zero, dget51 does nothing. It must be at least zero.
        A - (input) double[][] of dimension (lda, n) The original (unfactored) matrix.
        lda - (input) int The leading dimension fo A. It must be at least 1 and at least n.
        B - (input) double[][] of dimension (ldb,n) The factored matrix.
        ldb - (input) int The leading dimension of B. It must be at least 1 and at least n.
        U - (input) double[][] of dimension (ldu, n) The orthogonal matrix on the left-hand side in the decomposition. Not referenced if itype = 2.
        ldu - (input) int The leading dimension of U. ldu must be at least n and at least 1.
        V - (input) double[][] of dimension (ldv,n) The orthogonal matrix on the right-hand side in the decomposition. Not referenced if itype = 2 or itype = 3.
        ldv - (input) int The leading dimension of V. ldv must be at least n and at least 1.
        work - (workspace) double[] of dimension (2*n**2)
        result - (output) double[] The values computed by the test specified by itype. The value is currently limited to 1/ulp, to avoid overflow. Errors are flagged by result = 10/ulp.
      • dget52

        private void dget52​(boolean left,
                            int n,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            double[][] E,
                            int lde,
                            double[] alphar,
                            double[] alphai,
                            double[] beta,
                            double[] work,
                            double[] result)
        This is a port of version 3.1 LAPACK test routine DGET52 Original DGET52 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dget52 does an eigenvector check for the generalized eigenvalue problem.

        The basic test for right eigenvectors is: | b[j] A E[j] - a[j] B E[j] | result[0] = max ------------------------------- j n ulp max( |b[j] A|, |a[j] B| using the 1-norm. Here a[j]/b[j] = w is the (j+1)-th generalized eigenvalue of A - w B, or, equivalently, b[j]/a[j] = m is the (j+1)-st generalized eigenvalue of m A - B.

        For real eigenvalues, the test is straightforward. For complex eigenvalues, E[j] and a[j] are complex, represented by Er[j] + i*Ei[j] and ar[j] + i*ai[j], respectively, so the test for that eigenvector becomes max(|Wr|, |Wi| ) ---------------------------------------------- n ulp max( |b[j] A|, (|ar[j]| + |ai[j]|) |B| ) where Wr = b[j] A Er[j] - ar[j] B Er[j] + ai[j] B Ei[j] Wi = b[j] A Ei[j] - ai[j] B Er[j] - ar[j] B Ei[j] T T _ For left eigenvectors, A , B , a, and b are used.

        dget52 also tests the normalization of E. Each eigenvector is supposed to be normalized so that the maximum "absolute value" of its elements is 1, where in this case, "absolute value" of a complex value x is |Re(x)| + |Im(x)|; let us call this maximum "absolute value" norm of a vector v M(v). If a[j] = b[j] = 0, then the eigenvector is set to be the (j+1)-st coordinate vector. The normalization test is: result[1] = max | M(v[j]) - 1| / (n ulp) eigenvectors v[j]

        Parameters:
        left - input boolean = true: The eigenvectors in the columns of E are assumed to be*left* eigenvectors. = false: The eigenvectors in the columns of E are assumed to be*right* eigenvectors.
        n - input int The size of the matrices. If it is zero, dget52 does nothing. It must be at least zero.
        A - input double[][] of dimension (lda, n) The matrix A.
        lda - input int The leading dimension of A. It must be at least 1 and at least n.
        B - input double[][] of dimension (ldb, n) The matrix B.
        ldb - input int The leading dimension of B. It must be at least 1 and at least n.
        E - input double[][] of dimension (lde,n) The matrix of eigenvectors. It must be O(1). Complex eigenvalues and eigenvectors always come in pairs, the eigenvalue and its conjugate being stored in adjacent elements of alphar, alphai, and beta. Thus, if a[j]/b[j] and a[j+1]/b[j+1] are a complex conjugate pair of generalized eigenvalues, then E(,j) contains the real part of the eigenvector and E(,j+1) contains the imaginary part. Note that whether E(,j) is a real eigenvector or part of a complex one is specified by whether alphai[j] is zero or not.
        lde - input int The leading dimension of E. It must be at least 1 and at least n.
        alphar - input double[] of dimension (n). The real parts of the values a[j] as described above, which, along with b[j], define the generalized eigenvalues. Complex eigenvalues always come in complex conjugate pairs a[j]/b[j] and a[j+1]/b[j+1], which are stored in adjacent elements in alphar, alphai, and beta. Thus, if the j-th and (j+1)-st eigenvalues form a pair, alphar[j+1]/beta[j+1] is assumed to be equal to alphar[j]/beta[j].
        alphai - input double[] of dimension (n) The imaginary parts of the values of a[j] as described above, which, along with b[j], define the generalized eigenvalues. If alphai[j] = 0, then the eigenvalue is real, otherwise it is part of a complex conjugate pair. Complex eigenvalues always come in complex conjugate pairs a[j]/b[j] and a[j+1]/b[j+1], which are stored in adjacent elements in alphar, alphai, and beta. Thus, if the j-th and (j+1)-st eigenvalues form a pair, alphai[j+1]/beta[j+1] is assumed to be equal to -alphai[j]/beta[j]. Also, nonzero values in alphai are assumed to always come in adjacent pairs.
        beta - input double[] of dimension (n). The values b[j] as described above, which, along with a[j], define the generalized eigenvalues.
        work - workspace double[] of dimension (n**2+n)
        result - output double[] of dimension (2) The values computed by the test described above. If A E or B E is likely to overflow, then result(0:1) is set to 10 / ulp.
      • dggbak

        private void dggbak​(char job,
                            char side,
                            int n,
                            int ilo,
                            int ihi,
                            double[] lscale,
                            double[] rscale,
                            int m,
                            double[][] V,
                            int ldv,
                            int[] info)
        This is a port of version 3.1 LAPACK routine DGGBAK Original DGGBAK created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dggbak forms the right or left eigenvectors of a real generalized eigenvalue problem A*x = lambda*B*x, by backward transformation on the computed eigenvectors of the balanced pair of matrices output by dggbal.
        Parameters:
        job - input char Specifies the type of backward transformation required: = 'N': do nothing, return immediately, = 'P': do backward transformation for permutation only, = 'S': do backward transformation for scaling only, = 'B': do backward transformations for both permutation and scaling job must be the same as the argument job supplied to dggbal.
        side - input char = 'R': V contains right eigenvectors, = 'L': V contains left eigenvectors
        n - input int The number of rows of the matrix V. n >= 0.
        ilo - input int
        ihi - input int The integers ilo and ihi determined by dggbal. 1 <= ilo <= ihi <= n, if n > 0; ilo = 1 and ihi = 0, if n = 0.
        lscale - input double[] of dimension (n) Details of the permutations and/or scaling factors applied to the left side of A and B, as returned by dggbal.
        rscale - input double[] of dimension (n) Details of the permutations and/or scaling factors applied to the right side of A and B, as returned by dggbal.
        m - input int The number of columns of the matrix V. m >= 0.
        V - (input/output) double[][] of dimension (ldv,m) On entry, the matrix of right or left eigenvectors to be transformed, as returned by dtgevc. On exit, V is overwritten by the transformed eigenvectors.
        ldv - input int The leading dimension of the matrix V. ldv >= max(1,n).
        info - output int[] = 0: successful exit, < 0: If info[0] = -i, the i-th argument had an illegal value. Further Details: See R. C. Ward, Balancing the generalized eigenvalue problem, SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
      • dggbal

        private void dggbal​(char job,
                            int n,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            int[] ilo,
                            int[] ihi,
                            double[] lscale,
                            double[] rscale,
                            double[] work,
                            int[] info)
        This is a port of the version 3.1 LAPACK routine DGGBAL Original DGGBAL created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dggbal balances a pair of general real matrices (A,B). This involves, first, permuting A and B by similarity transformations to isolate eigenvalues in the first 1 to ilo-1 and last ihi+1 to n elements on the diagonal; and second, applying a diagonal similarity transformation to rows and columns ilo to ihi to make the rows and columns as close in norm as possbile. Both steps are optional.

        Balancing may reduce the 1-norm of the matrices, and improve the accuracy of the computed eigenvalues and/or eigenvectors in the generalized eigenvector problem A*x = lambda*B*x.

        Parameters:
        job - input char Specifies the operations to be performed on A and B: = 'N': none: simply set ilo = 1, ihi = n, lscale[i] = 1.0 and rscale[i] = 1.0 for i = 0,...,n-1. = 'P': permute only = 'S': scale only = 'B': both permute and scale.
        n - input int The order of matrices A and B. n >= 0.
        A - input/output double[][] of dimension (lda,n) On entry, the input matrix A. On exit, A is overwritten by the balanced matrix. If job = 'N', A is not referenced.
        lda - input int The leading dimension of the array A. lda >= max(1,n).
        B - input/output double[][] of dimension (ldb,n) On entry, the input matrix B. On exit, B is overwritten by the balanced matrix. If job = 'N', B is not referenced.
        ldb - input int The leading dimension of the array B. ldb >= max(1,n).
        ilo - output int[]
        ihi - output int[] ilo and ihi are set to integers such that on exit A[i][j] = 0 and B[i][j] = 0 if i > j and j = 0,...,ilo-2 and i = ihi,...,n-1. if job = 'N' or 'S', ilo = 1 and ihi = n.
        lscale - output double[] of dimension n Details of the permutations and scaling factors applied to the left side of A and B. If p[j] is the index of the row interchanged with row j, and d[j] is the scaling factor applied to row j, then lscale[j] = p[j] for j = 0,...,ilo-2 = d[j] for j = ilo-1,...,ihi-1 = p[j] for j = ihi,...,n-1. The order in which the interchanges are made is n-1 to ihi, then 0 to ilo-2.
        rscale - output double[] of dimension n Details of the permutations and scaling factors applied to the right side of A and B. If p[j] is the index of the column interchanged with column j, and d[j] is the scaling factor applied to column j, then rscale[j] = p[j] for j = 0,...,ilo-2 = d[j] for j = ilo-1,...,ihi-1 = p[j] for j = ihi,...,n-1. The order in which the interchanges are made is n-1 to ihi, then 0 to ilo-2.
        work - workspace double[] of dimension lwork lwork must be at least max(1,6*n) when job = 'S' or 'B', and at least 1 when job = 'N' or 'P'.
        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value. Further details: See R.C. Ward, Balancing the generalized eigenvalue problem, SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
      • dgghrd

        private void dgghrd​(char compq,
                            char compz,
                            int n,
                            int ilo,
                            int ihi,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            double[][] Q,
                            int ldq,
                            double[][] Z,
                            int ldz,
                            int[] info)
        This is a port of version 3.1 LAPACK routine DGGHRD Original DGGHRD created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dgghrd reduces a pair of real matrices (A,B) to generalized upper Hessenberg form using orthogonal transformations, where A is a general matrix and B is upper triangular. The form of the generalized eigenvalue problem is A*x = lambda*B*x and B is typically made upper triangular by computing its QR factorization and moving the orthogonal matrix Q to the left side of the equation.

        This subroutine simultaneously reduces A to a Hessenberg matrix H: Q**T * A * Z = H and transforms B to another upper triangular matrix T: Q**T * B * Z = T in order to reduce the problem to its standard form H*y = lambda*T*y where y = z**T * x

        The orthogonal matrices Q and Z are determined as products of Givens rotations. They may either be formed explicitly, or they may be postmultiplied into input matrices Q1 and Z1, so that Q1 * A * Z1**T = (Q1*Q) * H * (Z1*Z)**T Q1 * B * Z1**T = (Q1*Q) * T * (Z1*Z)**T

        If Q1 is the orthogonal matrix from the QR factorization of B in the original equation A*x = lambda*b*x, then dgghrd reduces the original problem to the generalized Hessenberg form.

        Parameters:
        compq - input char = 'N': do not compute Q = 'I': Q is initialized to the unit matrix, and the orthogonal matrix Q is returned = 'V': Q must contain an orthogonal matrix Q1 on entry, and the product Q1*Q is returned
        compz - input char = 'N': do not compute Z = 'I': Z is initialized to the unit matrix, and the orthogonal matrix Z is returned = 'V': Z must contain an orthogonal matrix Z1 on entry, and the product Z1*Z is returned
        n - input int The order of the matrices A and B. n >= 0.
        ilo - input int
        ihi - input int ilo and ihi mark the rows and columns of A which are to be reduced. It is assumed that A is already upper triangular in rows and columns 0:ilo-2 and ih:n-1. ilo and ihi are normally set by a previous call to dggbal; otherwise they should be set to 1 and n respectively. 1 <= ilo <= ihi <= n, if n > 0; ilo = 1 and ihi = 0, if n == 0.
        A - input/output double[][] of dimension (lda,n) On entry, the n by n general matrix to be reduced. On exit, the upper triangle and the first subdiagonal of A are overwritten with the upper Hessenberg matrix H, and the rest is set to zero.
        lda - input int The leading dimension of the array A. lda >= max(1,n).
        B - input/output double[][] of dimension (ldb,n) On entry, the n by n upper triangular matrix B. On exit, the upper triangular matrix T = Q**T B Z. The elements below the diagonal are set to zero.
        ldb - input int The leading dimension of the array B. ldb >= max(1,n).
        Q - input/output double[][] of dimension (ldq,n). On entry, if compq = 'V', the orthogonal matix Q1, typically from the QR factorization of B. On exit, if compq = 'I', the orthogonal matrix Q, and if compq = 'V', the product Q1*Q. Not referenced if compq = 'N'.
        ldq - input int The leading dimension of the array Q. ldq >= n if compq = 'V' or 'I'; ldq >= 1 otherwise.
        Z - input/output double[][] of dimension (ldz,n) On entry, if compz = 'V', the orthogonal matrix Z1. On exit, if compz = 'I', the orthogonal matrix Z, and if compz = 'V', the product Z1*Z. Not referenced if compz = 'N'.
        ldz - input int The leading dimension of the array Z. ldz >= n if compz = 'V' or 'I'; ldz >= 1 otherwise.
        info - output int[] = 0: successful exit. < 0: If info = -i, the i-th argument had an illegal value. Further details: This routine reduces A to Hessenberg and B to triangular form by an unblocked reduction, as described in Matrix Computations by Golub and Van Loan (Johns Hopkins Press).
      • dhgeqz

        private void dhgeqz​(char job,
                            char compq,
                            char compz,
                            int n,
                            int ilo,
                            int ihi,
                            double[][] H,
                            int ldh,
                            double[][] T,
                            int ldt,
                            double[] alphar,
                            double[] alphai,
                            double[] beta,
                            double[][] Q,
                            int ldq,
                            double[][] Z,
                            int ldz,
                            double[] work,
                            int lwork,
                            int[] info)
        This is a port of version 3.1 LAPACK routine DHGEQZ Original DHGEQZ created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dhgeqz computes the eigenvalues of a real matrix pair (H,T), where H is an upper Hessenberg matrix and T is upper triangular, using the double-shift QZ method. Matrix pairs of this type are produced by the reduction to generalized upper Hessenberg form of a real matrix pair (A, B); A = Q1*H*Z**T, B = Q1*T*Z1**T, as computed by dgghrd.

        If job = 'S', then the Hessenberg-triangular pair (H,T) is also reduced to generalized Schur form, H = Q*S*Z**T, T = Q*P*Z**T, where Q and Z are orthogonal matrices, P is an upper triangular matrix, and S is a quasi-triangular matrix with 1-by-1 and 2-by-2 diagonal blocks.

        The 1-by-1 blocks correspond to real eigenvalues of the matrix pair (H, T) and the 2-by-2 blocks correspond to complex conjugate pairs of eigenvalues.

        Additionally, the 2-by-2 upper triangular diagonal blocks of P corresponding to 2-by-2 blocks of S are reduced to positive diagonal form, i.e., if (S(j+1,j) is non-zero, then P(j+1,j) = P(j,j+1) = 0, P(j,j) > 0, and P(j+1,j+1) > 0.

        Optionally, the orthogonal matrix Q from the generalized Schur factorization may be postmultiplied into an input matrix Q1, and the orthogonal matrix Z may be postmultiplied into an input matrix Z1. If Q1 and Z1 are the orthogonal matrices from dgghrd that reduced the matrix pair (A,B) to generalized upper Hessenberg form, then the output matrices Q1*Q and Z1*Z are the orthogonal factors from the generalized Schur factorization of (A,B): A = (Q1*Q)*S*(Z1*Z)**T, B = (Q1*Q)*P*(Z1*Z)**T.

        To avoid overflow, eignevalues of the matrix pair (H,T) (equivalently, of (A,b)) are computed as a pair of values (alpha, beta), where alpha is complex and beta real. If beta is nonzero, lambda = alpha / beta is an eigenvalue of the generalized nonsymmetric eigenvalue problem (GNEP) A*x = lambda*B*x and if alpha is nonzero, mu = beta / alpha is an eigenvalue fo the alternate form of the GNEP mu*A*y = B*y Real eigenvalues can be read directly from the generalized Schur form: alpha = S(i,i), beta = P(i,i)

        Ref: C.B. Moler & G.W. Stewart, "An Algorithm for Generalized Matrix Eigenvalue Problems", SIAM J. Numer. Anal., 10(1973), pp. 241- 256.

        Parameters:
        job - input char = 'E': Compute eigenvalues only = 'S': Compute eigenvalues and the Schur form.
        compq - input char = 'N': Left Schur vectors (Q) are not computed. = 'I': Q is initialized to the unit matrix and the matrix Q of left Schur vectors of (H,T) is returned. = 'V': Q must contain an orthogonal matrix Q1 on entry and the product Q1*Q is returned.
        compz - input char = 'N': Right Schur vectors (Z) are not computed. = 'I': Z is initialized to the unit matrix and the matrix Z of right Schur vectors of (H,T) is returned. = 'V': Z must contain an orthogonal matrix Z1 on entry and the product Z1*Z is returned.
        n - input int The order of matrices H, T, Q, and Z. n >= 0.
        ilo - input int
        ihi - input int ilo and ihi mark the rows and columns of H which are in Hessenberg form. It is assumed that A is already upper triangular in rows and columns 0:ilo-2 and ihi:n-1. If n > 0, 1 <= ilo <= ihi <= n; if n = 0, ilo = 1 and ihi = 0.
        H - (input/output) double[][] of dimension (ldh,n) On entry, the n by n upper Hessenberg matrix H. On exit, if job = 'S', H contains the upper quasi-triangluar matrix S from the generalized Schur factorization; 2-by-2 diagonal blocks (corresponding to complex conjugate pairs of eigenvalues) are returned in standard form, with H(i,i) = H(i+1,i+1) and H(i+1,i) * H(i,i+1) < 0. if job = 'E', the diagonal blocks of H match those of S, but the rest of H is unspecified
        ldh - input int The leading dimension of the array H. ldh >= max(1, n).
        T - (input/output) double[][] of dimension (ldt,n) On entry, the n by n upper triangular matrix T. On exit, if job = 'S', T contains the upper triangular matrix P from the generalized Schur factorization; 2-by-2 diagonal blocks of P corresponding to 2-by-2 blocks of S are reduced to postive diagonal form, i.e., if H(j+1,j) is non-zero, then T(j+1,j) = T(j,j+1) = 0, T(j,j) > 0, and T(j+1,j+1) > 0. if job = 'E', the diagonal blocks of T match those of P, but the rest of T is unspecified.
        ldt - input int The leading dimension of the array T. ldt >= max(1,n).
        alphar - output double[] of dimension (n) The real parts of each scalar alpha definfing an eigenvalue of GNEP.
        alphai - output double[] of dimension (n) The imaginary parts of each scalar alpha defining an eigenvalue of GNEP. If alphai[j] is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with alpha(j+1) = -alpha(j).
        beta - output double[] of dimension (n) The scalars beta that define the eigenvalues of GNEP. Together, the quantities alpha = (alphar[j], alphai[j]) and beta = beta[j] represent the j-th eigenvalue of the matrix pair (A,B), in one of the forms lambda = alpha/beta or mu = beta/alpha. Since either lambda or mu may overflow, they should not, in general, be computed.
        Q - (input/output) double[][] of dimension (ldq,n) On entry, if compz = 'V', the orthogonal matrix Q1 is used in the reduction of (A,B) to generalized Hessenberg form. On exit, if compz = 'I', the orthogonal matrix of left Schur vectors of (H,T), and if compz = 'V', the orthogonal matrix of left Schur vectors of (A,B). Not referenced if compz = 'N'.
        ldq - input int The leading dimension of the array Q. ldq >= 1. If compq = 'V' or 'I', then ldq >= n.
        Z - (input/output) double[][] of dimension (ldz,n) On entry, if compz = 'V', the orthogonal matrix Z1 is used in the reduction of (A,B) to generalized Hessenberg form. On exit, if compz = 'I', the orthogonal matrix of right Schur vectors of (H,T), and if compz = 'V', the orthogonal matrix of right Schur vectors of (A,B). Not referenced if compz = 'N'.
        ldz - input int The leading dimension of the array Z. ldz >= 1. If compz = 'V' or 'I', then ldz >= n.
        work - (workspace/output) double[] of dimension max(1,lwork) On exit, if info[0] >= 0, work[0] returns the optimal lwork.
        lwork - input int The dimension of the array work. lwork >= max(1,n). 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 output.
        info - output int[] = 0: successful exit. < 0: If info[0] = -i, the i-th argument had an illegal value = 1,...,n: the QZ iteration did not converge. (H,T) is not in Schur form, but alphar[i], alphai[i], and beta[i], i = info,...,n-1 should be correct. = n+1,...,2*n: the shift calculation failed. (H,T) is not in Schur form, but alphar[i], alphai[i], and beta[i], i = info-n,...,n-1 should be correct
      • dlabad

        public void dlabad​(double[] small,
                           double[] large)
        This is a port of the version 3.2 LAPACK auxiliary routine DLABAD Original DLABAD created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlabad takes as input the values computed by dlamch for underflow and overflow, and returns the square root of each of these values if the log of large is sufficiently big. This routine is intended to identify machines with a large exponent range, such as the Crays, and redefine the underflow and overflow limits to be the square roots fo the values computed by dlamch. This subroutine is needed because dlamch does not compensate for poor arithmetic in the upper half of the exponent range, as is found on a Cray.
        Parameters:
        small - input/ouptut double[] On entry, the underflow threshold as computed by dlamch. On exit, if log10(large) is sufficiently large, the square root of small, otherwise unchanged.
        large - input/output double[] On entry, the overflow threshold as computed by dlamch. On exit, if log10(large) is sufficiently large, the square root of large, otherwise unchanged.
      • dlacpy

        public void dlacpy​(char uplo,
                           int m,
                           int n,
                           double[][] A,
                           int lda,
                           double[][] B,
                           int ldb)
        This is a port of LAPACK version 3.2 auxiliary routine DLACPY. Original DLACPY created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlacpy copies all or part of a two-dimensional matrix A to another matrix B.
        Parameters:
        uplo - input char Specifies the part of the matrix A to be copied to B. = 'U': Upper triangular part = 'L': Lower triangular part Otherwise: All of the matrix A
        m - input int The number of rows of the matrix A. m >= 0.
        n - input int The number of columns of the matrix A. n >= 0.
        A - input double[][] of dimension (lda,n). Has m by n matrix A. If uplo = 'U', only the upper triangle or trapezoid is accessed; if uplo = 'L', only the lower triangle or trapezoid is accessed.
        lda - input int The leading dimension of the array A. lda >= max(1,m).
        B - output double[][] of dimension (ldb,n). On exit, B = A in the locations specified by uplo.
        ldb - input int The leading dimension of the array B. ldb >= max(1,m).
      • dladiv

        public void dladiv​(double a,
                           double b,
                           double c,
                           double d,
                           double[] p,
                           double[] q)
        This is a port of version 3.7.0 LAPACK auxiliary routine DLADIV Original DLADIV created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., Januaary, 2013 dladiv performs complex division in real arithmetic p + i*q = (a + i*b) / (c + i*d) The algorithm is due to Michael Baudin and RObert L. Smith and can be found in the paper "A Robust Complex Division in Scilab".
        Parameters:
        a - input double
        b - input double
        c - input double
        d - input double
        p - output double[]
        q - output double[]
      • dladiv1

        private void dladiv1​(double a,
                             double b,
                             double c,
                             double d,
                             double[] p,
                             double[] q)
        LAPACK auxiliary routine (version 3.7.0) LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd, January, 2013.
        Parameters:
        a -
        b -
        c -
        d -
        p -
        q -
      • dladiv2

        private double dladiv2​(double a,
                               double b,
                               double c,
                               double d,
                               double r,
                               double t)
        LAPACK auxiliary routine version 3.7.0 LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd, January, 2013.
        Parameters:
        a -
        b -
        c -
        d -
        r -
        t -
        Returns:
      • dlae2

        public void dlae2​(double a,
                          double b,
                          double c,
                          double[] rt1,
                          double[] rt2)
        This is a port of the version 3.1 LAPACK auxiliary routine DLAE2 Original DLAE2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlae2 computes the eigenvalues of a 2-by-2 symmetric matrix [ A B ] [ B C ] On return, rt1[0] is the eigenvalue of the larger absolute value, and rt2[0] is the eigenvalue of the smaller absolute value.
        Parameters:
        a - input double The 0,0 element of the 2-by-2 matrix.
        b - input double The 0,1 and 1,0 elements of the 2-by-2 matrix.
        c - input double The 1,1 element of the 2-by-2 matrix.
        rt1 - output double[] The eigenvalue of the larger absolute value.
        rt2 - output double[] The eigenvalue of the smaller absolute value. Further Details: rt1 is accurate to a few ulps barring over/underflow. rt2 may be inaccurate if there is massive cancellation in the determinant A*C - B*B; higher precision or correctly rounded or correctly truncated arithmetic would be needed to compute rt2 accurately in all cases. Overflow is possible only if rt1 is within a factor of 5 of overflow. Underflow is harmless if the input data is 0 or exceeds underflow_threshold / macheps.
      • dlaev2

        public void dlaev2​(double a,
                           double b,
                           double c,
                           double[] rt1,
                           double[] rt2,
                           double[] cs1,
                           double[] sn1)
        This is a port of version 3.1 LAPACK auxiliary routine DLAEV2 Original DLAEV2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlaev2 computes the eigendecomposition of a 2-by-2 symmetric matrix [ a b ] [ b c ] On return rt1[0] is the eigenvalue of the larger absolute value, rt2[0] is the eigenvalue of the smaller absolute value, and (cs1, sn1) is the unit right eigenvector for rt1[0], giving the decomposition [ cs1 sn1 ] [ a b ] [cs1 -sn1] = [rt1 0 ] [-sn1 cs1 ] [ b c ] [sn1 cs1] [ 0 rt2]
        Parameters:
        a - input double The (0,0) element of the 2-by-2 matrix
        b - input double The (0,1) element and the conjugate of the (1,0) element of the 2-by-2 matrix.
        c - input double The (1,1) element of the 2-by-2 matrix.
        rt1 - output double[] The eigenvalue of larger absolute value.
        rt2 - output double[] The eigenvalue of smaller absolute value.
        cs1 - output double[]
        sn1 - output double[] The vector (cs1, sn1) is a unit right eigenvector for rt1[0]. Further details: rt1[0] is accurate to a few ulps barring over/underflow. rt2[0] may be inaccurate if there is massive cancellation in the determinant a*c - b*b; higher precision or correctly rounded or correctly truncated arithmetic would be needed to compute rt2[0] accurately in all cases. cs1[0] and sn1[0] are accurate to a few ulps barring over/underflow. Overflow if possible only if rt1[0] is within a factor of 5 of overflow. Underflow is harmless if the input data is 0 or exceeds underflow_threshold/macheps.
      • dlafts

        public void dlafts​(java.lang.String type,
                           int m,
                           int n,
                           int imat,
                           int ntests,
                           double[] result,
                           int[] iseed,
                           double thresh,
                           int[] ie)
        This is a port of the version 3.1 LAPACK auxiliary test routine DLAFTS Original DLAFTS created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlafts tests the result vector against the threshold value to see which tests for this matrix type failed to pass the threshold.
        Parameters:
        type - input String On entry, type specifies the matrix type to be used in the printed messages
        m - input int rows of matrix
        n - input int On entry, n specifies the order the of test matrix. columns of matrix
        imat - input int On entry, imat specifies the type of the test matrix. A listing of the different types is printed by dlahd2 if a test fails to pass the threshold.
        ntests - input int On entry, ntests is the number of tests performed on the subroutines in the path given by type.
        result - input double[] of dimension ntests On entry, result contains the test ratios from the tests performed in the calling program.
        iseed - input int[] of dimension 4. Contains the random seed that generated the matrix used for the tests whose ratios are in result.
        thresh - input double On entry, thresh specifies the acceptable threshold of the test ratios. if result[k-1] > thresh, then the k-th test did not pass the threshold and a message will be printed.
        ie - input/output int[] On entry, ie contains the number of tests which have failed to pass the threshold so far. Updated on exit if any of the ratios in result also fail.
      • dlag2

        private void dlag2​(double[][] A,
                           int lda,
                           double[][] B,
                           int ldb,
                           double safmin,
                           double[] scale1,
                           double[] scale2,
                           double[] wr1,
                           double[] wr2,
                           double[] wi)
        This is a port of the version 3.1 LAPACK auxiliary routine DLAG2 Original DLAG2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlag2 computes eigenvalues of a 2 x 2 generalized eigenvalue problem A - w B, with scaling as necessary to avoid over-/underflow.

        The scaling factor "s" results in a modified eigenvalue equation s A - w B where s is a nonnegative scaling factor chosen so that w, w B, and s A do not overflow and, if possible, do not underflow, either.

        Parameters:
        A - input double[][] of dimension (lda,2) On entry, the 2 x 2 matrix A. It is assumed that its 1-norm is less than 1/safmin. Entries less than sqrt(safmin)*norm(A) are subject to being treated as zero.
        lda - input int The leading dimension of the array A. lda >= 2.
        B - input double[][] of dimension (ldb,2) On entry, the 2 x 2 upper triangular matrix B. It is assumed that the one-norm of B is less than 1/safmin. The diagonals should be at least sqrt(safmin) times the largest element of B (in absolute value); if a diagonal is smaller than that, then +/- sqrt(safmin) will be used instead of that diagonal.
        ldb - input int The leading dimension of the array B. ldb >= 2.
        safmin - input double The smallest positive number such that 1/safmin does not overflow. (This should always be dlamch('S') -- it is an argument in order to avoid having to call dlamch frequently.)
        scale1 - output double[] A scaling factor used to avoid over-/ underflow in the eigenvalue equation which defines the first eigenvalue. If the eigenvalues are complex, then the eigenvalues are (wr1 +/- wi*i)/scale1 (which may lie outside the exponent range of the machine), scale1 = scale2, and scale1 will always be positive. If the eigenvalues are real, then the first (real) eigenvalue is wr1/scale1, but this may overflow or underflow, and in fact, scale1 may be zero or less than the underflow threshold if the exact eigenvalue is sufficiently large.
        scale2 - output double[] A scaling factor used to avoid over-/ underflow in th eigenvalue equation which defines the second eigenvalue. If the eigenvalues are complex, then scale2 = scale1. If the eigenvalues are real, then the second (real) eigenvalue is wr2 / scale2, but this may overflow or underflow, and in fact, scale2 may be zero or less than the underflow threshold if the exact eigenvalue is sufficiently large.
        wr1 - output double[] If the eigenvalue is real, then wr1 is scale1 times the eigenvalue closest to the (1,1) element of A B**(-1). If the eigenvalue is complex, then wr1 = wr2 is scale1 times the real part of the eigenvalues.
        wr2 - output double[] If the eigenvalue is real, then wr2 is scale2 times the other eigenvalue. If the eigenvalue is complex, then wr1 = wr2 is scale1 times the real part of the eigenvalues.
        wi - output double[] If the eigenvalue is real, then wi is 0.0. If the eigenvalue is complex, then wi is scale1 times the imaginary part of the eigenvalues. wi will always be nonnegative.
      • dlagge

        public void dlagge​(int m,
                           int n,
                           int kl,
                           int ku,
                           double[] D,
                           double[][] A,
                           int lda,
                           int[] iseed,
                           double[] work,
                           int[] info)
        This is a port of version 3.1 LAPACK auxiliary test routine DLAGGE Original DLAGGE created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlagge generates a real general m by n matrix A, by pre- and post- multiplying a real diagonal matrix D with random orthogonal matrices: A = U*D*V. The lower and upper bandwidths may then be reduced to kl and ku by additional orthogonal transformations.
        Parameters:
        m - input int The number of rows of the matrix A. m >= 0.
        n - input int The number of columns of the matrix A. n >= 0.
        kl - input int The number of nonzero subdiagonals within the band of A. 0 <= kl <= m-1.
        ku - input int The number of nonzero superdiagonals within the band of A. 0 <= ku <= n-1.
        D - input double[] of dimension (min(m,n)) The diagonal elements of the diagonal matrix D
        A - output double[][] of dimension (lda,n) The generated m by n matrix A.
        lda - input int The leading dimension of the array A. lda >= m.
        iseed - input/output int[] of dimension 4 On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and iseed[3] must be odd. On exit, the seed is updated.
        work - workspace double[] of dimension (m+n)
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument had an illegal value
      • dlagsy

        public void dlagsy​(int n,
                           int k,
                           double[] D,
                           double[][] A,
                           int lda,
                           int[] iseed,
                           double[] work,
                           int[] info)
        This is a port of version 3.1 LAPACK auxiliary test routine dlagsy Original DLAGSY created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlagsy generates a real symmetric matrix A, by pre- and post- multiplying a real diagonal matrix D with a random orthogonal matrix: A = U*D*U'. The semi-bandwidth may then be reduced to k by additional orthogonal transformations.
        Parameters:
        n - input int The order of the matrix A. n >= 0.
        k - input int The number of nonzero subdiagonals within the band of A. 0 <= k <= n-1.
        D - input double[] of dimension n. The diagonal elements of the diagonal matrix D.
        A - output double[][] of dimension (lda,n) The generated n by n symmetric matrix A (the full matrix is stored).
        lda - input int The leading dimension of the array A. lda >= n.
        iseed - input/output int[] of dimension 4 On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and iseed[3] must be odd. On exit, the seed is updated.
        work - workspace double[] of dimension (2*n)
        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value
      • dlahd2

        private void dlahd2​(java.lang.String path)
        Port of some code contained in the version 2.0 LAPACK auxiliary test routine DLAHD2 Original DLAHD2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlahd2 prints header information for the different test paths
        Parameters:
        path - String Name of the path for which the header information is to be printed. DSG real symmetric generalized eigenvalue problem
      • dlaln2

        private void dlaln2​(boolean ltrans,
                            int na,
                            int nw,
                            double smin,
                            double ca,
                            double[][] A,
                            int lda,
                            double d1,
                            double d2,
                            double[][] B,
                            int ldb,
                            double wr,
                            double wi,
                            double[][] X,
                            int ldx,
                            double[] scale,
                            double[] xnorm,
                            int[] info)
        This is a port of version 3.1 LAPACK auxiliary routine DLALN2 Original DLALN2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlaln2 solves a system of the form (ca A - w D) X = s B or (ca A' - w D) X = s B with possible scaling ("s") and perturbation of A. (A' means A-transpose.)

        A is an na by na real matrix, ca is a real scalar, D is an na by na real diagonal matrix, w is a real or complex value, and X and B are na by 1 matrices -- real if w is real, complex if w is complex. na may be 1 or 2.

        If w is complex, X and B are represented as na by 2 matrices, the first column of each being the real part and the second being the imaginary part.

        "s" is a scaling factor (<= 1), computed by dlaln2, which is so chosen that X can be computed without overflow. X is further scaled if necessary to assure that norm(ca A - w D)*norm(X) is less than overflow.

        If both singular values of (ca A - w D) are less than smin, smin*identity will be used instead of (ca A - w D). If only one singular value is less than smin, one element of (ca A - w D) will be perturbed enough to make the smallest singular value roughly smin. If both singular values are at least smin, (ca A - w D) will not be perturbed. In any case, perturbation will be at most some small multiple of max(smin, ulp*norm(ca A - w D) ). The singular values are computed by infinity-norm approximations, and thus will only be correct to a factor of 2 or so.

        Note: All input quantities are assumed to be smaller than overflow by a reasonable factor. (See bignum.)

        Parameters:
        ltrans - input boolean = true: A-transpose will be used. = false: A will be used (not transposed.)
        na - input int The size of the matrix A. It may (only) be 1 or 2.
        nw - input int 1 if "w" is real, 2 if "w" is complex. It may only be 1 or 2.
        smin - input double The desired lower bound on the singular values of A. This should be a safe distance away from underflow or overflow, say, between (underflow/machine precision) and (machine precision * overflow ). (See bignum and ulp.)
        ca - input double The coefficient c, which A is multiplied by.
        A - input double[][] of dimension (lda,na) The na by na matrix A.
        lda - input int The leading dimension of A. It must be at least na.
        d1 - input double The 0,0 element in diagonal matrix D.
        d2 - input double The 1,1 element in the diagonal matrix D. Not used if nw = 1.
        B - input double[][] of dimension (ldb,nw) The na by nw matrix B (right-hand side). If nw = 2 ("w" is complex), column 0 contains the real part of B and column 1 contains the imaginary part.
        ldb - input int The leading dimension of B. It must be at least na.
        wr - input double The real part of the scalar "w".
        wi - input double The imaginary part of the scalar "w". Not used if nw = 1.
        X - output double[][] of dimension (ldx,nw). The na by nw matrix X (unknowns), as computed by dlaln2. If nw = 2 ("w" is complex), on exit, column 0 will contain the real part of X and column 1 will contain the imaginary part.
        ldx - input int The leading dimension of X. It must be at least na.
        scale - output double[] The scale factor that B must be multiplied by to insure that overflow does not occur when computing X. Thus, (ca A - w D) X will be scale*B, not B(ignoring perturbations of A.) It will be at most 1.
        xnorm - output double[] The infinity-norm of X, when X is regarded as an na by nw real matrix.
        info - output int[] An error flag. It will be set to zero if no error occurs, a negative number if an argument is in error, or a positive number if ca A - w D had to be perturbed. The possible values are: = 0: No error occurred, and (ca A - w D) did not have to be perturbed. = 1: (ca A - w D) had to be perturbed to make its smallest (or only) singular value greater than smin. Note: In the interests of speed, this routine does not check the inputs for errors.
      • dlamc1

        private void dlamc1​(int[] beta,
                            int[] t,
                            boolean[] rnd,
                            boolean[] ieee1)
        Port of version 3.2 LAPACK auxiliary routine DLAMC1 Original DLAMC1 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamc1 determines the machine parameters given by beta, t, rnd, and ieee1.
        Parameters:
        beta - output int[] The base of the machine.
        t - output int[] The number of (beta) digits in the mantissa
        rnd - output boolean[] Specifies whether proper rounding (rnd = true) or chopping (rnd = false) occurs in addition. This may not be a reliable guide to the way in which the machine performs its arithmetic.
        ieee1 - output boolean[] Specifies whether rounding appears to be done in the IEEE 'round to nearest' style. This routine is based on the routine ENVRON by Malcolm and incorporates suggestions by Gentleman and Marovich. See Malcolm, M. A. (1972) Algorithms to reveal properties of floating-point arithmetic. Comms. of the ACM, 15, pp. 949-951. Gentleman, W. M. and Marovich S. B. (1974) More on algorithms that reveal properties of floating point arithmetic units. Comms. of the ACM, 17, pp. 276-277.
      • dlamc2

        private void dlamc2​(int[] beta,
                            int[] t,
                            boolean[] rnd,
                            int[] emin,
                            int[] emax)
        Port of LAPACK version 3.2 auxiliary routine DLAMC2 Original DLAMC2 created by Univ. of Tennessee, Univ. of California Berkeley, nad NAG Ltd., November, 2006 Determines machine parameters 3 globals are determined: 1.) eps double The smallest positive number such that computed value(1.0 - eps) < 1.0 2.) rmin double The smallest normalized number for the machine, given by base**(emin - 1), where base is the floating point value of beta. 3.) rmax double The largest positive number for the machine, given by base**emax*(1-eps), where base is the floating point value of beta.
        Parameters:
        beta - output int[] The base of the machine.
        t - output int[] The number of (beta) digits in the mantissa.
        rnd - ouptut boolean Specifies whether proper rounding (rnd == true) or chopping (rnd == false) occurs in addition. This may not be a reliable guide to the way in which the machine performs its arithmetic
        emin - output int[] The minimum exponent before (gradual) underflow occurs
        emax - output int[] The maximum exponent before overflow occurs The computation of EPS is based on a routine PARANOIA by W. Kahan of the University of California at Berkeley.
      • dlamc3

        public double dlamc3​(double a,
                             double b)
        This is a port of the LAPACK version 3.2 auxiliary routine DLAMC3 Original DLAMC3 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamc3 is intended to force a and b to be stored prior to doing the addition of a and b, for use in situations where optimizers might hold one of these in a register
        Parameters:
        a - double
        b - double
        Returns:
        double
      • dlamc4

        private void dlamc4​(int[] emin,
                            double start,
                            int base)
        This is a port of version 3.2 LAPACK auxiliary routine DLAMC4 Original DLAMC4 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamc4 is a service routine for dlamc2
        Parameters:
        emin - output int[] The minimum exponent before (gradual) underflow, computed by setting a = start and dividing by base until the previous a cannot be recovered
        start - input double The starting point for determining emin.
        base - input int The base of the machine.
      • dlamc5

        private void dlamc5​(int beta,
                            int p,
                            int emin,
                            boolean ieee,
                            int[] emax,
                            double[] rmax)
        This is a port of the version 3.2 LAPACK auxiliary routine DLAMC5 Original DLAMC5 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamc5 attempts to compute rmax, the largest machine floating-point number, without overflow. It assumes that emax + abs(emin) sum approximately to a power of 2. It will fail on machines where this assumption does not hold, for example, the Cyber 205 (emin = -28625, emax = 28718). It will also fail if the value supplied for emin is too large (i.e. too close to zero), probably with overflow
        Parameters:
        beta - input int The base of floating-point arithmetic.
        p - input int The number of base beta digits in the mantissa of a floating-point value.
        emin - input int The minimum exponent before (gradual) underflow.
        ieee - input boolean A logical flag specifying whether or not the arithmetic system is thought to comply with the IEEE standard.
        emax - output int[] The largest exponent before overflow.
        rmax - output double[] The largest machine floating-point number.
      • dlamch

        public double dlamch​(char cmach)
        This is a port of the version 3.2 LAPACK auxiliary routine DLAMCH Original DLAMCH created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlamch determines double precision machine parameters.
        Parameters:
        cmach - input char Specifies the value to be returned by dlamch = 'E' or 'e', returns eps, relative machine precision = 'S' or 's', returns sfmin, safe minimum, such that 1/sfmin does not overflow = 'B' or 'b', returns base, base of the machine = 'P' or 'p', returns prec = eps*base = 'N' or 'n', returns t, number of (base) digits in the mantissa = 'R' or 'r', returns rnd = 1.0 when rounding occurs in addition, 0.0 otherwise = 'M' or 'm', returns emin, minimum exponent before (gradual) underflow = 'U' or 'u', returns rmin, underflow threshold = base**(emin-1) = 'L' or 'l', emax, largest exponent before overflow = 'O' or 'o', rmax, overflow threshold = (base**emax)*(1-eps)
        Returns:
        double
      • dlangb

        public double dlangb​(char norm,
                             int n,
                             int kl,
                             int ku,
                             double[][] ab,
                             int ldab,
                             double[] work)
        This is a port of version 3.2 LAPACK auxiliary routine DLANGB Original DLANGB created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlangb returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of an n by n band matrix A, with kl sub-diagonals and ku super-diagonals.
        Parameters:
        norm - input char Specifies the value to be returned as: = 'M' or 'm', returns max(abs(A[i][j])), which is not a matrix norm. = '1', 'O', or 'o', returns norm1(A), where norm1 denotes the one norm of a matrix (maximum column sum) = 'I' or 'i', returns normI(A), the infinity norm of a matrix (maximum row sum) = 'F', 'f', 'E', or 'e', returns normF(A), the Frobenius norm of a matrix (square root of sum of squares)
        n - input int The order of the matrix A. n >= 0. When n = 0, dlangb returns zero.
        kl - input int The number of sub-diagonals of the matrix A. kl >= 0.
        ku - input int The number of super-diagonals of the matrix A. ku >= 0.
        ab - input double[][] of dimension (ldab,n) The band matrix A, stored in rows 0 to kl + ku. The j-th column of A is stored in the j-th column of the array ab as follows: ab[ku+1+i-j][j] = A[i][j] for max(0,j-ku) <= i <= min(n-1,j+kl)
        ldab - input int The leading dimension of the array ab. ldab >= kl + ku + 1
        work - workspace double[] of dimension max(1, lwork), where lwork >= n when norm = 'I'; otherwise work is notreferenced.
        Returns:
        double
      • dlange

        public double dlange​(char norm,
                             int m,
                             int n,
                             double[][] A,
                             int lda,
                             double[] work)
        This is a port of the version 3.2 LAPACK auxiliary routine DLANGE Original DLANGE created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlange returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of the largest absolute value of a real matrix A.
        Parameters:
        norm - input char Specifies the value to be returned from dlange as: = 'M' or 'm' returns max(abs(A[i][j])). Note that this is not a matrix norm. = '1', 'O' or 'o' returns norm1(A), where norm1 denotes the one norm of a matrix (maximum column sum) = 'I' or 'i' returns normI(A), where normI denotes the infinity norm of a matrix (maximum row sum) = 'F', 'f', 'E', or 'e' returns normF(A), where normF denotes the Frobenius norm of a matrix (square root of sum of squares).
        m - input int The number of rows of the matrix A. m >= 0. When m = 0, dlange returns zero.
        n - input int The number of columns of the matrix A. n >= 0. When n = 0, dlange returns zero.
        A - input double[][] array of dimension (lda,n). Contains the m by n matrix A.
        lda - input int The leading dimension of the array A. lda >= max(1,m).
        work - workspace double[] of dimension max(1, lwork), where lwork >= m when norm = 'I'; otherwise, work is not referenced.
        Returns:
        double
      • dlanhs

        public double dlanhs​(char norm,
                             int n,
                             double[][] A,
                             int lda,
                             double[] work)
        This is a port the the version 3.1 LAPACK auxiliary routine DLANHS Original DLANHS created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlanhs returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hessenberg matrix A.
        Parameters:
        norm - norm char Specifies the value to be returned in dlanhs as: = 'M' or 'm', max(abs(A[i][j])), which is not a matrix norm = '1', 'O', or 'o', norm1(A), the one norm of a matrix (maximum column sum) = 'I' or 'i', normI(A), the infinity norm of a matrix (maximum row sum) = 'F', 'f', 'E', or 'e', normF(A), the Frobenius norm of a matrix (square root of sum of squares)
        n - input int The order of the matrix A. n >= 0. When n = 0, dlanhs returns 0.0.
        A - input double[][] of dimension (lda,n) The n by n upper Hessenberg matrix A; the part of A below the first subdiagonal is not referenced.
        lda - input int The leading dimension of the array A. lda >= max(n,1).
        work - workspace double[] of dimension max(1, lwork) where lwork >= n when norm = 'I'; otherwise, work is not referenced.
        Returns:
        double
      • dlansb

        public double dlansb​(char norm,
                             char uplo,
                             int n,
                             int k,
                             double[][] ab,
                             int ldab,
                             double[] work)
        This is a port of version 3.2 LAPACK auxiliary routine DLANSB Original DLANSB created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlansb retruns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of an n by n symmetric band matrix A, with k super-diagonals.
        Parameters:
        norm - input char Specifies the value to be returned as: = 'M' or 'm', returns max(abs(A[i][j])), which is not a matrix norm = '1', 'O', or 'o', returns norm1(A), the one norm of a matrix (maximum column sum) = 'I' or 'i', returns normI(A), the inifinity norm of a matrix (maximum row sum) = 'F', 'f', 'E', or 'e', returns normF(A), the Frobenius norm of a matrix (square root of sum of squares)
        uplo - input char Specifies whether the upper or lower triangular part of the band matrix A is supplied = 'U': Upper triangular part is supplied. = 'L': Lower triangular part is supplied.
        n - input int The order of the matrix A. n >= 0. When n = 0, dlansb returns zero.
        k - input int The number of super-diagonals or sub-diagonals of the band matrix A. k >= 0.
        ab - input double[][] of dimension (ldab,n) The upper or lower triangle of the symmetric band matrix A, stored in the first k+1 rows of ab. The j-th column of A is stored in the j-th column of the array ab as follows: If uplo = 'U', ab[k+1+i-j][j] = A[i][j] for max(0,j-k) <= i <= j If uplo = 'L', ab[1+i-j][j] = A[i][j] for j <= i <= min(n-1,j+k)
        ldab - input int The leading dimension of array ab. ldab >= k + 1.
        work - workspace double[] of dimension max(1, lwork), where lwork >= n when norm = 'I' or '1' or 'O'; otherwise, work is not referenced.
        Returns:
        DOCUMENT ME!
      • dlansp

        public double dlansp​(char norm,
                             char uplo,
                             int n,
                             double[] ap,
                             double[] work)
        This is a port of the version 3.2 LAPACK auxiliary routine DLANSP Original DLANSP created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlansp returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric matrix A, supplied in packed form.
        Parameters:
        norm - input char Specifies the value to be returned as: = 'M' or 'm' , max(abs(A[i,j])) Note that this is not a matrix norm. = '1', 'O', or 'o', norm1(A) where norm1 denotes the one norm of a matrix (maximum column sum) = 'I' or 'i', normI(A) where normI denotes the infinity norm of a matrix (maximum row sum) = 'F', 'f', 'E', or 'e', normF(A) where normF denotes the Frobenius norm of a matrix (square root of sum of squares)
        uplo - input char Specifies whether the upper or lower triangular part of the symmetric matrix A is supplied. = 'U': Upper triangular part of A is supplied = 'L': Lower triangular part of A is supplied
        n - input int The order of the matrix A. n >= 0. When n = 0, dlansp is set to zero.
        ap - input double[] of dimension (n*(n+1)/2) The upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows: If uplo = 'U', ap[i + (j-1)*j/2] = A[i][j] for 0 <= i <= j If uplo = 'L', ap[i + (j-1)*(2n-j)/2] = A[i][j] for j <= i <= n-1.
        work - workspace double[] of dimension max(1, lwork), where lwork >= n when norm = 'I' or '1' or 'O'; otherwise work is not referenced.
        Returns:
        double
      • dlanst

        public double dlanst​(char norm,
                             int n,
                             double[] d,
                             double[] e)
        This is a port of version 3.1 LAPACK auxiliary routine DLANST Original DLANST created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlanst returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of the largest absolute value of a real symmetric tridiagonal matrix A
        Parameters:
        norm - input char Specifies the value to be returned as: = 'M' or 'm', max(abs(A[i][j])). This is not a matrix norm. = '1', 'O', or 'o', norm1(A), the one norm of a matrix (maximum column sum). = 'I' or 'i', normI(A), the infinity norm of a matrix (maximum row sum). = 'F', 'f', 'E', or 'e', normF(A), the Frobenius norm of a matrix (square root of sum of squares).
        n - input int The order of the matrix A. n >= 0. When n = 0, zero is returned.
        d - input double[] of dimension n. The diagonal elements of A.
        e - input double[] of dimension n-1. The (n-1) sub-diagonal or super-diagonal elements of A.
        Returns:
        double
      • dlansy

        public double dlansy​(char norm,
                             char uplo,
                             int n,
                             double[][] A,
                             int lda,
                             double[] work)
        This is a port of the version 3.2 LAPACK auxiliary routine DLANSY. Original DLANSY created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlansy returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric matrix A.
        Parameters:
        norm - input char Specifies the value to be returned by dlansy as follows: = 'M' or 'm', max(abs(A[i][j])); this is not a matrix norm. = '1', 'O', or 'o', norm1(A), where norm1 denotes the one norm of a matrix (maximum column sum) = 'I' or 'i', normI(A), where normI denotes the infinity norm of a matrix (maximum row sum) = 'F', 'f', 'E', or 'e', normF(A) , where normF denotes the Frobenius norm of a matrix (square root of sum of squares)
        uplo - input char Specifies whether the upper or lower triangular part of the symmetric matrix A is to be referenced. = 'U': Upper triangular part of A is referenced = 'L': Lower triangular part of A is referenced
        n - input int The order of the matrix A. n >= 0. When n = 0, the answer returned by dlansy is zero.
        A - input double[][] of dimension lda by n. The symmetric matrix A. If uplo = 'U', the leading n by n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo = 'L', the leading n by n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
        lda - input int The leading dimension of the array A. lda >= max(n,1).
        work - workspace double[] of dimension max(1, lwork), where lwork >= n when used with one norm or infinity norm; otherwise work is not referenced.
        Returns:
        double
      • dlapy2

        public double dlapy2​(double x,
                             double y)
        This is a port of the version 3.2 LAPACK auxiliary routine DLAPY2 Original DLAPY2 created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlapy2 returns sqrt(x**2 + y**2), taking care not to cause unnecessary overflow.
        Parameters:
        x - input double
        y - input double
        Returns:
        double
      • dlapy3

        private double dlapy3​(double x,
                              double y,
                              double z)
        dlapy3 is a port of hte version 3.1 LAPLACK auxiliary routine DLAPY3 Original DLAPY3 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlapy3 returns sqrt(x**2+y**2+z**2), taking care not to cause unnecessary overflow.
        Parameters:
        x - input double
        y - input double
        z - input double
        Returns:
        double
      • dlaran

        public double dlaran​(int[] iseed)
        This is a port of version 3.1 LAPACK auxiliary routine DLARAN Original DLAAN created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlaran returns a random real number from a uniform (0,1) distribution This routine uses a multiplicative congruential method with modulus 2**48 and multiplier 33952834046453 (see G. S. Fishman, "Multiplicative congruential random number generators with modulus 2**b: an exhaustive analysis for b = 32 and a partial analysis for b = 48", Math. Comp. 189, pp. 331-344, 1990).

        48-bit integers are stored in 4 integer array elements with 12 bits per element. Hence the routine is portable across machines with integers of 32 bits or more.

        Parameters:
        iseed - (input/output) int[] of dimension 4. On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and iseed[3] must be odd. On exit, the seed is updated.
        Returns:
        double
      • dlarf

        public void dlarf​(char side,
                          int m,
                          int n,
                          double[] v,
                          int incv,
                          double tau,
                          double[][] C,
                          int ldc,
                          double[] work)
        This is a port of the version 3.2 LAPACK auxiliary routine DLARF Original DLARF created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarf applies a real elementary reflector H to a real m by n matrix C, from either the left or right. H is represented in the form H = I - tau * v * v' where tau is a real scalar and v is a real vector. If tau = 0, then H is taken to be the unit matrix.
        Parameters:
        side - input char = 'L': form H * C, = 'R': form C * H
        m - input int The number of rows of the matrix C
        n - input int The number of columns of the matrix C.
        v - input double[] If side = 'L' dimension = (1 + (m-1)*abs(incv)) If side = 'R' dimension = (1 + (n-1)*abs(incv)) The vector v in the representation of H. v is not used if tau = 0.
        incv - input int The increment between elements of v. incv <> 0.
        tau - input double The value of tau in the representation of H.
        C - input/output double[][] of dimension ldc by n. On entry, the m by n matrix C. On exit, C is overwritten by the matrix H * C if side = 'L', or C * H if side = 'R'.
        ldc - input int The leading dimension of array C. ldc >= max(1,m).
        work - workspace double[] If side = 'L', dimension = n. If side = 'R', dimension = m.
      • iladlc

        private int iladlc​(int m,
                           int n,
                           double[][] A,
                           int lda)
        This is a port of LAPACK auxiliary routine (version 3.2.1) ILADLC, April 2009 Original ILADLC created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd. iladlc scans A for its last non-zero column
        Parameters:
        m - input int The number of rows in matrix A.
        n - input int The number of columns in matrix A.
        A - input double[][] of dimension lda by n. The m by n matrix A.
        lda - input int The leading dimension of the array A. lda >= max(1, m)
      • iladlr

        private int iladlr​(int m,
                           int n,
                           double[][] A,
                           int lda)
        This is a port of LAPACK auxiliary routine (version 3.2.1) ILADLR, April 2009 Original ILADLR created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd. iladlc scans A for its last non-zero column
        Parameters:
        m - input int The number of rows in matrix A.
        n - input int The number of columns in matrix A.
        A - input double[][] of dimension lda by n. The m by n matrix A.
        lda - input int The leading dimension of the array A. lda >= max(1, m)
      • dlarfb

        public void dlarfb​(char side,
                           char trans,
                           char direct,
                           char storev,
                           int m,
                           int n,
                           int k,
                           double[][] V,
                           int ldv,
                           double[][] T,
                           int ldt,
                           double[][] C,
                           int ldc,
                           double[][] work,
                           int ldwork)
        This is a port of version 3.2 LAPACK auxiliary routine DLARFB Original DLARFB created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarfb applies a real block reflector H or its transpose H' to a real m by n matrix C, from either the left or the right.
        Parameters:
        side - input char = 'L': apply H or H' from the left = 'R': apply H or H' from the right
        trans - input char = 'N': Apply H (No transpose) = 'T': Apply H' (Transpose)
        direct - input char Indicates how H is formed from a product of elementary reflectors = 'F': H = H[0] H[1] ... H[k-1] (Forward) = 'B': H = H[k-1] ... H[1] H[0] (Backward)
        storev - input char Indicates how the vectors which define the elementary reflectors are stored: = 'C': Columnwise = 'R': Rowwise
        m - input int The number of rows of the matrix C.
        n - input int The number of columns of the matrix C.
        k - input int The order of the matrix T (= the number of elementary reflectors whose product defines the block reflector).
        V - input double[][] If storev = 'C', dimensions are ldv by k. If storev = 'R' and side = 'L', dimensions are ldv by m. If storev = 'R' and side = 'R', dimensions are ldv by n.
        ldv - input int The leading dimension of the array V. If storev = 'C' and side = 'L', ldv >= max(1,m). If storev = 'C' and side = 'R', ldv >= max(1,n). If storev = 'R', ldv >= k.
        T - input double[][] of dimensions ldt by k The triangular k by k matrix T in the representation of the block reflector.
        ldt - input int The leading dimension of the array T. ldt >= k.
        C - input/output double[][] of dimensions ldc by n. On entry, the m by n matrix C. On exit, C is overwritten by H*C or H'*C or C*H or C*H'.
        ldc - input int The leading dimension of the array C. ldc >= max(1,m).
        work - workspace double[][] of dimensions ldwork by k
        ldwork - input int The leading dimension of the array work. If side = 'L', ldwork >= max(1,n). If side = 'R', ldwork >= max(1,m).
      • dlarfg

        public void dlarfg​(int n,
                           double[] alpha,
                           double[] x,
                           int incx,
                           double[] tau)
        This is a port of version 3.2 LAPACK auxiliary routine DLARFG Original DLARFG created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlarfg generates a real elementary reflector H of order n, such that H * (alpha) = (beta), H' * H = I. ( x ) ( 0 ) where alpha and beta are scalars, and x is an (n-1)-element real vector. H is represented in the form H = I - tau * (1) * (1 v'), (v) where tau is a real scalar and v is a real (n-1)-element vector. If the elements of x are all zero, then tau = 0 and H is taken to be the unit matrix. Otherwise 1 <= tau <= 2.
        Parameters:
        n - input int The order of the elementary reflector.
        alpha - input/output double[] On entry, the value alpha. On exit, it is overwritten with the value beta.
        x - input/output double[] of dimension (1 + (n-2)*abs(incx)) On entry, the vector x. On exit, it is overwritten with the vector v.
        incx - input int The increment between elements of x. incx > 0
        tau - output double[] The value tau
      • dlarfp

        public void dlarfp​(int n,
                           double[] alpha,
                           double[] x,
                           int incx,
                           double[] tau)
        This is a port of version 3.2 LAPACK auxiliary routine DLARFP Original DLARFP created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarfp generates a real elementary reflector H of order n, such that H * (alpha) = (beta), H' * H = I. ( x ) ( 0 ) where alpha and beta are scalars, beta is non-negative, and x is an (n-1)-element real vector. H is represented in the form H = I - tau * (1) * (1 v'), (v) where tau is a real scalar and v is a real (n-1)-element vector. If the elements of x are all zero, then tau = 0 and H is taken to be the unit matrix. Otherwise 1 <= tau <= 2.
        Parameters:
        n - input int The order of the elementary reflector.
        alpha - input/output double[] On entry, the value alpha. On exit, it is overwritten with the value beta.
        x - input/output double[] of dimension (1 + (n-2)*abs(incx)) On entry, the vector x. On exit, it is overwritten with the vector v.
        incx - input int The increment between elements of x. incx > 0
        tau - output double[] The value tau
      • dlarft

        public void dlarft​(char direct,
                           char storev,
                           int n,
                           int k,
                           double[][] V,
                           int ldv,
                           double[] tau,
                           double[][] T,
                           int ldt)
        This is a port of the version 3.2 LAPACK auxiliary routine DLARFT Original DLARFT created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarft forms the triangular factor T of a real block reflector H of order n, which is defined as the product of k elementary reflectors. If direct = 'F', H = H[0] H[1] ... H[k-1] and T is upper triangular. If direct = 'B', H = H[k-1] ... H[1] H[0] and T is lower triangular. If storev = 'C', the vector which defines the elementary reflector H[i] is stored in the i-th column of the array V, and H = I - V * T * V' If storev = 'R', the vector which defines the elementary reflector H[i] is stored in the i-th row of the array V, and H = I - V' * T * V.
        Parameters:
        direct - input char Specifies the order in which the elementary reflectors are multiplied to form the block reflector: = 'F': H = H[0] H[1] ... H[k-1] (forward) = 'B': H = H[k-1] ... H[1] H[0] (Backward)
        storev - input char Specifies how the vectors which define the elementary reflectors are stored (see also Further Details): = 'C': columnwise = 'R': rowwise
        n - input int The order of the block reflector H. n >= 0.
        k - input int The order of the triangular factor T ( = the number of elementary reflectors). k >= 1.
        V - (input/output) double[][] If storev = 'C', dimension = ldv by k. If storev = 'R', dimension = ldv by n. See further details.
        ldv - input int The leading dimension of the array V. If storev = 'C', ldv >= max(1,n). If storev = 'R', ldv >= k.
        tau - input double[] of dimension k. tau[i] must contain the scalar factor of the elementary reflector H[i].
        T - output double[][] of dimension ldt by k. The k by k triangular factor T of the block reflector. If direct = 'F', T is upper triangular. If direct = 'B', T is lower triangular. The rest of the array is not used.
        ldt - input int The leading dimension of the array T. ldt >= k.

        Further Details: The shape of the matrix V and the storage of the vectors which define the H[i] is best illustrated by the following example with n = 5 and k = 3. The elements equal to 1 are not stored; the corresponding array elements are modified but restored on exit. The rest of the array is not used. direct = 'F' and storev = 'C': V = ( 1 ) (v1 1 ) (v1 v2 1 ) (v1 v2 v3 ) (v1 v2 v3 ) direct = 'F' and storev = 'R': V = ( 1 v1 v1 v1 v1 ) ( 1 v2 v2 v2 ) ( 1 v3 v3 ) direct = 'B' and storev = 'C': V = ( v1 v2 v3 ) ( v1 v2 v3 ) ( 1 v2 v3 ) ( 1 v3 ) ( 1 ) direct = 'B' and storev = 'R': V = ( v1 v1 1 ) ( v2 v2 v2 1 ) ( v3 v3 v3 v3 1 )

      • dlarfy

        private void dlarfy​(char uplo,
                            int n,
                            double[] v,
                            int incv,
                            double tau,
                            double[][] C,
                            int ldc,
                            double[] work)
        This is a port of version 3.1 LAPACK auxiliary test routine DLARFY Original DLARFY created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlarfy applies an elementary reflector, or Householder matrix, H, to an n by n symmetric matrix C, from both the left and the right. H is represented in the form H = I - tau * v * v' where tau is a scalar and v is a vector. If tau is zero, then H is taken to be the unit vector
        Parameters:
        uplo - (input) char Specifies whether the upper or lower triangular part of the matrix C is stored. = 'U': Upper triangle = 'L': Lower triangle
        n - (input) int The number of rows and columns of the matrix C. n >= 0.
        v - (input) double[] of dimension (1 + (n-1)*abs(incv))
        incv - (input) int The increment between succesive elements of v. incv must not be zero.
        tau - (input) double
        C - (input/output) double[][] of dimension (ldc, n) On entry, the matrix C. On exit, C is overwritten by H * C * H'.
        ldc - (input) int The leading dimension of the array C. ldc >= max(1,n).
        work - (workspace) double[] of dimension (n)
      • dlarnd

        public double dlarnd​(int idist,
                             int[] iseed)
        This is a port of version 3.1 LAPACK auxiliary routine DLARND Original DLARND created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlarnd returns a random real number from a uniform or normal distribution. This routine calls the auxiliary routine dlaran to generate a random real number from a uniform (0,1) distribution. The Box-Muller method is used to transform numbers from a uniform to a normal distribution.
        Parameters:
        idist - input int Specifies the distribution of the random numbers: = 1: uniform (0,1) = 2: uniform (-1,1) = 3: normal (0,1)
        iseed - (input/output) int[] of dimension 4 On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and iseed[3] must be odd. On exit, the seed is updated.
        Returns:
        DOCUMENT ME!
      • dlarnv

        public void dlarnv​(int idist,
                           int[] iseed,
                           int n,
                           double[] x)
        This is a port of version 3.2 LAPACK auxiliary routine DLARNV Original DLARNV created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlarnv returns a vector of n random real numbers from a uniform or normal distribution
        Parameters:
        idist - input int Specifies the distribution of the random numbers: = 1: uniform (0,1) = 2: uniform (-1,1) = 3: normal (0,1)
        iseed - input/output int[] of dimension 4. On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and iseed[3] must be odd. On exit, the seed is updated
        n - input int The number of random numbers to be generated.
        x - output double[] of dimension n. The random generated numbers. The routine calls the auxiliary routine dlaruv to generate random real numbers from a uniform (0,1) distribution, in batches of up to 128 using vectorizable code. The Box-Muller method is used to transform numbers from a uniform to a normal distribution.
      • dlarot

        public void dlarot​(boolean lrows,
                           boolean lleft,
                           boolean lright,
                           int nl,
                           double c,
                           double s,
                           double[] A,
                           int lda,
                           double[] xleft,
                           double[] xright)
        This is a port of version 3.1 LAPACK auxiliary test routine DLAROT Original DLAROT created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlarot applies a (Givens) rotation to two adjacent rows or columns, where one element of the first and/or last column/row may be a separate variable. This is specifically intended for use on matrices stored in some format other than GE, so that elements of the matrix may be used or modified for which no array element is provided.

        One example is a symmetric matrix in SB format (bandwidth=4), for which uplo = 'L': Two adjacent rows will have the format: row j: * * * * * . . . . row j+1: * * * * * . . . . '*' indicates elements for which storage is provided, '.' indicates elements for which no storage is provided, but are not necessrily zero; their values are determined by symmetry. ' ' indicates elements which are necessarily zero, and have no storage provided.

        Those columns which have two '*'s can be handled by drot. Those columns which have no '*'s can be ignored, since as long as the Givens rotations are carefully applied to preserve symmetry, their values are determined. Those columns which have one '*' have to be handled separately, by using separate variables "p" and "q": row j: * * * * * p . . . row j+1: q * * * * . . . .

        The element p would have to be set correctly, then that column is rotated, setting p to its new value. The next call to dlarot would rotate columns j and j+1, using p, and restore symmetry. The element q would start out being zero, and be made non-zero by the rotation. Later, rotations would presumably be chosen to zero q out.

        Typical Calling Sequences: rotating the i-th and (i+1)-st rows.

        General dense matrix: dlarot(true, false, false, n, c, s, A[i-1][0], lda, dummy, dummy);

        General banded matrix in GB format: j = Math.max(1, i-kl); nl = Math.min(n, i+ku+1) + 1 - j; dlarot(true, (i-kl) >= 1, (i+ku) < n, nl, c,s,A[ku+i-j][j-1], lda - 1, xleft, xright); Note that i+1-j is just min(i,kl+1)

        Symmetric banded matrix in SY format, bandwidth k, lower triangle only: j = Math.max(1,i-k); nl = Math.min(k+1,i) + 1; dlarot(true, (i-k) >= 1, true, nl, c, s, A[i-1][j-1], lda, xleft, xright);

        Same, but upper triangle only: nl = Math.min(k+1,n-i) + 1; dlarot(true, true, (i+k) < n, nl, c, s, A[i-1][i-1], lda, xleft, xright);

        Symmetric banded matrix in SB format, bandwidth k, lower triangle only: same as for sy, except: A[i-j][j-1], lda - 1, xleft, xright); Note that i+1-j is just min(i,k+1)

        Same, but upper triangle only: A[k][i-1], lda-1, xleft, xright);

        Rotating columns is just the transpose of rotating rows, except for GB and SB: (rotating columns i and i+1)

        GB: j = Math.max(1,i-ku); nl = Math.min(n, i+kl+1) + 1 - j; dlarot(true, i-ku >= 1, i+kl < n, nl, c, s, A[ku+j-i][i-1], lda - 1, xtop, xbottm); Note that ku+j+1-i is just max(1,ku+2-i)

        SB: (upper triangle) ............. A[k+j-i][i-1], lda-1, xtop, xbottm);

        SB: (lower triangle) ................... A[0][i-1], lda-1, xtop, xbottm);

        Parameters:
        lrows - input boolean If true, then dlarot will rotate two rows. If false, then it will rotate two columns.
        lleft - input boolean If true, then xleft will be used instead of the corresponding element of A for the first element in the second row (if lrows = false) or column (if lrows = true) If false, then the corresponding element of A will be used.
        lright - input boolean If true, then xright will be used instead of the corresponding element of A for the last element in the first row (if lrows = false) or column (if lrows = true). If false, then the corresponding element of A will be used.
        nl - input int The length of the rows (if lrows = true) or columns (if lrows = false) to be rotated. If xleft and/or xright are used, the columns/rows they are in should be included in nl, e.g., if lleft = lright = true, then nl must be at least 2. The number of rows/columns to be rotated exclusive of those involving xleft and/or xright may not be negative, i.e., nl minus how many of lleft and lright are true must be at least zero; if not, an error message will be output.
        c - input double
        s - input double c and s specify the Givens rotation to be applied. If lrows is true, then the matrix ( c s ) (-s c ) is applied from the left; if false, then the transpose thereof is applied from the right. For a Givens rotation, c**2 + s**2 should be 1, but this is not checked.
        A - input/output double[] The array containing the rows/columns to be rotated. The first element of A should be the upper left element to be rotated.
        lda - input int The "effective" leading dimension of A. If A contains a matrix stored in GE or SY format, then this is just the leading dimension of A as dimensioned in the calling routine. If A contains a matrix stored in band (GB or SB) format, then this should be *one less* than the leading dimension used in the calling routine. Thus, if A were dimensioned A(lda,*) in dlarot, then A[0][j-1] would be the j-th element in the first of the two rows to be rotated, and A[1][j-1] would be the j-th in the second, regardless of how the array may be stored in the calling routine. [A cannot, however, actually be dimensioned thus, since for band format, the row number may exceed lda, which is not legal code.] If lrows = true, then lda must be at least 1, otherwise it must be at least nl minus the number of true values in xleft and xright.
        xleft - input/output double[] If lleft is true, then xleft will be used and modified instead of A[1][0] (if lrows = true) or A[0][1] (if lrows = false).
        xright - input/output double[] If lright is true, then xright will be used and modified instead of A[0][nl-1] (if lrows = true) or A[nl-1][0] (if lrows = false).
      • dlartg

        public void dlartg​(double f,
                           double g,
                           double[] cs,
                           double[] sn,
                           double[] r)
        This is a port of version 3.2 LAPACK auxiliary routine DLARTG Original DLARTG created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlartg generates a plane rotation so that [ cs sn ] . [ f ] = [ r ] where cs*cs + sn*sn = 1. [ -sn cs ] [ g ] [ 0 ] If g = 0, then cs = 1 and sn = 0. If f = 0 and g != 0, then cs = 0 and sn = 1 without doing any floating point operations (saves work in dbdsqr when there are zeros on the . If f exceeds g in magnitude, then cs will be positive.
        Parameters:
        f - input double The first component of the vector to be rotated.
        g - input double The second component of the vector to be rotated.
        cs - output double[] The cosine of the rotation.
        sn - output double[] The sine of the rotation.
        r - output double[] The nonzero component of the rotated vector.
      • dlaruv

        public void dlaruv​(int[] iseed,
                           int n,
                           double[] x)
        This is a port of version 3.2 LAPACK auxiliary routine DLARUV Original DLARUV created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlaruv returns a vector of n random real numbers from a uniform (0,1) distribution (n <= 128). This is an auxiliary routine called by dlarnv.
        Parameters:
        iseed - input/output int[] of dimension 4 On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and iseed[3] must be odd. On exit, the seed is updated.
        n - input int The number of random numbers to be generated. n <= 128.
        x - output double[] of dimension n. The generated random numbers. This routine uses a multiplicative congruential method with modulus 2**48 and multiplier 33952834046453 (see G.S. Fishman, "Multiplicative congruential random number generators with modulus 2**b: an exhaustive analysis for b = 32 and a partial analysis for b = 48", Math. Comp. 189, pp. 331-344, 1990). 48-bit integers are stored in 4 integer array elements with 12 bits per element. Hence the routine is portable across machines with integers of 32 bits or more.
      • dlascl

        public void dlascl​(char type,
                           int kL,
                           int ku,
                           double cfrom,
                           double cto,
                           int m,
                           int n,
                           double[][] A,
                           int lda,
                           int[] info)
        This is a port of the version 3.2 LAPACK auxiliary routine DLASCL Original DLASCL created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlascl multiplies the m by n real matrix A by the real scalar cto/cfrom. This is done without over/underflow as long as the final result cto*A[i][j]/cfrom does not over/underflow. type specifies that A may be full, upper triangular, lower triangular, upper Hessenberg, or banded.
        Parameters:
        type - input char type indicates the storage type of the input matrix. = 'G': A is a full matrix. = 'L': A is a lower triangular matrix. = 'U': A is an upper triangular matrix. = 'H': A is an upper Hessenberg matrix. = 'B': A is a symmetric band matrix with lower bandwidth kL and upper bandwidth ku and with only the lower half stored. = 'Q': A is a symmetric band matrix with lower bandwidth kL and upper bandwidth ku and with only the upper half stored. = 'Z': A is a band matrix with lower bandwith kL and upper bandwidth ku
        kL - input int The lower bandwidth of A. Referenced only if type = 'B', 'Q', or 'Z'.
        ku - input int The upper bandwidth of A. Referenced only if type = 'B', 'Q', or 'Z'.
        cfrom - input double
        cto - input double The matrix A is multiplied by cto/cfrom. A[i][j] is computed without over/underflow if the final result cto*A[i][j]/cfrom can be represented without over/underflow. cfrom must be nonzero.
        m - input int The number of rows of the matrix A. m >= 0.
        n - input int The number of columns of the matrix A. n >= 0.
        A - input/output double[][] of dimension lda by n. The matrix to be multiplied by cto/cfrom.
        lda - input int The leading dimension of the array A. lda >= max(1,m).
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument had an illegal value
      • dlaset

        public void dlaset​(char uplo,
                           int m,
                           int n,
                           double alpha,
                           double beta,
                           double[][] A,
                           int lda)
        This is a port of version 3.2 auxiliary routine DLASET. Original DLASET created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlaset initializes an m-by-n matrix A to beta on the diagonal and alpha on the offdiagonals.
        Parameters:
        uplo - input char Specifies the part of the matrix to be set. = 'U': Upper triangular part is set; the strictly lower triangular part of A is not changed. = 'L': Lower triangular part is set; the strictly upper triangular part of A is not changed. Otherwise: All of the matrix A is set.
        m - input int The number of rows of the matrix A. m >= 0.
        n - input int The number of columns of the matrix A. n >= 0.
        alpha - input double The constant to which the offdiagonal elements are to be set.
        beta - input double The constant to which the diagonal elements are to be set.
        A - input/output double[][] of dimension lda by n. On exit, the leading m-by-n submatrix of A is set as follows: If uplo = 'U', A(i,j) = alpha, 0 <= i <= j-1, 0 <= j <= n-1, If uplo = 'L', A(i,j) = alpha, j+1 <= i <= m-1, 0 <= j <= n-1, Otherwise, A(i,j) = alpha, 0 <= i <= m-1, 0 <= j <= n-1, i!= j and, for all uplo, A(i,i) = beta, 0 <= i <= min(m-1,n-1).
        lda - input int The leading dimension of the array A. lda >= max(1,m).
      • dlasr

        public void dlasr​(char side,
                          char pivot,
                          char direct,
                          int m,
                          int n,
                          double[] c,
                          double[] s,
                          double[][] A,
                          int lda)
        This is a port of version 3.2 LAPACK auxiliary routine DLASR Original DLASR created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlasr applies a sequence of plane rotations to a real matrix A, from either the left or the right. when side = 'L', the transformation takes the form A = P * A and when side = 'R', the transformation takes the form A = A * P**T where P is an orthogonal matrix consisting of a sequence of z plane rotations, with z = m when side = 'L' and z = n when side = 'R', and P**T is the transpose of P. When direct = 'F' (Forward sequence), then P = P(z-2) * ... * P(1) * P(0) and when direct = 'B' (Backward sequence), then P = P(0) * P(1) * ... * P(z-2) where P(k) is a plane rotation matrix defined by the 2-by-2 rotation R(k) = ( c(k) s(k) ) ( -s(k) c(k) ) When pivot = 'V' (Variable pivot), the rotation is performed for the plane (k,k+1), i.e., P(k) has the form P(k) = ( 1 ) ( ... ) ( 1 ) ( c(k) s(k) ) ( -s(k) c(k) ) ( 1 ) ( ... ) ( 1 ) where R(k) appears as a rank-2 modification to the identity matrix in rows and columns k and k+1. When pivot = 'T' (Top pivot), the rotation is performed for the plane (1,k+1), so P(k) has the form P(k) = ( c(k) s(k) ) ( 1 ) ( ... ) ( 1 ) ( -s(k) c(k) ) ( 1 ) ( ... ) ( 1 ) where R(k) appears in rows and column 1 and k+1 Similarly, when pivot = 'B' (Bottom pivot), the rotation is performed for the plane (k,z), giving P(k) the form P(k) = ( 1 ) ( ... ) ( 1 ) ( c(k) s(k) ) ( 1 ) ( ... ) ( 1 ) ( -s(k) c(k) ) where R(k) appears in rows and columns k and z. The rotations are performed without ever forming P(k) explicitly.
        Parameters:
        side - input char Specifies whether the plane rotation matrix P is applied to A on the left or the right. = 'L': Left, compute A = P*A = 'R': Right, compute A = A*P'
        pivot - input char Specifies the plane for which p[k] is a plane rotation matrix. = 'V': Variable pivot, the plane (k,k+1) = 'T': Top pivot, the plane (1,k+1) = 'B': Bottom pivot, the plane (k,z)
        direct - input char Specifies whether P is a forward or backward sequence of plane rotations. = 'F': Forward, p = p[z-2]*...*p[1]*p[0] = 'B': Backward, p = p[0]*p[1]*...*p[z-2]
        m - input int The number of rows of the matrix A. If m <= 1, an immediate return is effected.
        n - input int The number of columns of the matrix A. If n <= 1, an immediate return is effected.
        c - input double[]
        s - input double[] c and s are dimension (m-1) if side = 'L', (n-1) if side = 'R' c[k] and s[k] contain the cosine and sine that define the matrix p[k]. The two by two plane rotation part of the matrix p[k], R[k], has the form R[k] = ( c[k] s[k]) (-s[k] c[k])
        A - input/output double[][] of dimension lda by n. On entry, the m by n matrix A. On exit, A is overwritten by P*A if side = 'L' or by A*P' if side = 'R'.
        lda - input int The leading dimension of the array A. lda >= max(1,m).
      • dlasrt

        public void dlasrt​(char id,
                           int n,
                           double[] d,
                           int[] info)
        This is a port of the version 3.2 LAPACK auxiliary routine DLASRT Original DLASRT created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlasrt sorts the numbers in d in increasing order if id == 'I' or in decreasing order if id == 'D'. Use quick sort, reverting to insertion sort on arrays of size <= 20. Dimension of stack limits n to about 2**32.
        Parameters:
        id - input char = 'I': sort d in increasing order = 'D': sort d in decreasing order
        n - input int The length of the array d.
        d - input/output double[] of dimension n. On entry, the array to be sorted. On exit, d has been sorted into increasing order (d[0] <= ... <= d[n-1]) or into decreasing order (d[0] >= ... >= d[n-1]), depending on id.
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument had an illegal value
      • dlassq

        public void dlassq​(int n,
                           double[] x,
                           int incx,
                           double[] scale,
                           double[] sumsq)
        This is a port of version 3.2 LAPACK auxiliary routine DLASSQ Original DLASSQ created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlassq returns the values scl and smsq such that (scl**2)*smsq = x[0]**2 + x[incx]**2 + ... + x[(n-1)*incx]**2 + (scale**2)*sumsq The value of sumsq is assumed to be non-negative and scl returns the value scl = max(scale,abs(x[i])). scale and sumsq refer to the original supplied values in scale[] and sumsq[]. scl and smsq are the returned values in scale[] and sumsq[] that overwrite the orginal values. This routine makes only one pass through the vector x.
        Parameters:
        n - input int The number of elements to be used from the vector x
        x - input double[] The vector for which a scaled sum of squares is computed, using x[0], x[incx], ..., x[(n-1)*incx]
        incx - input int The increment between successive values of the vector x. incx > 0.
        scale - input/output double[] On entry, the value scale in the equation above. On exit, scale is overwritten with scl, the scaling factor for the sum of squares
        sumsq - input/output double[] On entry, the value sumsq in the equation above. On exit, sumsq is overwritten with smsq, the basic sum of squares from which scl has been factored out.
      • dlasv2

        public void dlasv2​(double f,
                           double g,
                           double h,
                           double[] ssmin,
                           double[] ssmax,
                           double[] snr,
                           double[] csr,
                           double[] snl,
                           double[] csl)
        This is a port of version 3.2 LAPACK auxiliary routine DLASV2 Original DLASV2 created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dlasv2 computes the singular value decomposition of a 2-by-2 triangular matrix [ f g ] [ 0 h ]. On return, abs(ssmax[0]) is the larger singular value, abs(ssmin[0]) is the smaller singular value, and (csl[0],snl[0]) and (csr[0],snr[0]) are the left and right singular vectors for abs(ssmax[0]), giving the decomposition [ csl snl] [f g ] [ csr -snr] = [ ssmax 0 ] [-snl csl] [0 h ] [ snr csr] [ 0 ssmin ].
        Parameters:
        f - input double The (0,0) element of a 2-by-2 matrix.
        g - input double The (0,1) element of a 2-by-2 matrix.
        h - input double The (1,1) element of a 2-by-2 matrix.
        ssmin - output double[] abs(ssmin[0]) is the smaller singular value.
        ssmax - output double[] abs(ssmax[0]) is the larger singular value.
        snr - output double[]
        csr - output double[] The vector (csr[0],snr[0]) is a unit right singular vector for the singular value abs(ssmax[0]).
        snl - output double[]
        csl - output double[] The vector (csl[0],snl[0]) is a unit left singular vector for the singular value abs(ssmax[0]). Further details: Any input parameter may be aliased with any output parameter.

        Barring over/underflow and assuming a guard digit in subtraction, all output quantities are correct to within a few units in the last place (ulps).

        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.

      • dlatb4

        public void dlatb4​(java.lang.String path,
                           int imat,
                           int m,
                           int n,
                           char[] type,
                           int[] kl,
                           int[] ku,
                           double[] anorm,
                           int[] mode,
                           double[] cndnum,
                           char[] dist)
        This is a port of version 3.4.0 LAPACK test routine DLATB4. Univ. of Tennessee, Univ. of California Berkeley, University of Colorado and NAG Ltd.. November 2011 .. Scalar Arguments .. CHARACTER DIST, TYPE CHARACTER*3 PATH INTEGER IMAT, KL, KU, M, MODE, N DOUBLE PRECISION ANORM, CNDNUM .. Purpose ======= DLATB4 sets parameters for the matrix generator based on the type of matrix to be generated. Arguments ========= PATH (input) String The LAPACK path name. IMAT (input) INTEGER An integer key describing which matrix to generate for this path. M (input) INTEGER The number of rows in the matrix to be generated. N (input) INTEGER The number of columns in the matrix to be generated. TYPE (output) CHARACTER*1 The type of the matrix to be generated: = 'S': symmetric matrix = 'P': symmetric positive (semi)definite matrix = 'N': nonsymmetric matrix KL (output) INTEGER The lower band width of the matrix to be generated. KU (output) INTEGER The upper band width of the matrix to be generated. ANORM (output) DOUBLE PRECISION The desired norm of the matrix to be generated. The diagonal matrix of singular values or eigenvalues is scaled by this value. MODE (output) INTEGER A key indicating how to choose the vector of eigenvalues. CNDNUM (output) DOUBLE PRECISION The desired condition number. DIST (output) CHARACTER*1 The type of distribution to be used by the random number generator.
      • dlatm1

        public void dlatm1​(int mode,
                           double cond,
                           int irsign,
                           int idist,
                           int[] iseed,
                           double[] D,
                           int n,
                           int[] info)
        This is a port of version 3.1 LAPACK auxiliary test routine DLATM1 Original DLATM1 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatm1 computes the entries of D[0...n-1] as specified by mode, cond, and irsign. idist and iseed determine the generation of random numbers. dlatm1 is called by dlatmr to generate random test matrices for LAPACK programs.
        Parameters:
        mode - input int On entry describes how D is to be computed: = 0 means do not change D. = 1 sets D[0] = 1 and D[1:n-1] = 1.0/cond. = 2 sets D[0:n-2] = 1 and D[n-1] = 1.0/cond. = 3 sets D[i] = cond**(-(i)/(n-1)) = 4 sets D[i] = 1 - (i)/(n-1)*(1 - 1/cond) = 5 sets D to random numbers in the range (1/cond, 1) such that their logarithms are uniformly distributed. = 6 sets D to random numbers from the same distribution as the rest of the matrix. < 0 has the same meaning as abs(mode), except that the order of the elements of D is reversed. Thus if mode is positive, D has entries ranging from 1 to 1/cond. If negative, from 1/cond to 1.
        cond - input double On entry, used as described under mode above. If used, it must be >= 1.
        irsign - input int On entry, if mode neither -6, 0, or 6, determines sign of entries of D. 0 => leave entries of D unchanged 1 => multiply each entry of D by 1 or -1 with probability 0.5
        idist - input int On entry, idist specifies the type of distribution to be used to generate a random matrix. 1 => uniform(0,1) 2 => uniform(-1,1) 3 => normal(0,1)
        iseed - input/output int[] On entry iseed specifies the seed of the random number generator. 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 dlatm1 to continue the same random number sequence.
        D - input/output double[] of dimension min(m,n). Array to be computed according to mode, cond, and irsign. May be changed on exit if mode is nonzero.
        n - input int The number of entries of D.
        info - output int[] 0 => normal termination -1 => if mode not in range -6 to 6. -2 => if mode neither -6, 0, or 6, and irsign neither 0 nor 1 -3 => if mode neither -6, 0, or 6 and cond less than 1 -4 => if mode equals 6 or -6 and idist not in range 1 to 3 -7 => if n negative
      • dlatm2

        public double dlatm2​(int m,
                             int n,
                             int i,
                             int j,
                             int kl,
                             int ku,
                             int idist,
                             int[] iseed,
                             double[] D,
                             int igrade,
                             double[] dl,
                             double[] dr,
                             int ipvtng,
                             int[] iwork,
                             double sparse)
        This is a port of version 3.1 LAPACK auxiliary test routine DLATM2 Original DLATM2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatm2 returns the (i,j) entry of a random matrix of dimension (m,n) described by the other parameters. It is called by the dlatmr routine in order to build random test matrices. No error checking on parameters is done, because this routine is called in a tight loop by dlatmr which has already checked the parameters.

        Use of dlatm2 differs from dlatm3 in the order in which the random number generator is called to fill in random matrix entries. With dlatm2, the generator is called to fill in the pivoted matrix columnwise. With dlatm3, the generator is called to fill in the matrix columnwise, after which it is pivoted. Thus, dlatm3 can be used to construct random matrices which differ only in their order of rows and/or columns. dlatm2 is used to construct band matrices while avoiding calling the random number generator for entries outisde the band (and therefore generating random numbers).

        The matrix whose (i,j) entry is returned is constructed as follows (this routine only computes one entry):

        If i is outside (1..m) or j is outside (1..n), return zero. (This is convenient for generating matrices in band format).

        Generate a matrix A with random entries of distribution idist.

        Set the diagonal to D.

        Grade the matrix, if desired, from the left (by dl) and/or from the right (by dr or dl) as specified by igrade.

        Permute, if desired, the rows and/or columns as specified by ipvtng and iwork.

        Band the matrix to have lower bandwidth kl and upper bandwidth ku.

        Set random entries to zero as specified by sparse.

        Parameters:
        m - input int Number of rows of the matrix.
        n - input int Number of columns of the matrix.
        i - input int Row of entry to be returned.
        j - input int Column of entry to be returned.
        kl - input int Lower bandwidth.
        ku - input int Upper bandwidth.
        idist - input int On entry, idist specifies the type of distribution to be used to generate a random matrix. 1 => uniform(0,1) 2 => uniform(-1,1) 3 => normal(0,1)
        iseed - input/output int[] of dimension 4 Seed for random number generator. Changed on exit.
        D - input double[] of dimension min(i,j) Diagonal entries of matrix.
        igrade - input int Specifies grading of matrix as follows: 0 => no grading 1 => matrix premultiplied by diag(dl) 2 => matrix postmultiplied by diag(dr) 3 => matrix premultiplied by diag(dl) and postmultiplied by diag(dr) 4 => matrix premultiplied by diag(dl) and postmultiplied by inv(diag(dl)) 5 => matrix premultiplied by diag(dl) and postmultiplied by diag(dl)
        dl - input double[] of dimension i or j, as appropriate Left scale factors for grading matrix.
        dr - input double[] of dimension i or j, as appropriate Right scale factors for grading matrix.
        ipvtng - input int On entry specifies pivoting permutations as follows: 0 => none. 1 => row pivoting. 2 => column pivoting. 3 => full pivoting, i.e., on both sides
        iwork - input int[] of dimension i or j, as appropriate This array specifies the permutation used. The row (or column) in position k was originally in position iwork[k-1]. This differs from iwork for dlatm3.
        sparse - input double between 0.0 and 1.0. On entry specifies the sparsity of the matrix if sparse matrix is to be generated. A uniform (0,1) random number x is generated and compared to sparse; if x is larger the matrix entry is unchanged and if x is smaller the entry is set to zero. Thus on average a fraction sparse of the entries will be set to zero.
        Returns:
        double
      • dlatm3

        public double dlatm3​(int m,
                             int n,
                             int i,
                             int j,
                             int[] isub,
                             int[] jsub,
                             int kl,
                             int ku,
                             int idist,
                             int[] iseed,
                             double[] D,
                             int igrade,
                             double[] dl,
                             double[] dr,
                             int ipvtng,
                             int[] iwork,
                             double sparse)
        This is the port of the version 3.1 LAPACK auxiliary test routine DLATM3 Original DLATM3 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatm3 returns the (isub, jsub) entry of a random matrix of dimension (m,n) described by the other parameters. (isub, jsub) is the final position of the (i,j) entry after pivoting according to ipvtng and iwork. dlatm3 is called by the dlatmr routine in order to build random test matrices. No error checking is done, because this routine is called in a tight loop by dlatmr which has already checked the parameters.

        Use of dlatm3 differs from dlatm2 in the order in which the random number generator is called to fill in random matrix entries. With dlatm2, the generator is called to fill in the pivoted matrix columnwise. With dlatm3, the generator is called to fill in the matrix columnwise, after which it is pivoted. Thus, dlatm3 can be used to construct random matrices which differ only in their order of rows and/or columns. dlatm2 is used to construct band matrices while avoiding calling the random number generator for entries outside the band (and therefore generating random numbers in different orders for different pivot orders).

        The matrix whose (isub, jsub) entry is returned is constructed as follows (this routine only computes one entry):

        If isub is outside (1...m) or jsub is outside (1...n), return zero. (this is convenient for generating matrices in band format).

        Generate a matrix A with random entries of distribution idist.

        Set the diagonal to D.

        Grade the matrix, if desired, from the left (by dl) and/or from the right (by dr or dl) as specified by igrade.

        Permute, if desired, the rows and/or columns as specified by ipvtng and iwork.

        Band the matrix to have lower bandwidth kl and upper bandwidth ku.

        Set random entries to zero as specified by sparse.

        Parameters:
        m - input int Number of rows of matrix
        n - input int Number of columns of matrix.
        i - input int Row of unpivoted entry to be returned.
        j - input int Column of unpivoted entry to be returned.
        isub - output int[] Row of pivoted entry to be returned.
        jsub - output int[] Column of pivoted entry to be returned.
        kl - input int Lower bandwidth
        ku - input int Upper bandwidth
        idist - input int On entry, idist specifies the type of distribution to be used to generate a random matrix. 1 => uniform (0,1) 2 => uniform (-1,1) 3 => normal (0,1)
        iseed - input/output int[] of dimension 4 Seed for random number generator. Changed on exit.
        D - input double[] of dimension min(i,j). Diagonal entries of matrix.
        igrade - input int Specifies the grading of the matrix as follows: 0 => no grading 1 => matrix premultiplied by diag (dl) 2 => matrix postmultiplied by diag (dr) 3 => matrix premultiplied by diag (dl) and postmultiplied by diag (dr) 4 => matrix premultiplied by diag (dl) and postmultiplied by inv(diag(dl)) 5 => matrix premultiplied by diag(dl) and postmultiplied by diag(dl)
        dl - input double[] of dimension i or j, as appropriate Left scale factors for grading matrix.
        dr - input double[] of dimension i or j, as appropriate Right scale factors for grading matrix.
        ipvtng - input int On entry specifies the pivoting permutations as follows: 0 => none 1 => row pivoting 2 => column pivoting 3 => full pivoting, i.e., on both sides
        iwork - input int[] of dimension i or j, as appropriate This array specifies the permutation used. The row (or column) originally in position k is in position iwork[k-1] after pivoting. This differs from iwork for dlatm2.
        sparse - input double between 0.0 and 1.0. On entry specifies the sparsity of the matrix if sparse matrix is to be generated. A uniform (0,1) random number x is generated and compared to sparse; if x is larger the matrix entry is unchanged and if x is smaller the entry is set to zero. Thus on the average a fraction sparse of the entries will be set to zero.
        Returns:
        double
      • dlatm4

        private void dlatm4​(int itype,
                            int n,
                            int nz1,
                            int nz2,
                            int isign,
                            double amagn,
                            double rcond,
                            double triang,
                            int idist,
                            int[] iseed,
                            double[][] A,
                            int lda)
        This is a port of version 3.1 LAPACK auxiliary test routine DLATM4 Original DLATM4 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatm4 generates basic square matrices, which may later be multiplied by others in order to produce test matrices. It is intended mainly to be used to test the generalized eigenvalue routines.

        It first generates the diagonal and (possibly) subdiagonal, according to the value of itype, nz1, nz2, isign, amagn, and rcond. It then fills in the upper triangle with random numbers, if triang is non-zero.

        Parameters:
        itype - input int The "type" of matrix on the diagonal and sub-diagonal. If itype < 0, then type abs(itype) is generated and then swapped end for end (A[i][j] := A'([n-1-j][n-1-i].) See also the description of amagn and isign. Special types: = 0: the zero matrix. = 1: the identity = 2: a transposed Jordan block. = 3: If n is odd, then a k+1 by k+1 transposed Jordan block followed by a k by k identity block, where k = (n-1)/2. If n is even, then k = (n-2)/2, and a zero diagona entry is tacked onto the end.

        Diagonal types. The diagonal consists of nz1 zeros, then k = n-nz1-nz2 nonzeros. The subdiagonal is zero. itype specifies the nonzero diagonal entries as follows: = 4: 1, ..., k = 5: 1, rcond, ..., rcond = 6: 1, ..., 1, rcond = 7: 1, a, a**2, ..., a**(k-1) = rcond = 8: 1, 1-d, 1-2*d, ..., 1-(k-1)*d = rcond = 9: random numbers chosen from (rcond,1) = 10: random numbers with distribution idist (see dlarnd.)

        n - input int The order of the matrix.
        nz1 - input int If abs(itype) > 3, then the first nz1 diagonal entries will be zero.
        nz2 - input int If the abs(itype) > 3, the the last nz2 diagonal entries will be zero.
        isign - input int = 0: The sign of the diagonal and subdiagonal entries will be left unchanged. = 1: The diagonal and subdiagonal entries will have their sign changed at random. = 2: If itype is 2 or 3, then the same as isign = 1. Otherwise, with probability 0.5, even-odd pairs of diagonal entries A[2*j][2*j], A[2*j+1][2*j+1] will be converted to a 2 by 2 block by pre- and post-multiplying by distinct random orthogonal rotations. The remaining diagonal entries will have their sign changed at random.
        amagn - input double The diagonal and subdiagonal entries will be multiplied by amagn.
        rcond - input double If abs(itype) > 4, then the smallest diagonal entry will be rcond. rcond must be between 0 and 1.
        triang - input double The entries above the diagonal will be random numbers with magnitude bounded by triang (i.e., random numbers multiplied by triang.)
        idist - input int Specifies the type of distribution to be used to generate a random matrix. = 1: uniform (0, 1) = 2: uniform (-1, 1) = 3: normal (0, 1)
        iseed - (input/output) int[] of dimension 4 On entry iseed specifies the seed of the random number generator. The values of iseed are changed on exit, and can be used in the next call to dlatm4 to continue the same random number sequence. Note: iseed[3] should be odd, for the random number generator used at present.
        A - output double[][] of dimension (lda,n) Array to be computed.
        lda - input int Leading dimension of A. Must be at least 1 and at least n.
      • dlatmr

        public void dlatmr​(int m,
                           int n,
                           char dist,
                           int[] iseed,
                           char sym,
                           double[] D,
                           int mode,
                           double cond,
                           double dmax,
                           char rsign,
                           char grade,
                           double[] dl,
                           int model,
                           double condl,
                           double[] dr,
                           int moder,
                           double condr,
                           char pivtng,
                           int[] ipivot,
                           int kl,
                           int ku,
                           double sparse,
                           double anorm,
                           char pack,
                           double[][] A,
                           int lda,
                           int[] iwork,
                           int[] info)
        This is a port of version 3.1 LAPACK test routine DLATMR Original DLATMR created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatmr generates random matrices of various types for testing LAPACK programs. dlatmr operates by applying the following sequence of operations: 1.) Generate a matrix A with random entries of distribution dist which is symmetric if sym = 'S' and nonsymmetric if sym = 'N'. 2.) Set the diagonal to D, where D may be input or computed according to mode, cond, dmax, and rsign as described below. 3.) Grade the matrix, if desired, from the left and/or right as specified by grade. The inputs dl, model, condl, dr, moder, and condr also determine the grading as described below. 4.) Permute, if desired, the rows and/or columns as specified by pivtng and ipivot. 5.) Set random entries to zero, if desired, to get a random sparse matrix as specified by sparse. 6.) Make A a band matrix, if desired, by zeroing out the matrix outside a band of lower bandwidth kl and upper bandwidth ku. 7.) Scale A, if desired, to have maximum entry anorm 8.) Pack the matrix if desired. Options specified by pack are: no packing, zero out upper half (if symmetric), zero out lower half (if symmetric), store the upper half columnwise (if symmetric or square upper triangular), store the lower half columnwise (if symmetric or square lower triangular), same as upper half rowwise if symmetric, store the lower triangle in banded format (if symmetric), store the upper triangle if banded format (if symmetric), and store the entire matrix in banded format

        Note: If two calls to dlatmr differ only in the pack parameter, they will generate mathematically equivalent matrices.

        If two calls to dlatmr both have full bandwidth (kl = m-1 and ku = n-1), and differ only in the pivtng and pack parameters, then the matrices generated will differ only in the order of the rows and/or columns, and otherwise contain the same data. This consistency cannot be and is not maintained with less than full bandwidth.

        Parameters:
        m - input int Number of rows of A.
        n - input int Number of columns of A.
        dist - input char On entry, dist specifies the type of distribution to be used to generate a random matrix. 'U' => uniform(0,1) ('U' for uniform) 'S' => uniform(-1,1) ('S' for symmetric) 'N' => normal(0,1) ('N' for normal)
        iseed - input/output int[] of dimension 4 On entry iseed specifies the seed of the random number generator. They should lie between 0 and 4095 inclusive, and iseed[3] should 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 dlatmr to continue the same random number sequence.
        sym - input char If sym = 'S' or 'H', generated matrix is symmetric. If sym = 'N', generated matrix is nonsymmetric.
        D - (input/output) double[] of dimension (min(m,n)) On entry this array specifies the diagonal entries of the diagonal of A. D may either be specified on entry, or set according to mode and cond as described below. May be changed on exit if mode is nonzero.
        mode - input int On entry describes how D is to be used: = 0 means use D as input = 1 sets D[0] = 1 and D[1:n-1] = 1.0/cond = 2 sets D[0:n-2] = 1 and D[n-1] = 1.0/cond = 3 sets D[i] = cond**(-(i)/(n-1)) = 4 sets D[i] = 1 - (i)/(n-1)*(1 - 1/cond) = 5 sets D to random numbers in the range (1/cond, 1) such that their logarithms are uniformly distributed. = 6 sets D to random numbers from the same distribution as the rest of the matrix. < 0 has the same meaning as abs(mode), except that the order of the elements of D is reversed. Thus, if mode is positive, D has entries ranging from 1 to 1/cond, and if negative, from 1/cond to 1.
        cond - input double On entry, used as described under mode above. If used, it must be >= 1.
        dmax - input double If mode is neither -6, 0, nor 6, the diagonal is scaled by dmax/max(abs(D[i])), so that maximum absolute entry of diagonal is abs(dmax). If dmax is negative (or zero), diagonal will be scaled by a negative number (or zero).
        rsign - input char If mode is neither -6, 0, nor 6, specifies sign of diagonal as follows: 'T' => diagonal entries are multiplied by 1 or -1 with probability 0.5. 'F' => diagonal unchanged
        grade - input char Specifies grading of matrix as follows: 'N' => no grading 'L' => matrix premultiplied by diag(dl) (only if matrix nonsymmetric) 'R' => matrix postmultiplied by diag(dr) (only if matrix nonsymmetric) 'B' => matrix premultiplied by diag(dl) and postmultiplied by diag(dr) (only if matrix nonsymmetric) 'S' or 'H' => matrix premultiplied by diag(dl) and postmultiplied by diag(dl) ('S' for symmetric, or 'H' for Hermitian) 'E' => matrix premultiplied for diag(dl) and postmultiplied by inv(diag(dl)) ( 'E' for eigenvalue invariance) (only if matrix nonsymmetric) Note: If grade = 'E', then m must equal n.
        dl - input/output double[] of dimension m If model = 0, then on entry this array specifies the diagonal entries of a diagonal matrix used as described under grade above. If model is not zero, then dl will be set according to model and condl, analagous to the way D is set according to mode and cond (except that there is no dmax parameter for dl). If grade = 'E', then dl cannot have zero entries. Not referenced if grade = 'N' or 'R'.
        model - input int This specifies how the diagonal array dl is to be computed, just as mode specifies how D is to be computed.
        condl - input double When model is not zero, this specifies the condition number of the computed dl.
        dr - input/output double[] of dimension n. If moder = 0, then on entry this array specifies the diaognal entries of a diagonal matrix used as described under grade above. If moder is not zero, then dr will be set according to moder and condr, analagous to the way D is set according to mode and cond (except that there is no dmax parameter for dr). Not referenced if grade = 'N', 'L', 'H', 'S', or 'E'.
        moder - input int This specifies how the diagonal array dr is to be computed, just as mode specifies how D is to be computed.
        condr - input double While moder is not zero, this specifies the condition number of the computed dr.
        pivtng - input char On entry specifies the pivoting permutations as follows: 'N' or ' ' => none 'L' => left or row pivoting (matrix must be nonsymmetric). 'R' => right or column pivoting (matrix must be nonsymmetric). 'B' or 'F' => both or full pivoting, i.e., on both sides. In this case, m must equal n.] If two calls to dlatmr both have full bandwidth (kl = m-1 and ku = n-1), and differ only in the pivtng and pack parameters, then the matrices generated will differ only in the order of the rows and/or the columns, and otherwise contain the same data. This consistency cannot be maintained with less than full bandwidth.
        ipivot - input int[] of dimension m or n. This array specifies the permutation used. After the basic matrix is generated, the rows, columns, or both are permuted. If, say, row pivoting is selected, dlatmr starts with the *last* row and interchanges the m-th and ipivot(m)-th rows, then moves to the next-to-last row, interchanging the (m-1)-th and the ipivot(m-1)-th rows, and so on. In terms of "2-cycles", the permutation is (1 ipivot[0]) (2 ipivot[1]) ... (m ipivot[m-1]) where the rightmost cycle is applied first. This is the *inverse* of the effect of pivoting in LINPACK. The idea is that factoring (with pivoting) an identity matrix which has been inverse-pivoted in this way should result in a pivot vector identical to ipivot. Not referenced if pivtng = 'N'.
        kl - input int On entry, specifies the lower bandwidth of the matrix. For example, kl = 0 implies upper triangular, kl = 1 implies upper Hessenberg, and kl at least m-1 implies the matrix is not banded. Must equal ku if matrix is symmetric.
        ku - input int On entry specifies the upper bandwidth of the matrix. For example, ku = 0 implies lower triangular, ku = 1 implies lower Hessenberg, and ku at least n-1 implies the matrix is not banded. Must equal kl if the matrix is symmetric.
        sparse - input double On entry specifies the sparsity of the matrix if a sparse matrix is to be generated. sparse should lie between 0 and 1. To generate a sparse matrix, for each matrix entry a uniform (0,1) random number x is generated and compared to sparse; if x is larger the matrix entry is unchanged and if x is smaller the entry is set to zero. Thus on average a fraction sparse of the entries will be set to zero.
        anorm - input double On entry specifies the maximum entry of output matrix (output matrix will be multiplied by a constant so that its largest absolute entry equals anorm) if anorm is nonnegative. If anorm is negative, no scaling is done.
        pack - input char On entry specifies packing of matrix as follows: 'N' => no packing 'U' => zero out all subdiagonal entries (if symmetric) 'L' => zero out all superdiagonal entries (if symmetric) 'C' => store the upper triangle columnwise (only if matrix symmetric or square upper triangular) 'R' => store the lower triangle columnwise (only if matrix symmetric or square lower triangular) (same as upper half rowwise if symmetric) 'B' => store the lower triangle in band storage scheme (only if matrix symmetric) 'Q' => store the upper triangle in band storage scheme (only if matrix symmetric) 'Z' => store the entire matrix in band storage scheme (pivoting can be provided for by using this option to store A in the trailing rows of the allocated storage) Using these options, the various LAPACK packed and banded storage schemes can be obtained: GB - use 'Z' PB, SB, or TB - use 'B' or 'Q' PP, SP, or TP - use 'C' or 'R' If two calls to dlatmr differ only in the pack parameter, they will generate mathematically equivalent matrices.
        A - output double[][] of dimension (lda, n) On exit A is the desired test matrix. Only those entries of A which are significant on output will be referenced (even if A is in packed or band storage format). The 'unoccupied corners' of A in band format will be zeroed out.
        lda - input int On entry lda specifies the first dimension of A as declared in the calling program. If pack = 'N', 'U', or 'L', lda must be at least max(1,m). If pack = 'C' or 'R', lda must be at least 1. If pack = 'B' or 'Q', lda must be at least min (ku+1,n). If pack = 'Z', lda must be at least kuu+kll+1, where kuu = min(ku,n-1) and kll = min(kl,n-1).
        iwork - workspace int[] of dimension m or n Not referenced if pivtng = 'N'.
        info - output int[] Error parameter on exit: 0 => normal return -1 => m negative or unequal to n and sym = 'S' or 'H' -2 => n negative -3 => dist illegal string -5 => sym illegal string -7 => mode not in range -6 to 6 -8 => cond less than 1.0, and mode neither -6, 0, nor 6 -10 => mode neither -6, 0, nor 6 and rsign illegal string -11 => grade illegal string, or grade = 'E' and m not equal to n, or grade = 'L', 'R', 'B', or 'E', and sym = 'S' or 'H' -12 => grade = 'E' and dl contains zero -13 => model not in range -6 to 6 and grade = 'L', 'B', 'H', 'S', or 'E' -14 => condl less than 1.0, grade = 'L', 'B', 'H', 'S', or 'E', and model neither -6, 0, nor 6. -16 => moder not in range -6 to 6 and grade = 'R' or 'B' -17 => condr less than 1.0, grade = 'R' or 'B', and moder neither -6, 0, nor 6. -18 => pivtng illegal string, or pivtng = 'B' or 'F' and m not equal to n, or pivtng = 'L' or 'R' and sym = 'S' or 'H'. -19 => ipivot contains out of range number and pivtng not equal to 'N' -20 => kl negative -21 => ku negative, or sym = 'S' or 'H' and ku not equal to kl -22 => sparse not in range 0 to 1. -24 => pack illegal string, or pack = 'U', 'L', 'B', or 'Q' and sym = 'N', or pack = 'C' and sym = 'N' and either kl not equal to 0 or n not equal to m, or pack = 'R' and sym = 'N', and either ku not equal to 0 or n not equal to m. -26 => lda too small 1 => Error return from dlatm1 (computing D) 2 => Cannot scale diagonal to dmax (max. entry is 0) 3 => Error return from dlatm1 (computing dl) 4 => Error return form dlatm1 (computing dr) 5 => anorm is positive, but matrix, constructed prior to attempting to scale it to have norm anorm, is zero.
      • dlatms

        public void dlatms​(int m,
                           int n,
                           char dist,
                           int[] iseed,
                           char sym,
                           double[] D,
                           int mode,
                           double cond,
                           double dmax,
                           int kl,
                           int ku,
                           char pack,
                           double[][] A,
                           int lda,
                           double[] work,
                           int[] info)
        This is a port of version 3.1 LAPACK test routine DLATMS Original DLATMS created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatms generates random matrices with specified singular values (or symmetric/hermitian with specified eigenvalues) for testing LAPACK programs.

        dlatms operates by applying the following sequence of operations:

        Set the diagonal to D, where D may be input or computed according to mode, cond, dmax, and sym as described below.

        Generate a matrix with appropriate band structure, by one of two methods:

        Method A: Generate a dense m by n matrix by multiplying D on the left and the right by random unitary matrices, then:

        Reduce the bandwidth according to kl and ku, using Householder transformations.

        Method B: Convert the bandwidth-0 (i.e., diagonal) matrix to a bandwidth-1 matrix using Givens rotations, "chasing" out-of-band elements back, much as in QR; then convert the bandwidth-1 to a bandwidth-2 matrix, etc. Note that for reasonably samll bandwidths (relative to m and n) this requires less storage, as a dense matrix is not generated. Also, for symmetric matrices, only, one triangle is generated.

        Method A is chosen if the bandwidth is a large fraction of the order of the matrix, and lda is at least m (so a dense matrix can be stored.) Method B is chosen if the bandwidth is small ( < 1/2 n for symmetric, < .3 n+m for non-symmetric), or lda is less than m and not less than the bandwidth.

        Pack the matrix if desired. Options specified by pack are: no packing, zero out upper half (if symmetric), zero out lower half (if symmetric), store the upper half columnwise (if symmetric or upper triangular), store the lower half columnwise (if symmetric or lower triangular), store the lower triangle in banded format (if symmetric or lower triangular), store the upper triangle in banded format (if symmetric or upper triangular), and store the entire matrix in banded format If method B is chosen, and band format is specified, then the matrix will be generated in the band format, so no repacking will be necessary.

        Parameters:
        m - input int The number of rows of A.
        n - input int The number of columns of A.
        dist - input char On entry, dist specifies the type of distribution to be used to generate the random eigen-/singular values. 'U' => uniform(0,1) ('U' for uniform) 'S' => uniform(-1,1) ('S' for symmetric) 'N' => normal(0,1) ('N' for normal)
        iseed - input/output int[] of dimension 4 On entry iseed specifies the seed of the random number generator. They should lie between 0 and 4095 inclusive, and iseed[3] should 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 dlatms to continue the same random number sequence. Changed on exit.
        sym - input char If sym = 'S' or 'H', the generated matrix is symmetric, with eigenvalues specified by D, cond, mode, and dmax; they may be positive, negative, or zero. If sym = 'P', the generated matrix is symmetric, with eigenvalues (= singular values) specified by D, cond, mode, and dmax; they will not be negative. If sym = 'N', the generated matrix is nonsymmetric, with singular values specified by D, cond, mode, and dmax; they will not be negative.
        D - input/output double[] of dimension (min(m,n)) This array is used to specify the singular values or eigenvalues of A (see sym, above.) If mode = 0, then D is assumed to contain the singular/eigenvalues, otherwise they will be computed according to mode, cond, and dmax, and placed in D. Modified if mode is nonzero.
        mode - input int On entry this describes how the singular/ eigenvalues are to be specified: = 0 means use D as input = 1 sets D[0] = 1 and D[1:n-1] = 1.0/cond = 2 sets D[0:n-2] = 1 and D[n-1] = 1.0/cond = 3 sets D[i] = cond**(-(i)/(n-1)) = 4 sets D[i] = 1 - (i)/(n-1)*(1 - 1/cond) = 5 sets D to random numbers in the range (1/cond, 1) such that their logarithms are uniformly distributed = 6 sets D to random numbers from same distribution as the rest of the matrix mode < 0 has the same meaning as abs(mode), except that the order of the elements of D is reversed. Thus, if mode is positive, D has entries ranging from 1 to 1/cond, if negative, from 1/cond to 1. If sym = 'S' or 'H', and mode is neither 0, 6, nor -6, then the elements of D will also be multiplied by a random sign (1.e., +1 or -1).
        cond - input double On entry, this is used as described under mode above. If used, it must be >= 1.
        dmax - input double If mode is neither -6, 0, nor 6, the contents of D, as computed according to mode and cond, will be scaled by dmax/max(abs(D[i])); thus the maximum absolute eigen- or singular value (which is to say the norm) will be abs(dmax). Note that dmax need not be positive: if dmax is negative (or zero), D will be scaled by a negative number (or zero).
        kl - input int This specifies the lower bandwidth of the matrix. For example, kl = 0 implies upper triangular, kl = 1 implies upper Hessenberg, and kl being at least m-1 means that the matrix has full lower bandwidth. kl must equal ku if the matrix is symmetric.
        ku - input int This specifies the upper bandwidth of the matrix. For example, ku = 0 implies lower triangular, ku = 1 implies lower Hessenberg, and ku being at least n-1 means that the matrix has full upper bandwidth. kl must equal ku if the matrix is symmetric.
        pack - input char This specifies packing of the matrix as follows: 'N' => no packing 'U' => zero out all subdiagonal entries (if symmetric) 'L' => zero out all superdiagonal entries (if symmetric) 'C' => store the upper triangle columnwise (only if the matrix is symmetric or upper triangular) 'R' => store the lower triangle columnwise (only if the matrix is symmetric or lower triangular) 'B' => store the lower triangle in band storage scheme (only if matrix symmetric or lower triangular) 'Q' => store the upper triangle in band storage scheme (only if matrix symmetric or upper triangular) 'Z' => store the entire matrix in band storage scheme (pivoting can be provided for by using this option to store A in the trailing rows of the allocated storage) Using these options, the various LAPACK packed and banded storage schemes can be obtained: GB - use 'Z' PB, SB, or TB - use 'B' or 'Q' PP, SP, or TP - use 'C' or 'R' If two calls to dlatms differ only in the pack parameter, they will generate mathematically equivalent matrices
        A - input/output double[][] of dimension (lda,n) On exit A is the desired test matrix. A is first generated in full (unpacked) form, and then packed, if so specified by pack. Thus, the first m elements of the first n columns will always be modified. If pack specifies a packed or banded storage scheme, all lda elements of the first n columns will be modified; the elements of the array which do not correspond to elements of the generated matrix are set to zero.
        lda - input int lda specifies the first dimension of A as declared in the calling program. If pack = 'N', 'U', 'L', 'C', or 'R', then lda must be at least m. If pack = 'B' or 'Q', then lda must be at least min(kl,m-1) (which is equal to min(ku,n-1)). If pack = 'Z', lda must be large enough to hold the packed array: min(ku,n-1) + min(kl,m-1) + 1.
        work - workspace double[] of dimension (3*max(n,m))
        info - output int[] Error code. On exit, info[0] will be set to one of the following values: 0 => normal return -1 => m negative or unequal to n and sym = 'S', 'H', or 'P' -2 => n negative -3 => dist illegal string -5 => sym illegal string -7 => mode not in range -6 to 6 -8 => cond less than 1.0, and mode neither -6, 0, nor 6 -10 => kl negative -11 => ku negative, or sym = 'S' or 'H' and ku not equal to kl -12 => pack illegal string, or pack = 'U' or 'L', and sym = 'N'; or pack = 'C' or 'Q' and sym = 'N' and kl is not zero; or pack = 'R' or 'B' and sym = 'N' and ku is not zero; or pack = 'U', 'L', 'C', 'R', 'B', or 'Q' and m != n. -14 => lda is less than m, or pack = 'Z' and lda is less than min(ku,n-1) + min(kl,m-1) + 1. 1 => Error return from dlatm1 2 => Cannot scale to dmax (maximum singular value is 0) 3 => Error return from dlagge or dlagsy
      • dlatrd

        private void dlatrd​(char uplo,
                            int n,
                            int nb,
                            double[][] A,
                            int lda,
                            double[] e,
                            double[] tau,
                            double[][] W,
                            int ldw)
        This is a port of version 3.1 LAPACK auxiliary routine DLATRD Original DLATRD created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dlatrd reduces nb rows and columns of a real symmetric matrix A to symmetric tridiagonal form by an orthogonal similarity transformation Q'*A*Q, and returns the matrices V and W which are needed to apply the transformation to the unreduced part of A. If uplo = 'U', dlatrd reduces the last nb rows and columns of a matrix, of which the upper triangle is supplied. If uplo = 'L'. dlatrd reduces the first nb rows and columns of a matrix, of which the lower triangle is supplied. This is an auxiliary routine called by dsytrd.
        Parameters:
        uplo - input char Specifies whether the upper or lower triangular part of the symmetric matrix A is stored: = 'U': Upper triangular = 'L': Lower triangular
        n - input int The order of the matrix A.
        nb - input int The number of rows and columns to be reduced.
        A - input/output double[][] of dimension lda by n. On entry, the symmetric matrix A. If uplo == 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of matrix A, and the strictly lower triangular part of A is not referenced. If uplo = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly uper triangular part of A is not referenced. On exit: If uplo = 'U', the last nb columns have been reduced to tridiagonal form, with the diagonal elements overwriting the diagonal elements of A; the elements above the diagonal with the array tau represent the orthogonal matrix Q as a product of elementary reflectors. If uplo = 'L', the first nb columns have been reduced to tridiagonal form, with the diagonal elements overwriting the diagonal elements of A; the elements below the diagonal with the array tau represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details.
        lda - input int The leading dimension of the array A. lda >= max(1,n).
        e - output double[] of dimension n-1. If uplo = 'U', e(n-nb-1:n-2) contains the superdiagonal elements of the last nb columns of the reduced matrix. If uplo = 'L', e(0:nb-1) contains the subdiagonal elements of the first nb columns of the reduced matrix.
        tau - output double[] of dimension n-1 The scalar factors of the elementary reflectors, stored in tau(n-nb-1:n-2) if uplo = 'U', and in tau(0:nb-1) if uplo = 'L'. See Further Details.
        W - output double[][] of dimension ldw by nb. The n-by-nb matrix W required to update the unreduced part of A.
        ldw - input int The leading dimension of the array W. ldw >= max(1,n).

        Further Details: If uplo = 'U', the matrix Q is represented as a product of elementary reflectors Q = H[n-1] H[n-2] ... H[n-nb]. Each H[i] has the form H[i] = I - tau * v * v' where tau is a real scalar, and v is a real vector with v(i-1:n-1) = 0 and v(i-2) = 1; v(0:i-2) is stored on exit in A(0:i-2,i-1), and tau in tau(i-2). If uplo = 'L', the matrix Q is represented as a product of elementary reflectors Q = H[0] H[1] ... H[nb-1]. Each H[i] has the form H[i] = I - tau * v * v' where tau is a real scalar, and v is a real vector with v(0:i-1) = 0 and v(i) = 1; v(i:n-1) is stored on exit in A(i:n-1,i-1),and tau in tau[i-1].

        The elements of the vectors v together form the n-by-nb matrix V which is needed, with W, to apply the transformation to the unreduced part of the matrix using a symmetric rank-2k update of the form: A = A - V*W' - W*V'

        The contents of A on exit are illustrated by the following examples with n = 5 and nb = 2: If uplo = 'U': ( a a a v4 v5) ( a a v4 v5) ( a 1 v5) ( d 1) ( d) if uplo = 'L': ( d ) ( 1 d ) (v1 1 a ) (v1 v2 a a ) (v1 v2 a a a) where d denotes a diagonal element of the reduced matrix, a denotes an element of the original matrix that is unchanged, and vi denotes an element of the vector defining H(i).

      • dnrm2

        public double dnrm2​(int n,
                            double[] x,
                            int incx)
        This is a port of the 10/14/93 DNRM2 function Original code written by Sven Hammarling, Nag Ltd. dnrm2 returns the euclidean norm of a vector via the function sqrt(x'*x)
        Parameters:
        n - int
        x - double[]
        incx - int
        Returns:
        double
      • dorg2l

        private void dorg2l​(int m,
                            int n,
                            int k,
                            double[][] A,
                            int lda,
                            double[] tau,
                            double[] work,
                            int[] info)
        This is a port of version 3.1 LAPACK routine DORG2L Original DORG2L created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dorg2l generates an m by n real matrix Q with orthonormal columns, which is defined as the last n columns of a product of k elementary reflectors of order m Q = H[k-1] ... H[1] H[0] as returned by dgeqlf
        Parameters:
        m - input int The number of rows of the matrix Q. m >= 0.
        n - input int The number of columns of the matrix Q. m >= n >= 0.
        k - input int The number of elementary reflectors whose product defines the matrix Q. n >= k >= 0.
        A - input/output double[][] of dimension lda by n On entry, the (n-k+i)-th column must the the vector which defines the elementary reflector H[i], for i = 0, 1, ..., k-1, as returned by dgeqlf in the last k columns of its array argument A. On exit, the m by n matrix Q.
        lda - input int The first dimension of the array A. lda >= max(1,m).
        tau - input double[] of dimension k tau[i] must contain the scalar factor of the elementary reflector H[i], as returned by dgeqlf.
        work - workspace double[] of dimension n.
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument has an illegal value
      • dorg2r

        public void dorg2r​(int m,
                           int n,
                           int k,
                           double[][] A,
                           int lda,
                           double[] tau,
                           double[] work,
                           int[] info)
        This is a port of version 3.2 LAPACK routine DORG2R Original DORG2R created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dorg2r generates an m by n real matrix Q with orthonormal columns, which is defined as the first n columns of a product of k elementary reflectors of order m Q = H[0] H[1] ... H[k-1] as returned by dgeqrf.
        Parameters:
        m - input int The number of rows of the matrix Q. m >= 0.
        n - input int The number of columns of the matrix Q. m >= n >= 0.
        k - input int The number of elementary reflectors whose product defines the matrix Q. n >= k >= 0.
        A - input/output double[][] of dimension lda by n. On entry, the i-th column must contain the vector which defines the elementary reflector H[i], for i = 0, 1, ..., k-1, as returned by dgeqrf in the first k columns of its array argument A. On exit, the m-by-n matrix Q.
        lda - input int The first dimension of the array A. lda >= max(1,m).
        tau - input double[] of dimension k. tau[i] must contain the scalar factor of the elementary reflector H[i], as returned by dgeqrf.
        work - workspace double[] of dimension n.
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument has an illegal value.
      • dorgql

        private void dorgql​(int m,
                            int n,
                            int k,
                            double[][] A,
                            int lda,
                            double[] tau,
                            double[] work,
                            int lwork,
                            int[] info)
        This is a port of the version 3.1 LAPACK routine DORGQL Original DORGQL created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dorgql generates the m-by-n real matrix Q with orthonormal columns, which is defined as the last n columns of a product of k elementary reflectors of order m Q = H[k-1] ... H[1] H[0] as returned by dgeqlf.
        Parameters:
        m - input int The number of rows of the matrix Q. m >= 0.
        n - input int The number of columns of the matrix Q. m >= n >= 0.
        k - input int The number of elementary reflectors whose product defines the matrix Q. n >= k >= 0.
        A - input/output double[][] of dimension lda by n. On entry, the (n-k+i)-th column must contain the vector which defines the elementary reflector H[i], for i = 0, 1, ..., k-1, as returned by dgeqlf in the last k columns of its array argument A. On exit, the m-by-n matrix Q.
        lda - input int The first dimension of the array A. lda >= max(1,m).
        tau - input double[] of dimension k. tau[i] must contain the scalar factor of the elementary reflector H[i], as returned by dgeqlf.
        work - workspace/output double[] of dimension max(1, lwork). On exit, if info[0] = 0, work[0] returns the optimal lwork.
        lwork - input int The dimension of the array work. lwork >= max(1,n). For optimum performance lwork >= n*nb, where nb is 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.
        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument has an illegal value
      • dorgqr

        public void dorgqr​(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 DORGQR Original DORGQR created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dorgqr generates an m-by-n real matrix Q with orthonormal columns, which is defined as the first n columns of a product of k elementary reflectors of order m Q = H[0] H[1] ... H[k-1] as returned by dgeqrf.
        Parameters:
        m - input int The number of rows of the matrix Q. m >= 0.
        n - input int The number of columns of the matrix Q. m >= n >= 0.
        k - input int The number of elementary reflectors whose product defines the matrix Q. n >= k >= 0.
        A - input/output double[][] of dimensions lda by n. On entry, the i-th column must contain the vector which defines the elementary reflector H[i], for i = 0, 1, ..., k-1, as returned by dgeqrf in the first k columns of its array argument A. On exit, the m-by-n matrix Q.
        lda - input int The first dimension of the array A. lda >= max(1,m).
        tau - input double[] of dimension k. tau[i] must contain the scalar factor of the elementary reflector H[i], as returned by dgeqrf.
        work - (worksplace/output) double[] of dimension max(1,lwork). On exit, if info[0] = 0, work[0] returns the optimal lwork.
        lwork - input int The dimension of the array work. lwork >= max(1,n). For optimum performance lwork >= 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.
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument has an illegal value
      • dorgtr

        public void dorgtr​(char uplo,
                           int n,
                           double[][] A,
                           int lda,
                           double[] tau,
                           double[] work,
                           int lwork,
                           int[] info)
        This is a port of version 3.1 LAPACK routine DORGTR Original DORGTR created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dorgtr generates a real orthogonal matrix Q which is defined as the product of n-1 elementary reflectors of order N, as returned by dsytrd: If uplo = 'U', Q = H[n-2] ... H[1] H[0] If uplo = 'L', Q = H[0] H[1] ... H[n-2]
        Parameters:
        uplo - input char \ = 'U': Upper triangle of A contains elementary reflectors from dsytrd = 'L': Lower triangle of A contains elementary reflectors from dsytrd
        n - input int The order of the matrix Q. n >= 0.
        A - input/output double[][] of dimension lda by n On entry, the vectors which define the elementary reflectors, as returned by dsytrd. On exit, the n-by-n orthogonal matrix Q.
        lda - input int The leading dimension of the array A. lda >= max(1,n).
        tau - input double[] of dimension n-1. tau[i] must contain the scalar factor of the elementary reflector H[i], as returned by dsytrd.
        work - workspace/output double[] of dimension max(1, lwork). On exit, if info[0] = 0, work[0] returns the optimal lwork.
        lwork - input int The dimension of the array work. lwork >= max(1,n-1). For optimum performance, lwork >= (n-1)*nb, where nb is the optimal blocksize. If lwork = -1, then a workspace query is assumed; the routine only caclulates 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.
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument had an illegal value
      • dorm2l

        public void dorm2l​(char side,
                           char trans,
                           int m,
                           int n,
                           int k,
                           double[][] A,
                           int lda,
                           double[] tau,
                           double[][] C,
                           int ldc,
                           double[] work,
                           int[] info)
        This is a port of the version 3.1 LAPACK routine DORM2L Original DORM2L created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dorm2l overwrites the general real m by n matrix C with Q * C if side == 'L' and trans == 'N', or Q' * C if side == 'L' and trans == 'T', or C * Q if side == 'R' and trans == 'N', or C * Q' if side == 'R' and trans == 'T' where Q is a real orthogonal matrix defined as a product of k elementary reflectors Q = H[k-1] ... H[1] H[0] as retunred by dgeqlf. Q is of order m if side == 'L' and of order n if side == 'R'.
        Parameters:
        side - (input) char = 'L': Apply Q or Q' from the left = 'R': Apply Q or Q' from the right
        trans - (input) char = 'N': apply Q (no transpose) = 'T': apply Q' (Transpose)
        m - (input) int The number of rows of the matrix C. m >= 0.
        n - (input) int The number of columns of the matrix C. n >= 0.
        k - (input) int The number of elementary reflectors whose product defines the matrix Q. If side == 'L', m >= k >= 0. If side == 'R', n >= k >= 0.
        A - (input) double[][] of dimension (lda,k) The i-th column must contain the vector which defines the elementary reflector H(i), for i = 0, 1,...,k-1, as returned by dgeqlf in the last k column of its array argument A. A is modified by the routine but restored on exit.
        lda - (input) int The leading dimension of the array A. If side == 'L', lda >= max(1,m). If side == 'R', lda >= max(1,n).
        tau - (input) double[] of dimension (k) tau[i] must contain the scalar factor of the elementary reflector H[i], as returned by dgeqlf.
        C - (input/output) double[][]of dimension (ldc, n) On entry, the m by n matrix C. On exit, C is overwritten by Q*C or Q'*C or C*Q' or C*Q.
        ldc - (input) int The leading dimension of the array C. ldc >= max(1,m).
        work - (workspace) double[] of dimension (n) if side == 'L', (m) if side == 'R'.
        info - (output) int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value.
      • dorm2r

        public void dorm2r​(char side,
                           char trans,
                           int m,
                           int n,
                           int k,
                           double[][] A,
                           int lda,
                           double[] tau,
                           double[][] C,
                           int ldc,
                           double[] work,
                           int[] info)
        This is a port of the version 3.2 LAPACK routine DORM2R Original DORM2R created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dorm2r overwrites the general real m by n matrix C with Q * C if side = 'L' and trans = 'N', or Q'* C if side = 'L' and trans = 'T', or C * Q if side = 'R' and trans = 'N', or C * Q' if side = 'R' and trans = 'T', where Q is a real orthogonal matrix defined as the product of k elementary reflectors Q = H(0) H(1) . . . H(k-1) as returned by dgeqrf. Q is of order m if side = 'L' and of order n if side = 'R'.
        Parameters:
        side - input char = 'L': apply Q or Q' from the left = 'R': apply Q or Q' from the right
        trans - input char = 'N': apply Q (no transpose) = 'T': apply Q' (transpose)
        m - input int The number of rows of the matrix C. m >= 0.
        n - input int The number of columns of the matrix C. n >= 0.
        k - input int The number of elementary reflectors whose product defines the matrix Q. If side = 'L', m >= k >= 0 If side = 'R', n >= k >= 0
        A - input double[][] of dimension (lda, k) The i-th column must contain the vector which defines the elementary reflector H(i), for i = 0,1,...,k-1, as returned by dgeqrf in the first k columns of its array argument A. A is modified by the routine but restored on exit.
        lda - input int The leading dimension of the array A. If side = 'L', lda >= max(1,m) If side = 'R', lda >= max(1,n)
        tau - input double[] of dimension (k) tau[i] must contain the scalar factor of the elementary reflector H(i), as returned by dgeqrf.
        C - (input/output) double[][] of dimension (ldc,n) On entry, the m by n matrix C. On exit, C is overwritten by Q*C or Q'*C or C*Q' or C*Q.
        ldc - input int The leading dimension of the array C. ldc >= max(1,m).
        work - (workspace) double[] of dimension (n) if side = 'L' (m) if side = 'R'
        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value.
      • dormqr

        public void dormqr​(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)
        This is a port of version 3.2 LAPACK routine DORMQR Original DORMQR created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, and NAG Ltd., November, 2006 dormqr overwrites the general real m by n matrix C with side = 'L' side = 'R' trans = 'N': Q * C C * Q trans = 'T': Q**T * C C * Q**T where Q is a real orthogonal matrix defined as the product of k elementary reflectors Q = H(0) H(1) . . . H(k-1) as returned by dgeqrf. Q is of order m if side = 'L' and of order n if side = 'R'.
        Parameters:
        side - input char = 'L': apply Q or Q**T from the left = 'R': apply Q or Q**T from the right
        trans - trans char = 'N': No transpose, apply Q = 'T': Transpose, apply Q**T
        m - input int The number of rows of matrix C. m >= 0.
        n - input int The number of columns of matrix C. n >= 0.
        k - input int The number of elementary reflectors whose product defines the matrix Q. If side = 'L', m >= k >= 0 If side = 'R', n >= k >= 0
        A - input double[][] of dimension (lda,k) The i-th column must contain the vector which defines the elementary reflector H(i), for i = 0,1,...,k-1, as returned by dgeqrf in the first k columns of its array argument A. A is modified by the routine but restored on exit.
        lda - input int The leading dimension of the array A. If side = 'L', lda >= max(1,m) If side = 'R', lda >= max(1,n)
        tau - input double[] of dimension k tau[i] must contain the scalar factor of the elementary reflector H(i), as returned by dgeqrf
        C - (input/output) double[][] of dimension (ldc,n) On entry, the m by n matrix C. On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
        ldc - input int The leading dimension of the array C. ldc >= max(1,m).
        work - (workspace/output) double[] of dimension max(1, lwork). On exit, if info[0] = 0, work[0] returns the optimal lwork.
        lwork - input int The dimension of the array work. If side = 'L', work >= max(1,n). If side = 'R', work >= max(1,m). For optimum performance lwork >= n*nb if side = 'L', and lwork >= m*nb if side = 'R', where nb is 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 output.
        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value
      • dpotf2

        private void dpotf2​(char uplo,
                            int n,
                            double[][] A,
                            int lda,
                            int[] info)
        This is a port of the version 3.1 LAPACK routine DPOTF2 Original DPOTF2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dpotf2 computes the Cholesky factorization of a real symmetric positive definite matrix A.

        The factorization has the form A = U' * U, if UPLO = 'U', or A = L * L', if UPLO = 'L', where U is an upper triangular matrix and L is lower triangular

        This is the unblocked version of the algorithm, calling Level 2 BLAS.

        Parameters:
        uplo - input char Specifies whether the upper or lower triangular part of the symmetric matrix A is stored. = 'U': Upper triangular = 'L': Lower triangular
        n - input int The order of the matrix A. n >= 0.
        A - input/output double[][] dimension lda by n On entry, the symmetric matrix A. If UPLO = 'U', the leading n by n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo = 'L', the leading n by n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

        On exit, if info[0] = 0, the factor U or L from the Cholesky factorization A = U'*U or A = L*L'.

        lda - input int The leading dimension of the array A. lda >= max(1,n).
        info - output int[] = 0: successful exit < 0: If info[0] = -k, the k-th argument had an illegal value > 0: If info[0] = k, the leading minor of order k is not positive definite, and the factorization could not be completed.
      • dpotrf

        public void dpotrf​(char uplo,
                           int n,
                           double[][] A,
                           int lda,
                           int[] info)
        This is a port of the DPOTRF version 3.1 LAPACK routine Original DPOTRF created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dpotrf computes the Cholesky factorization of a real symmetric positive definite matrix A

        The factorization has the form A = U'*U, if uplo = 'U', or A = L * L', if uplo = 'L', where U is an upper triangular matrix and L is lower triangular

        This is the block version of the algorithm, calling Level 3 BLAS.

        Parameters:
        uplo - input char = 'U': Upper triangle of A is stored. = 'L': Lower triangle of A is stored.
        n - input int The order of the matrix A. n >= 0.
        A - (input/output) double[][] dimension (lda, n) On entry, the symmetric matrix A. If uplo == 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo == 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

        On exit, if info[0] = 0, the factor U or L from the Cholesky factorization A = U'*U or A = L*L'.

        lda - input int The leading dimension of array A. lda >= max(1,n)
        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value > 0: If info[0] = i, the leading minor of order i is not positive definite, and the factorization could not be completed.
      • dqrt01

        private void dqrt01​(int m,
                            int n,
                            double[][] A,
                            double[][] AF,
                            double[][] Q,
                            double[][] R,
                            int lda,
                            double[] tau,
                            double[] work,
                            int lwork,
                            double[] rwork,
                            double[] result)
        This is a port of version 3.1 LAPACK test routine DQRT01. 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, * ), Q( LDA, * ), $ R( LDA, * ), RESULT( * ), RWORK( * ), TAU( * ), $ WORK( LWORK ) .. Purpose ======= DQRT01 tests DGEQRF, which computes the QR factorization of an m-by-n matrix A, and partially tests DORGQR which forms the m-by-m orthogonal matrix Q. DQRT01 compares R with Q'*A, 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 QR factorization of A, as returned by DGEQRF. See DGEQRF for further details. Q (output) DOUBLE PRECISION array, dimension (LDA,M) The m-by-m orthogonal matrix Q. R (workspace) DOUBLE PRECISION array, dimension (LDA,max(M,N)) LDA (input) INTEGER The leading dimension of the arrays A, AF, Q and R. LDA >= max(M,N). TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors, as returned by DGEQRF. 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( R - Q'*A ) / ( M * norm(A) * EPS ) RESULT(2) = norm( I - Q'*Q ) / ( M * EPS )
      • dqrt02

        private void dqrt02​(int m,
                            int n,
                            int k,
                            double[][] A,
                            double[][] AF,
                            double[][] Q,
                            double[][] R,
                            int lda,
                            double[] tau,
                            double[] work,
                            int lwork,
                            double[] rwork,
                            double[] result)
        This is a port of version 3.1 LAPACK test routine DQRT02. 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, * ), Q( LDA, * ), $ R( LDA, * ), RESULT( * ), RWORK( * ), TAU( * ), $ WORK( LWORK ) .. Purpose ======= DQRT02 tests DORGQR, which generates an m-by-n matrix Q with orthonornmal columns that is defined as the product of k elementary reflectors. Given the QR factorization of an m-by-n matrix A, DQRT02 generates the orthogonal matrix Q defined by the factorization of the first k columns of A; it compares R(1:n,1:k) with Q(1:m,1:n)'*A(1:m,1:k), and checks that the columns 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. M >= N >= 0. K (input) INTEGER The number of elementary reflectors whose product defines the matrix Q. N >= K >= 0. A (input) DOUBLE PRECISION array, dimension (LDA,N) The m-by-n matrix A which was factorized by DQRT01. AF (input) DOUBLE PRECISION array, dimension (LDA,N) Details of the QR factorization of A, as returned by DGEQRF. See DGEQRF for further details. Q (workspace) DOUBLE PRECISION array, dimension (LDA,N) R (workspace) DOUBLE PRECISION array, dimension (LDA,N) LDA (input) INTEGER The leading dimension of the arrays A, AF, Q and R. LDA >= M. TAU (input) DOUBLE PRECISION array, dimension (N) The scalar factors of the elementary reflectors corresponding to the QR 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( R - Q'*A ) / ( M * norm(A) * EPS ) RESULT(2) = norm( I - Q'*Q ) / ( M * EPS )
      • dqrt03

        private void dqrt03​(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 DQRT03. 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 ======= DQRT03 tests DORMQR, which computes Q*C, Q'*C, C*Q or C*Q'. DQRT03 compares the results of a call to DORMQR with the results of forming Q explicitly by a call to DORGQR and then performing matrix multiplication by a call to DGEMM. Arguments ========= M (input) INTEGER The order of the orthogonal matrix Q. M >= 0. N (input) INTEGER The number of rows or columns of the matrix C; C is m-by-n if Q is applied from the left, or n-by-m if Q is applied from the right. N >= 0. K (input) INTEGER The number of elementary reflectors whose product defines the orthogonal matrix Q. M >= K >= 0. AF (input) DOUBLE PRECISION array, dimension (LDA,N) Details of the QR factorization of an m-by-n matrix, as returnedby DGEQRF. See SGEQRF 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,M) 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 QR 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 m-by-m orthogonal matrix Q. RESULT(1) = norm( Q*C - Q*C ) / ( M * norm(C) * EPS ) RESULT(2) = norm( C*Q - C*Q ) / ( M * norm(C) * EPS ) RESULT(3) = norm( Q'*C - Q'*C )/ ( M * norm(C) * EPS ) RESULT(4) = norm( C*Q' - C*Q' )/ ( M * norm(C) * EPS )
      • drot

        public void drot​(int n,
                         double[] dx,
                         int incx,
                         double[] dy,
                         int incy,
                         double c,
                         double s)
        This is a port of the 3/11/78 linpack routine drot Original code written by Jack Dongarra.
        Parameters:
        n - int
        dx - double[]
        incx - int
        dy - double[]
        incy - int
        c - double
        s - double
      • dscal

        public void dscal​(int n,
                          double da,
                          double[] dx,
                          int incx)
        Routine ported from 12/3/93 linpack dscal Original version written by Jack Dongarra Scales a vector by a constant.
        Parameters:
        n - int
        da - double
        dx - double[]
        incx - int
      • dsgt01

        private void dsgt01​(int itype,
                            char uplo,
                            int n,
                            int m,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            double[][] Z,
                            int ldz,
                            double[] D,
                            double[] work,
                            double[] result)
        This is a port of the version 3.1 LAPACK test routine DSGT01 Original DSGT01 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsgt01 checks a decomposition of the form A Z = B Z D or A B Z = Z D or B A Z = Z D where A is a symmetric matrix, B is symmetric positive definite, Z is orthogonal, and D is diagonal. One of the following test ratios is computed: itype = 1: result[0] = | A Z - B Z D | / ( |A| |Z| n ulp ) itype = 2: result[0] = | A B Z - Z D | / ( |A| |Z| n ulp ) itype = 3: result[0] = | B A Z - Z D | / ( |A| |Z| n ulp )
        Parameters:
        itype - input int The form of the symmetric generalized eigenproblem. = 1: A*Z = (lambda)*B*Z = 2: A*B*Z = (lambda)*Z = 3: B*A*Z = (lambda)*Z
        uplo - input char Specifies whether the upper or lower triangular part of the symmetric matrices A and B is stored. = 'U': Upper triangular = 'L': Lower triangular
        n - input int The order of the matrix A. n >= 0.
        m - input int The number of eigenvalues found. 0 <= m <= n.
        A - input double[][] of dimension (lda,n). The original symmetric matrix A.
        lda - input int The leading dimension of the array A. lda >= max(1,n).
        B - input double[][] of dimension (ldb,n). The original symmetric positive definite matrix B.
        ldb - input int The leading dimension of the array B. ldb >= max(1,n).
        Z - input double[][] of dimension (ldz,m). The computed eigenvectors of the generalized eigenproblem.
        ldz - input int The leading dimension of the array Z. ldz >= max(1,n).
        D - input double[] of dimension m. The computed eigenvalues of the generalized eigenproblem.
        work - workspace double[] of dimension n*n.
        result - output double[] of dimension 1. The test ratio as described above.
      • dstech

        private void dstech​(int n,
                            double[] A,
                            double[] B,
                            double[] eig,
                            double tol,
                            double[] work,
                            int[] info)
        This is a port of version 3.1 LAPACK test routine DSTECH Original DSTECH created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 Let T be the tridiagonal matrix with diagonal entries A[0] ,..., A[n-1] and offdiagonal entries B[0] ,..., B[n-2]). dstech checks to see if eig[0], ..., eig[n-1] are indeed accurate eigenvalues of T. It does this by expanding each eig[i] into an interval [svd[i] - eps, svd[i] + eps], merging overlapping intervals if any, and using Sturm sequences to count and verify whether each resulting interval has the correct number of eigenvalues (using dstect). Here eps = tol * mazheps * maxeig, where macheps is the machine precision and maxeig is the absolute value of the largest eigenvalue. If each interval contains the correct number of eigenvalues, info[0] = 0 is returned, otherwise info is the index of the first eigenvalue in the first bad interval.
        Parameters:
        n - (input) int The dimension of the tridiagonal matrix T.
        A - (input) double[] of dimension (n) The diagonal entries of the tridiagonal matrix T.
        B - (input) double[] of dimension (n-1) The offdiagonal entries of the tridiagonal matrix T.
        eig - (input) double[] of dimension (n) The purported eigenvalues to be checked.
        tol - double Error tolerance for checking, a multiple of the machine precision.
        work - (workspace) double[] of dimension (n)
        info - (output) int[] 0 if the eigenvalues are all correct (to within 1 +- tol*mazheps*maxeig >0 if the interval containing the info-th eigenvalue contains the incorrect number of eigenvalues.
      • dstect

        private void dstect​(int n,
                            double[] A,
                            double[] B,
                            double shift,
                            int[] num)
        This is a port of version 3.1 LAPACK test routine DSTECT Original DSTECT created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dstect counts the number num of eigenvalues of a tridiagonal matrix T which are less than or equal to shift. T has diagonal entries A[0], ... , A[n-1], and offdiagonal entries B[0], ..., B[n-1]. See W. Kahan "Accurate Eigenvalues of a Symmetric TriDiagonal Matrix", Report CS41, Computer Science Department, Stanford University, July 21, 1966
        Parameters:
        n - (input) int The dimension of the tridiagonal matrix T.
        A - (input) double[] of dimension (n) The diagonal entries of the tridiagonal matrix T.
        B - (input) double[] of dimension (n-1) The offdiagonal entries of the tridiagonal matrix T.
        shift - (input) double The shift used.
        num - (output) int[] The number of eigenvalues of T less than or equal to shift.
      • dsteqr

        public void dsteqr​(char compz,
                           int n,
                           double[] d,
                           double[] e,
                           double[][] Z,
                           int ldz,
                           double[] work,
                           int[] info)
        This is a port of version 3.1 LAPACK routine DSTEQR Original DSTEQR created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsteqr computes all eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal matrix using the implicit QL or QR method. The eigenvectors of a full or band symmetric matrix can also be found if dsytrd or dsptrd or dsbtrd has been used to reduce this matrix to tridiagonal form.
        Parameters:
        compz - input char = 'N': Compute eigenvalues only. = 'V': Compute eigenvalues and eigenvectors of the original symmetric matrix. On entry, Z must contain the orthogonal matrix used to reduce the original matrix to tridiagonal form. = 'I': Compute eigenvalues and eigenvectors of the tridiagonal matrix. Z is initialized to the identity matrix.
        n - input int The order of the matrix. n >= 0.
        d - input/output double[] of dimension n. On entry, the diagonal elements of the tridiagonal matrix. On exit, if info = 0, the eigenvalues in ascending order.
        e - input/output double[] of dimension n-1 On entry, the (n-1) subdiagonal elements of the tridiagonal matrix. On exit, e has been destroyed.
        Z - input/output double[][] of dimension ldz by n. On entry, if compz = 'V', then Z contains the orthogonal matrix used in reduction to tridiagonal form. On exit, if info[0] = 0, then if compz = 'V', Z contains the orthonormal eigenvectors of the original symmetric matrix. and if compz = 'I', Z contains the orthonormal eigenvectors of the symmetric tridiagonal matrix. If compz = 'N', then Z is not referenced.
        ldz - input int The leading dimension of the array Z. ldz >= 1, and if eigenvectors are desired, then ldz >= max(1,n).
        work - workspace double[] of dimension max(1,2*n-2). If compz = 'N', then work is not referenced.
        info - output int[] = 0: successful exit. < 0: If info[0] = -i, then the i-th argument had an illegal value > 0: The algorithm failed to find all the eigenvalues in a total of 30*n iterations; if info[0]= i, then i elements of e have not converged to zero; on exit, d and e contain the elements of a symmetric tridiagonal matrix which is orthogonally similar to the original matrix.
      • dsterf

        public void dsterf​(int n,
                           double[] d,
                           double[] e,
                           int[] info)
        This is a port of version 3.1 LAPACK routine DSTERF Original DSTERF created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsterf computes all the eigenvalues of a symmetric tridiagonal matrix using the Pal-Walker-Kahan variant of the QL or QR algorithm.
        Parameters:
        n - input int The order of the matrix. n >= 0.
        d - input/output double[] of dimension n. On entry, the n diagonal elements of the tridiagonal matrix. On exit, if info[0] = 0, the eigenvalues in ascending order
        e - input/order double[] of dimension n-1 On entry, the (n-1) subdiagonal elements in the tridiagonal matrix. On exit, e has been destroyed.
        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value > 0: The algorithm failed to find all of the eigenvalues in a total of 30*n iterations; if info = i, then i elements of e have not converged to zero.
      • dstt21

        public void dstt21​(int n,
                           int kband,
                           double[] AD,
                           double[] AE,
                           double[] SD,
                           double[] SE,
                           double[][] U,
                           int ldu,
                           double[] work,
                           double[] result)
        This is a port of version 3.1 LAPACK test routine DSTT21 Original DSTT21 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dstt21 checks a decomposition of the form A = U S U' where ' means transpose, A is symmetric tridiagonal, U is orthogonal, and S is diagonal (if kband == 0) or symmetric tridagonal (if kband == 1). Two tests are performed: result[0] = | A - U S U' | / ( |A| n ulp ) result[1] = | I - UU' | / ( n ulp )
        Parameters:
        n - (input) int The size of the matrix. If it is zero, dstt21 does nothing. It must be at least zero.
        kband - (input) int The bandwidth of the matrix S. It may only be zero or one. If zero, then S is diagonal, and SE is not referenced. If one, then S is symmetric tri-diagonal.
        AD - (input) double[] of dimension (n) The diagonal of the original (unfactored) matrix A. A is assumed to be symmetric tridiagonal.
        AE - (input) double[] of dimension (n-1) The off-diagonal of the original (unfactored) matrix A. A is assumed to be symmetric tridiagonal. AE[0] is the [0][1] and [1][0] element, AE[1] is the [1][2] and [2][1] element, etc.
        SD - (input) double[] of dimension (n) The diagonal of the (symmetric tri-) diagonal matrix S.
        SE - (input) double[] of dimension (n-1) The off-diagonal of the (symmetric tri-) diagonal matrix S. Not referenced if kband == 0. If kband == 1, then SE[0] is the [0][1] and [1][0] element, SE[1] is the [1][2] and [2][1] element, etc.
        U - (input) double[][] of dimension (ldu, n) The orthogonal matrix in the decomposition.
        ldu - (input) int The leading dimension of U. ldu must be at least n.
        work - (workspace) double[] of dimension (n*(n+1))
        result - (output) double[] of dimension (2) The values computed by the two tests described above. The values are currently limited to 1/ulp, to avoid overflow. result[0] is always modified.
      • dsygs2

        private void dsygs2​(int itype,
                            char uplo,
                            int n,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            int[] info)
        This is a port of the LAPACK version 3.1 DSYGS2 routine Original DSYGS2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 DSYGS2 reduces a real symmetric-definite generalized eigenproblem to standard form.

        If itype = 1, the problem is A*x = lambda*B*x, and A is overwritten by inv(U')*A*inv(U) or inv(L)*A*inv(L')

        if itype = 2 or 3, the problem is A*B*x = lambda*x or B*A*x = lambda*x, and A is overwritten by U*A*U' or L'*A*L.

        B must have been previously factorized as U'*U or L*L' by dpotrf.

        Parameters:
        itype - input int = 1: Compute inv(U')*A*inv(U) or inv(L)*A*inv(L') = 2 or 3: Compute U*A*U' or L'*A*L
        uplo - input char Specifies whether the upper or lower triangular part of the symmetric matrix A is stored, and how B has been factorized. = 'U': Upper triangular = 'L': Lower triangular
        n - input int The order of matrices A and B. n >= 0.
        A - input/output double[][] dimension lda by n On entry, the symmetric matrix A. If uplo = 'U', the leading n by n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo = 'L', the leading n by n lower triangular part of A contains the lower triangular part of the matrix A and the strictly upper triangular part of A is not referenced.

        On exit, if info[0] = 0, the transformed matrix is stored in the same format as A.

        lda - input int The leading dimension of array A. lda >= max(1,n).
        B - input double[][] dimension ldb by n. The triangular factor from the Cholesky factorization of B, as returned by dpotrf.
        ldb - input int The leading dimension of array B. ldb >= max(1,n).
        info - output int[] = 0: successful exit < 0: If info[0] = -i, the i-th argument had an illegal value
      • dsygst

        private void dsygst​(int itype,
                            char uplo,
                            int n,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            int[] info)
        This routine is a port of the version 3.1 LAPACK routine DSYGST Original DSYGST created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsygst reduces a real symmetric-definite generalized eigenproblem to standard form.

        If itype = 1, the problem is A*x = lambda*B*x and A is overwritten by inv(U')*A*inv(U) or inv(L)*A*inv(L')

        if itype = 2 or 3, the problem is A*B*x = lambda*x or B*A*x = lambda*x, and A is overwritten by U*A*U' or L'*A*L

        B must have been previously factorized as U'*U or L*L' by dpotrf

        Parameters:
        itype - input int = 1: compute inv(U')*A*inv(U) or inv(L)*A*inv(L') = 2 or 3: compute U*A*U' or L'*A*L
        uplo - input char = 'U': Upper triangle of A is stored and B is factored as U'*U = 'L': Lower triangle of A is stored and B is factored as L*L'
        n - input int The order of matrices A and B. n >= 0.
        A - input/output double[][] dimension lda by n On entry, the symmetric matrix A. If uplo = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of matrix A, and the strictly lower triangular part of A is not referenced. If uplo = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of matrix A, and the strictly upper triangular part of A is not referenced.

        On exit, if info[0] = 0, the transformed matrix, stored in the same format as A.

        lda - input int The leading dimension of array A. lda >= max(1,n).
        B - input double[][] dimension ldb by n. The triangular factor from the Cholesky factorization of B, as returned by dpotrf
        ldb - input int The leading dimension of array B. ldb >= max(1,n).
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument had an illegal value
      • dsymm

        public void dsymm​(char side,
                          char uplo,
                          int m,
                          int n,
                          double alpha,
                          double[][] A,
                          int lda,
                          double[][] B,
                          int ldb,
                          double beta,
                          double[][] C,
                          int ldc)
        This is a port of the 2/8/89 Blas routine DSYMM Original version written by: Jack Dongarra, Argonne National Lab. Iain Duff, AERE Harwell. Jeremy Du Croz, Numerical Algorithms Group Ltd. Sven Hammarling, Numerical Algorithms Group Ltd. dsymm performs one of the matrix operations C = alpha*A*B + beta*C or C = alpha*B*A + beta*C, where alpha and beta are scalars, A is a symmetric matrix and B and C are m by n matrices
        Parameters:
        side - input char On entry, side specifies whether the symmetric matrix A appears on the left or right in the operation as follows: = 'L' or 'l' C = alpha*A*B + beta*C = 'R' or 'r' C + alpha*B*A + beta*C
        uplo - input char On entry, uplo specifies whether the upper or lower triangular part of the symmetric matrix A is to be referenced as follows: = 'U' or 'u' Only the upper triangular part of the symmetric matrix is to be referenced. = 'L' or 'l' Only the lower triangular part of the symmetric matrix is to be referenced.
        m - input int On entry, m specifies the number of rows of the matrix C. m must be at least zero.
        n - input int On entry, n specifies the number of columns of the matrix C. n must be at least zero.
        alpha - double Specifies scalar.
        A - input double[][] of dimension lda by ka, where ka is m when side = 'L' or 'l' and is n otherwise. Before entry with side = 'L' or 'l', the m by m part of the array A must contain the symmetric matrix, such that when uplo = 'U' or 'u', the leading m by m upper triangular part of the array A must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of A is not referenced, and when uplo = 'L' or 'l', the leading m by m lower triangular part of the array A must contain the lower triangular part of the symmetric matrix and the strictly uppper triangular part of A is not referenced. Before entry with side = 'R' or 'r', the n by n part of the array A must contain the symmetric matrix, such that when uplo = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of A is not referenced, and when uplo = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of A is not referenced.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. When side = 'L' or 'l', then lda must be at least max(1,m), otherwise lda must be at least max(1,n).
        B - input double[][] of dimension ldb by n. Before entry, the leading m by n part of the array B must contain the matrix B.
        ldb - input int On entry, ldb specifies the first dimension of B as declared in the calling (sub) program. ldb must be at least max(1,m).
        beta - beta double Specified scalar. When beta is supplied as zero, then C need not be set on input.
        C - input/output double[][] of dimension ldc by n. Before entry, the leading m by n part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the array C is overwritten by the m by n updated matrix.
        ldc - input int On entry, ldc specifies the first dimension of C as declared in the calling (sub) program. ldc must be at least max(1,m).
      • dsymv

        public void dsymv​(char uplo,
                          int n,
                          double alpha,
                          double[][] A,
                          int lda,
                          double[] x,
                          int incx,
                          double beta,
                          double[] y,
                          int incy)
        This is a port of the 10/22/86 Blas routine DSYMV Original code written by: Jack Dongarra, Argonne Nationa Lab. Jeremy Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs. dsymv performs the matrix-vector operation y = alpha*A*x + beta*y where alpha and beta are scalars, x and y are n element vectors and A is an n by n symmetric matrix.
        Parameters:
        uplo - input char On entry, uplo specifies whether the upper or lower triangular part of the array A is to be referenced as follows: = 'U' or 'u' Only the upper triangular part of A is to be referenced. = 'L' or 'l' Only the lower triangular part of A is to be referenced.
        n - input int On entry, n specifies the order of the matrix A. n must be at least zero.
        alpha - input double Specified scalar
        A - input double[][] of dimension lda by n Before entry with uplo = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triagular part of the symmetric matrix and the strictly lower triangular part of A is not referenced. Before entry with uplo = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of A is not referenced.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. lda must be at least max(1,n).
        x - input double[] of dimension at least (1 + (n-1)*abs(incx)). Before entry, the incremented array x must contain the n element vector x.
        incx - input int On entry, incx specifies the increment for the elements of x. incx must not be zero.
        beta - input double On entry, beta specifies the scalar beta. When beta is supplied as zero, then y need not be set on input.
        y - input/output double[] of dimension at least (1 + (n-1)*abs(incy)). Before entry, the incremented array y must contain the n element vector y. On exit, y is overwritten by the updated vector y.
        incy - input int On entry, incy specifies the increment for the elements of y. incy must not be zero.
      • dsyr

        public void dsyr​(char uplo,
                         int n,
                         double alpha,
                         double[] x,
                         int incx,
                         double[][] A,
                         int lda)
        This is a port of level 2 Blas routine DSYR Original routine written on 22-October-1986 by Jack Dongarra, Argonne National Lab. Jermey Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs. dsyr performs the symmetric rank 1 operation A = alpha*x*x' + A, where alpha is a real scalar, x is an n element vector and A is an n by n symmetric matrix.
        Parameters:
        uplo - (input) char On entry, uplo specifies whether the upper or lower triangular part of the array A is to be referenced as follows: uplo = 'U' or 'u' Only the upper triangular part of A is to be referenced. uplo = 'L' or 'l' Only the lower triangular part of A is to be referenced. Unchanged on exit.
        n - (input) int On entry, n specifies the order of the matrix A. n must be at least zero. Unchanged on exit.
        alpha - (input) double On entry, alpha specifies the scalar alpha. Unchanged on exit.
        x - (input) double[] of dimension at least (1 + (n-1)*abs(incx)). Before entry, the incremented array x must contain the n element vector x. Unchanged on exit.
        incx - (input) int On entry, incx specifies the increment for the elements of x. incx must not be zero. Unchanged on exit.
        A - (input/output) double[][] of dimension (lda,n). Before entry with uplo = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of A is not referenced. On exit, the upper triangualr part of the array A is overwritten by the upper triangular part of the updated matrix. Before entry with uplo = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of A is not referenced. On exit, the lower triangular part of the array A is overwritten by the lower triangular part of the updated matrix.
        lda - (input) int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. lda must be at least max(1,n). Unchanged on exit.
      • dsyr2

        public void dsyr2​(char uplo,
                          int n,
                          double alpha,
                          double[] x,
                          int incx,
                          double[] y,
                          int incy,
                          double[][] A,
                          int lda)
        Port of 10/22/86 Blas DSYR2 routine Original version written by: Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs. dsyr2 performs the symmetric rank 2 operation A = alpha*x*y' + alpha*y*x' + A, where alpha is a scalar, x and y are n element vectors, and A is an n by n symmetric matrix.
        Parameters:
        uplo - input char On entry, uplo specifies whether the upper or lower triangular part of the array A is to be referenced as follows: = 'U' or 'u' Only the upper triangular part of A is to be referenced. = 'L' or 'l' Only the lower triangular part of A is to be referenced.
        n - input int On entry, n specifies the order of the matrix A. n must be at least zero.
        alpha - input double specified scalar
        x - input double[] of dimension at least (1 + (n-1)*abs(incx)). Before entry, the incremented array x must contain the n element vector x.
        incx - input int On entry, incx specifies the increment for the elements of x. incx must not be zero.
        y - input double[] of dimension at least (1 + (n-1)*abs(incy)). Before entry, the incremented array y must contain the n element vector y.
        incy - input int On entry, incy specifies the increment for the elements of y. incy must not be zero.
        A - input/output double[][] of dimension lda by n. Before entry with uplo = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of A is not referenced. On exit, the upper triangular part of the array A is overwritten by the upper triangular part of the updated matrix. Before entry with uplo = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of A is not referenced. On exit, the lower triangular part of the array A is overwritten by the lower triangular part of the updated matrix.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. lda must be at least max(1,n).
      • dsyr2k

        private void dsyr2k​(char uplo,
                            char trans,
                            int n,
                            int k,
                            double alpha,
                            double[][] A,
                            int lda,
                            double[][] B,
                            int ldb,
                            double beta,
                            double[][] C,
                            int ldc)
        This is a port of the 2/8/89 Blas routine DSYR2K Original version written by: Jack Dongarra, Argonne National Lab. Iain Duff, AERE Harwell. Jeremy Du Croz, Numerical Algorithms Group Ltd. Sven Hammarling, Numerical Algorithms Group Ltd. dsyr2k performs one of the symmeric rank 2k operations C = alpha*A*B' + alpha*B*A' + beta*C, or C = alpha*A'*B + alpha*B'*A + beta*C, where alpha and beta are scalars, C is an n by n symmetric matrix and A and B are n by k matrices in the first case and k by n matrices in the second case.
        Parameters:
        uplo - input char On entry, uplo specifies whether the upper or lower triangular part of the array C is to be referenced as follows: = 'U' or 'u' Only the upper triangular part of C is to be referenced. = 'L' or 'l' Only the lower triangular part of C is to be referenced
        trans - input char On entry, trans specifies the operation to be performed as follows: = 'N' or 'n' C = alpha*A*B' + alpha*B*A' + beta*C = 'T' or 't' C = alpha*A'*B + alpha*B'*A + beta*C = 'C' or 'c' C = alpha*A'*B + alpha*B'*A + beta*C
        n - input int On entry, n specifies the order of the matrix C. n must be at least zero.
        k - input int On entry with trans = 'N' or 'n', k specifies the number of columns of the matrices A and B, and on entry with trans = 'T' or 't' or 'C' or 'c', k specifies the number of rows of the matrices A and B. k must be at least zero.
        alpha - input double Specifies scalar.
        A - input double[][] of dimension lda by ka, where ka is k when trans = 'N' or 'n', and is n otherwise. Before entry with trans = 'N' or 'n', the leading n by k part of the array A must contain the matrix A, otherwise the leading k by n part of the array A must contain the matrix A.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. When trans = 'N' or 'n' then lda must be at least max(1,n), otherwise lda must be at least max(1,k).
        B - input double[][] of dimension ldb by kb, where kb is k when trans = 'N' or 'n', and is n otherwise. Before entry with trans = 'N' or 'n', the leading n by k part of the array B must contain the matrix B, otherwise the leading k by n part of the array B must contain the matrix B.
        ldb - input int On entry, ldb specifies the first dimension of B as declared in the calling (sub) program. When trans = 'N' or 'n', then ldb must be at least max(1,n), otherwise ldb must be at least max(1,k).
        beta - input double Specified scalar
        C - input/output double[][] of dimension ldc by n Before entry with uplo = 'U' or 'u', the leading n by n upper triangular part of the array C must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of C is not referenced. On exit, the upper triangular part of the array C is overwritten by the upper triangular part of the updated matrix. Before entry with uplo = 'L' or 'l', the leading n by n lower triangular part of the array C must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of C is not referenced. On exit, the lower triangular part of the array C is overwritten by the lower triangular part of the updated matrix.
        ldc - input int On entry, ldc specifies the first dimension of C as declared in the calling (sub) program. ldc must be at least max(1,n).
      • dsyrk

        public void dsyrk​(char uplo,
                          char trans,
                          int n,
                          int k,
                          double alpha,
                          double[][] A,
                          int lda,
                          double beta,
                          double[][] C,
                          int ldc)
        dsyrk is the port of the 2/8/89 blas DSYRK routine. Original version written by: Jack Dongarra, Argonne National Laboratory. Iain Duff, AERE Harwell. Jeremy Du Croz, Numerical Algorithms Group Ltd. Sven Hammarling, Numerical Algorithms Group Ltd. dsyrk performs one of the symmetric rank k operations C = alpha*A*A' + beta*C, or C = alpha*A'*A + beta*c where alpha and beta are scalars, C is an n by n symmetric matrix and A is an n by k matrix in the frist case and a k by n matrix in the second case.
        Parameters:
        uplo - input char On entry, uplo specifies whether the upper or lower triangular part of the array C is to be referenced as follows: = 'U' or 'u' Only the upper triangular part of C is to be referenced. = 'L' or 'l' Only the lower triangular part of C is to be referenced.
        trans - input char On entry, trans specifies the operation to be performed as follows: = 'N' or 'n' C = alpha*A*A' + beta*C. = 'T' or 't' C = alpha*A'*A + beta*C. = 'C' or 'c' C = alpha*A'*A + beta*C.
        n - input int On entry, n specifies the order of the matrix C. n must be at least zero.
        k - input int On entry with trans = 'N' or 'n', k specifies the number of columns of the matrix A, and on entry with trans = 'T' or 't' or 'C' or 'c', k specifies the number of rows of the matrix A. k must be at least zero.
        alpha - input double specified scalar
        A - input double[][] array of dimension lda by ka, where ka is k when trans = 'N' or 'n', and is n otherwise. Before entry with trans = 'N' or 'n', the leading n by k part of the array A must contain the matrix A, otherwise the leading k by n part of the array A must contain the matrix A.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. When trans = 'N' or 'n' then lda must be at least max(1,n), otherwise lda must be at least max(1,k).
        beta - input double specified scalar
        C - input/output double[][] array of dimension ldc by n Before entry with uplo = 'U' or 'u', the leading n by n upper triangular part of the array C must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of C is not referenced. On exit, the upper triangular part of the array C, is overwritten by the upper triangular part of the updated matrix. Before entry with uplo = 'L' or 'l', the leading n by n lower triangular part of the array C must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of C is not referenced. On exit, the lower triangular part of the array C is overwritten by the lower triangular part of the updated matrix.
        ldc - input int On entry, ldc specifies the first dimension of C as declared in the calling (sub) program. ldc must be at least max(1,n).
      • dsyt21

        public void dsyt21​(int itype,
                           char uplo,
                           int n,
                           int kband,
                           double[][] A,
                           int lda,
                           double[] D,
                           double[] E,
                           double[][] U,
                           int ldu,
                           double[][] V,
                           int ldv,
                           double[] tau,
                           double[] work,
                           double[] result)
        This is a port of version 3.1 LAPACK test routine DSYT21 Original DSYT21 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsyt21 generally checks a decomposition of the form A = U S U' where ' means transpose, A is symmetric, U is orthogonal, and S is diagonal (if kband == 0) or symmetric tridiagonal (if kband == 1).

        If itype == 1, then U is represented as a dense matrix; otherwise U is expressed as a product of Householder transformations, whose vectors are stored in the array "V" and whose scaling constants are in "tau". We shall use the letter "V" to refer to the product of Householder transformations (which should be equal to U).

        Specifically, if itype == 1, then: result[0] = | A - U S U' | / ( |A| n ulp ) *and* result[1] = | I - UU' | / (n ulp )

        If itype == 2, then: result[0] = | A - V S V' | / ( |A| n ulp )

        If itype == 3, then: result[0] = | I - VU' | / ( n ulp )

        For itype > 1, the transformation U is expressed as a product V = H(0)...H(n-1), where H(j) = I - tau(j) v(j) v(j)' and each vector v(j) has its first j elements 0 and the remaining n-j elements stored in V(j:n-1,j-1).

        Parameters:
        itype - (input) int Specifies the type of tests to be performed. 1: U expressed as a dense orthogonal matrix: result[0] = | A - U S U' | / ( |A| n ulp ) *and* result[1] = | I - UU' | / ( n ulp ) 2: U expressed as a product V of Householder transformations: result[0] = | A - V S V' | / ( |A| n ulp ) 3: U expressed both as a dense orthogonal matrix and as a product of Householder transformations: result[0] = | I - VU' | / ( n ulp )
        uplo - (input) char If uplo == 'U', the upper triangle of A and V will be used and the (strictly) lower triangle will not be referenced. If uplo == 'L', the lower triangle of A and V will be used and the (strictly) upper triangle will not be referenced.
        n - (input) int The size of the matrix. If it is zero, dsyt21 does nothing. It must be at least zero.
        kband - (input) int The bandwidth of the matrix. It may only be zero or one. If zero, then S is diagonal, and E is not referenced. If one, then S is symmetric tri-diagonal.
        A - (input) double[][] of dimension (lda,n) The original (unfactored) matrix. It is assumed to be symmetric, and only the upper (uplo == 'U') or only the lower (uplo == 'L') will be referenced.
        lda - (input) int The leading dimension of A. It must be at least 1 and at least n.
        D - (input) double[] of dimension (n) The diagonal of the (symmetric tri-) diagonal matrix.
        E - (input) double[] of dimension (n-1) The off-diagonal of the (symmetric tri-) diagonal matrix. E[0] is the [0][1] and [1][0] element, E[1] is the [1][2] and [2][1] element, etc. Not referenced if kband == 0.
        U - (input) double[][] of dimension (ldu,n) If itype == 1 or 3, this contains the orthogonal matrix in the decomposition, expressed as a dense matrix. If itype == 2, then it is not referenced.
        ldu - (input) int The leading dimension of U. ldu must be at least n and at least 1.
        V - (input) double[][] of dimension (ldv,n) If itype == 2 or 3, the columns of this array contain the Householder vectors used to describe the orthogonal matrix in the decomposition. If uplo == 'L', then the vectors are in the lower triangle, if uplo == 'U', then in the upper triangle. *Note* If itype == 2 or 3, V is modified and restored. The subdiagonal (if uplo == 'L') or the superdiagonal (if uplo == 'U') is set to one, and later reset to its original value, during the course of the calculation. If itype == 1, then it is neither referenced nor modified.
        ldv - (input) int The leading dimension of V. ldv must be at least n and at least 1.
        tau - (input) double[] of dimension (n) If itype >= 2, then tau[j] is the scalar factor of v(j) v(j)' in the Householder transformation H(j) of the product U = H(0)...H(n-3) If itype < 2, then tau is not referenced.
        work - (workspace) double[] of dimension (2*n**2)
        result - (output) double[] of dimension (2) The values computed by the two tests are described above. The values are currently limited to 1/ulp, to avoid overflow. result[0] is always modified. result[1] is modified only if itype == 1.
      • dsytd2

        private void dsytd2​(char uplo,
                            int n,
                            double[][] A,
                            int lda,
                            double[] d,
                            double[] e,
                            double[] tau,
                            int[] info)
        This is a port of the version 3.1 LAPACK routine DSYTD2 Original DSYTD2 created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsytd2 reduces a real symmetric matrix A to symmetric tridiagonal form T by an orthogonal similarity transformation: Q' * A * Q = T.
        Parameters:
        uplo - input char Specifies whether the upper or lower triangular part of the symmetric matrix A is stored: = 'U': Upper triangular = 'L': Lower triangular
        n - input int The order of the matrix A. n >= 0.
        A - input/output double[][] of dimension lda by n On entry, the symmetric matrix A. If uplo = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, if uplo = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the array tau, represent the orthogonal matrix Q as a product of elementary reflectors; if uplo = 'L', the diagonal and first subdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array tau, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details.
        lda - input int The leading dimension of the array A. lda >= max(1,n).
        d - output double[] of dimension n. The diagonal elements of the tridiagonal matrix T: D[i] = A[i][i].
        e - output double[] of dimension n-1. The off-diagonal elements of the tridiagonal matrix T: e[i] = A[i][i+1] if uplo = 'U', e[i] = A[i+1][i] if uplo = 'L'
        tau - output double[] of dimension n-1. The scalar factors of the elementary reflectors (see Furtehr Details).
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument had an illegal value

        Further Details: If uplo = 'U', the matrix Q is represented as a product of elementary reflectors Q = H[n-2] ... H[1] H[0] Each H[i] has the form H[i] = I - tau * v * v' where tau is a real scalar, and v is a real vector with v(i:n-1) = 0 and v(i-1) = 1; v(0:i-2) is stored on exit in A(0:i-2,i), and tau in tau[i-1]. If uplo = 'L', the matrix Q is represented as a product of elementary refelectors Q = H[0] H[1] ... H[n-2] Each H[i] has the form H[i] = I - tau * v * v' where tau is a real scalar, and v is a real vector with v(0:i-1) = 0 and v(i) = 1; v(i+1:n-1) is stored on exit in A(i+1:n-1,i-1), and tau in tau[i-1].

        The contents of A on exit are illustrated by the following examples with n = 5: If uplo = 'U': (d e v2 v3 v4 ) ( d e v3 v4 ) ( d e v4 ) ( d e ) ( d ) If Uplo = 'L': (d ) (e d ) (v1 e d ) (v1 v2 e d ) (v1 v2 v3 e d ) where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H[i].

      • dsytrd

        public void dsytrd​(char uplo,
                           int n,
                           double[][] A,
                           int lda,
                           double[] d,
                           double[] e,
                           double[] tau,
                           double[] work,
                           int lwork,
                           int[] info)
        This is a port of the version 3.1 LAPACK routine DSYTRD Original DSYTRD created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dsytrd reduces a real symmetric matrix A to a real symmetric tridiagonal form T by an orthogonal similarity transformation. Q'*A*Q = T.
        Parameters:
        uplo - input char = 'U': Upper triangle of A is stored. = 'L': Lower triangle of A is stored.
        n - input int The order of the matrix A. n >= 0.
        A - input/output double[][] of dimension lda by n On entry, the symmetric matrix A. If uplo = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If uplo = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, if uplo = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the array tau, represent the orthogonal matrix Q as a product of elementary reflectors; if uplo = 'L', the diagonal and first subdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array tau, represent the orthogonal matrix Q as a product of elementary reflectors. See further details.
        lda - input int The leading dimension of the array A. lda >= max(1,n).
        d - output double[] of dimension n The diagonal elements of the tridiagonal matrix T: d[i] = A[i][i].
        e - output double[] of dimension n-1. The off-diagonal elements of the tridiagonal matrix T: e[i] = A[i][i+1] if uplo = 'U', e[i] = A[i+1][i], if uplo = 'L'.
        tau - output double[] of dimension n-1. The scalar factors of the elementary reflectors (see Further Details).
        work - (workspace/output) double[] of dimension max(1, lwork). On exit, if info[0] = 0, work[0] returns the optimal lwork.
        lwork - input int The dimension of the array work. lwork >= 1. For optimum performance lwork >= 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.
        info - output int[] = 0: successful exit < 0: If info = -i, the i-th argument had an illegal value

        Further details: If uplo = 'U', the matrix Q is represented as a product of elementary reflectors Q = H[n-2]...H[1] H[0]. Each H[i] has the form H[i] = I - tau * v * v' where tau is a real scalar, and v is a real vector with v(i:n-1) = 0 and v[i-1] = 1; v(0:i-2) is stored on exit in A(0:i-2,i), and tau in tau[i-1]. If uplo = 'L', the matrix Q is represented as a product of elementary reflectors Q = H[0] H[1] ... H[n-2] Each H[i] has the form H[i] = I - tau * v * v' where tau is a real scalar, and v is a real vector with v(0:i-1) = 0 and v(i) = 0; v(i+1:n-1) is stored on exit in A(i+1:n-1,i-1), and tau in tau[i-1].

        The contents of A on exit are illustrated by the following examples with n = 5: If uplo = 'U': (d e v2 v3 v4) ( d e v3 v4) ( d e v4) ( d e) ( d) If uplo = 'L': (d ) (e d ) (v1 e d ) (v1 v2 e d ) (v1 v2 v3 e d) where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H[i].

      • dtgevc

        private void dtgevc​(char side,
                            char howmny,
                            boolean[] select,
                            int n,
                            double[][] S,
                            int lds,
                            double[][] P,
                            int ldp,
                            double[][] vl,
                            int ldvl,
                            double[][] vr,
                            int ldvr,
                            int mm,
                            int[] m,
                            double[] work,
                            int[] info)
        This is a port of version 3.1 LAPACK routine DTGEVC Original DTGEVC created by Univ. of Tennessee, Univ. of California Berkeley, and NAG Ltd., November, 2006 dtgevc computes some or all of the right and/or left eigenvectors of a pair of real eigenvectors of a pair of real matrices (S,P), where S is a quasi-triangular matrix and P is upper triangular. Matrix pairs of this type are produced by the generalized Schur factorization of a matrix pair (A,B): A = Q*S*Z**T, B = Q*P*Z**T as computed by dgghrd + dhgeqz The right eigenvector x and the left eigenvector y of (S, P) corresponding to an eigenvalue w are defined by: S*x = w*P*x, (y**H)*S = w*(y**H)*P, where y**H denotes the conjugate transpose of y. The eigenvalues are not input to this routine, but are computed directly from the diagonal blocks of S and P. This routine returns the matrices X and/or Y of right and left eigenvectors of (S,P), or the products Z*X and/or Q*Y, where Z and Q are input matrices. If Q and Z are the orthogonal factors from the generalized Schur factorization of a matrix pair (A,B), then Z*X and Q*Y are the matrices of right and left eigenvectors of (A, B).
        Parameters:
        side - input char = 'R': compute right eigenvectors only = 'L': compute left eigenvectors only = 'B': compute both right and left eigenvectors
        howmny - input char = 'A': compute all right and/or left eigenvectors = 'B': compute all right and/or left eigenvectors, backtransformed by the matrices in vr and/or vl = 'S': Compute selected right and/or left eigenvectors, specified by the boolean array select
        select - input boolean[] of dimension (n) If howmny = 'S', select specifies the eigenvectors to be computed. If w[j] is a real eigenvalue, the corresponding real eigenvector is computed if select[j] is true. If w[j] and w[j+1] are real and imaginary parts of a complex eigenvalue, the corresponding complex eigenvector is computed if either select[j] or select[j+1] is true, and on exit select[j] is set to true and select[j+1] is set to false. Not referenced if howmny == 'A' or 'B'.
        n - input int The order of the matrices S and P. n >= 0.
        S - input double[][] of dimension (lds,n) The upper quasi-triangular matrix S from a generalized Schur factorization, as computd by dhgeqz,
        lds - input int The leading dimension of array S. lds >= max(1,n).
        P - input double[][] of dimension (ldp,n) The upper triangular matrix P from a generalized Schur factorization, as computed by dhgeqz. 2-by-2 diagonal blocks of P corresponding to 2-by-2 blocks of S must be in positive diagonal form.
        ldp - input int The leading dimension of the array P. ldp >= max(1,n).
        vl - (input/output) double[][] of dimension (ldvl,mm) On entry, if side = 'L' or 'B' and howmny = 'B', vl must contain an n-by-n matrix Q (usually the orthogonal matrix Q of left Schur vectors returned by dhgeqz). On exit, if side = 'L' or 'B', vl contains: if howmny = 'A', the matrix Y of left eigenvectors of (S,P) if howmny = 'B', the matrix Q*Y if howmny = 'S', the left eigenvectors of (S,P) specified by select, stored consecutively in the columns of vl, in the same order as their eigenvalues.

        A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part, and the second the imaginary part. Not referenced if side == 'R'.

        ldvl - input int The leading dimension of the array vl. ldvl >= 1, and if side == 'L' or 'B', ldvl >= n.
        vr - (input/output) double[][] of dimension (ldvr,mm) On entry, if side = 'R' or 'B' and howmny = 'B', vr must contain an n-by-n matrix Z (usually the orthogonal matrix Z of right Schur vectors returned by dhgeqz). On exit, if side = 'R' or 'B', vr contains: if howmny = 'A', the matrix X of right eigenvectors of (S,P) if howmny = 'B' or 'b', the matrix Z*X if howmny = 'S' or 's', the right eigenvectors of (S,P) specified by select, stored consecutively in the columns of vr, in the same order as their eigenvalues.

        A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part and the second holding the imaginary part. Not referenced if side = 'L'.

        ldvr - input int The leading dimension of the array vr. ldvr >= 1, and if side == 'R' or 'B', ldvr >= n.
        mm - input int The number of columns in the arrays vl and/or vr. mm >= m.
        m - output int[] The number of columns in the arrys vl and/or vr actually used to store the eigenvectors. If howmny = 'A' or 'B', m is set to n. Each selected real eigenvector occupies one column and each selected complex eigenvector occupies two columns.
        work - workspace double[] of dimension (6*n)
        info - output int[] = 0: successful exit < 0: if info[0] = -i, the i-th argument had an illegal value. > 0: the 2-by-2 block (info-1:info) does not have a complex eigenvalue. Further details: Allocation of workspace: work[j] = 1-norm of j-th column of A, above the diagonal. work[n+j] = 1-norm of j-th column of B, above the diagonal. work[2*n:3*n-1] = real part of eigenvector work[3*n:4*n-1] = imaginary part of eigenvector work[4*n:5*n-1] = real part of back-transformed eigenvector work[5*n:6*n-1] = imaginary part of back-transformed eigenvector Rowwise vs. columnwise solution methods: Finding a generalized eigenvector consists basically of solving the singular triangular system (A - wB) x = 0 (for right) or: (A- wB)**H y = 0 (for left)

        Consider finding the i-th right eigenvector (assume all eigenvalues are real). The equation to be solved is: 0 = sum from k=j to k=n-1 of C[j][k] v[k] = sum from k=j to k=i of C[j][k] v[k] for j = i,...,0 where C = (A - w B) (The components v(i+1:n-1) are 0.)

        The "rowwise" method is: (1) v(i) := 1 for j = i-1,...,0: (2) compute s = -sum from k=j+1 to k=i of C[j][k] v[k] and (3) v[j] := s / C[j][j]

        Step 2 is sometimes called the "dot product" step, since it is an inner product between the j-th row and the portion of the eigenvector that has been computed so far.

        The "columnwise" method consists basically in doing the sums for all the rows in parallel. As each v[j] is computed, the contribution of v[j] times the j-th column of C is added to the partial sums.

        When finding left eigenvectors, the matrix in question is the transpose of the one in storage, so the rowwise method then actually accesses columns of A and B at each step.

      • dtrmm

        public void dtrmm​(char side,
                          char uplo,
                          char transa,
                          char diag,
                          int m,
                          int n,
                          double alpha,
                          double[][] A,
                          int lda,
                          double[][] B,
                          int ldb)
        This is a port of the 2/8/89 Blas routine DTRMM Original code written by: Jack Dongarra, Argonne National Laboratory Iain Duff, AERE Harwell. Jeremy Du Croz, Numerical Algorithms Group Ltd. Sven Hammarling, Numerical Algorithms Group Ltd. dtrmm performs one of the matrix-matrix operations B = alpha*op(A)*B or B = alpha*B*op(A), where alpha is scalar, B is an m by n matrix, A is a unit, or non-unit, upper or lower tringular matrix and op(A) is one of op(A) = A or op(A) = A'.
        Parameters:
        side - input char On entry, side specifies whether op(A) multiplies B from the left or right as follows: = 'L' or 'l' B = alpha*op(A)*B = 'R' or 'r' B = alpha*B*op(A)
        uplo - input char On entry, uplo specifies whether matrix A is an upper or lower triangular matrix as follows: = 'U' or 'u' A is an upper triangular matrix = 'L' or 'l' A is a lower triangular matrix
        transa - input char On entry, transa specifies the form of op(A) to be used in the matrix multiplication as follows: = 'N' or 'n' op(A) = A = 'T' or 't' op(A) = A' = 'C' or 'c' op(A) = A'
        diag - input char On entry, diag specifies whether or not A is unit triangular as follows: = 'U' or 'u' A is assumed to be unit triangular = 'N' or 'n' A is not assumed to be unit triangular
        m - input int On entry, m specifies the number of rows of B. m must be at least zero.
        n - input int On entry, n specifies the number of columns of B. n must be at least zero.
        alpha - input double Specified scalar. When alpha is zero then A is not referenced and B need not be set before entry.
        A - input double[][] of dimension lda by k, where k is m when side = 'L' or 'l' and is n when side = 'R' or 'r'. Before entry with uplo = 'U' or 'u', the leading k by k upper triangular part of the array A must contain the upper triangular matrix and the strictly lower triangular part of A is not referenced. Before entry with uplo = 'L' or 'l', the leading k by k lower triangular part of the array A must contain the lower triangular matrix and the strictly upper triangular part of A is not referenced. Note that when diag = 'U' or 'u', the diagonal elements of A are not referenced either, but are assumed to be unity.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. When side = 'L' or 'l' then lda must be at least max(1,m), when side = 'R' or 'r' then lda must be at least max(1,n).
        B - input/output double[][] of dimension ldb by n Before entry, the leading m by n part of the array B must contain the matrix B, and on exit is overwritten by the transformed matrix.
        ldb - input int On entry, ldb specifies the first dimension of B as declared in the calling (sub) program. ldb must be at least max(1,m).
      • dtrmv

        public void dtrmv​(char uplo,
                          char trans,
                          char diag,
                          int n,
                          double[][] A,
                          int lda,
                          double[] x,
                          int incx)
        This is a port of the 10/22/86 blas routine DTRMV Original version written by: Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office Sven Hammarling, Nag Central Office Richard Hanson, Sandia National Labs. dtrmv performs one of the matrix-vector operations x = A*x or x = A'*x where x is an n element vector and A is an n by n unit, or non-unit, upper or lower triangular matrix
        Parameters:
        uplo - input char On entry, uplo specifies whether the matrix is an upper or lower triangular matrix as follows: = 'U' or 'u' A is an upper triangular matrix = 'L' or 'l' A is a lower triangular matrix
        trans - input char On entry, trans specifies the operation to be performed as follows: = 'N' or 'n', x = A*x = 'T' or 't', x = A'*x = 'C' or 'c', x = A'*x
        diag - input char On entry, diag specifies whether or not A is unit triangular as follows: = 'U' or 'u' A is assumed to be unit triangular. = 'N' or 'n' A is not assumed to be unit triangular.
        n - input int On entry, n specifies the order of the matrix A. n must be at least zero.
        A - input double[][] dimension lda by n Before entry with uplo = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular matrix and the strictly lower triangular part of A is not referenced. Before entry with uplo = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular matrix and the strictly upper triangular part of A is not referenced. Note that when diag = 'U' or 'u', the diagonal elements of A are not referenced either, but are assumed to be unity.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. lda must be at least max(1,n).
        x - input/output double[] of dimension at least (1 + (n-1)*abs(incx)) Before entry, the incremented array x must contain the n element vector x. On exit, array x is is overwritten with the transformed vector x.
        incx - input int On entry, incx specifies the increment for the elements of x. incx must not be zero.
      • dtrsm

        public void dtrsm​(char side,
                          char uplo,
                          char transa,
                          char diag,
                          int m,
                          int n,
                          double alpha,
                          double[][] A,
                          int lda,
                          double[][] B,
                          int ldb)
        This is a port of the 2/8/89 Blas routine DTRSM Original code written by: Jack Dongarra, Argonne National Laboratory Iain Duff, AERE Harwell. Jeremy Du Croz, Numerical Algorithms Group Ltd. Sven Hammarling, Numerical Algorithms Group Ltd. dtrsm solves one of the matrix equations op(A)*X = alpha*B or X*op(A) = alpha*B, where alpha is a scalar, X and B are m by n matrices, A is a unit, or non-unit, upper or lower triangular matrix and op(A) is one of op(A) = A or op(A) = A'. The matrix X is overwritten on B.
        Parameters:
        side - input char On entry, side specifies whether op(A) appears on the left or right or X as follows: = 'L' or 'l' op(A)*X = alpha*B = 'R' or 'r' X*op(A) = alpha*B
        uplo - input char On entry, uplo specifies whether the matrix A is an upper or lower triangular matrix as follows: = 'U' or 'u' A is an upper triangular matrix = 'L' or 'l' A is a lower triangular matrix
        transa - input char On entry, transa specifies the form of op(A) to be used in the matrix multiplication as follows: = 'N' or 'n' op(A) = A, 'T' or 't' op(A) = A', 'C' or 'c' op(A) = A'
        diag - input char On entry, diag specifies whether or not A is unit triangular as follows: = 'U' or 'u' A is assumed to be unit triangular. = 'N' or 'n' A is not assumed to be unit triangular.
        m - input int On entry, m specifies the number of rows of B. m must be at least zero.
        n - input int On entry, n specifies the number of columns of B. n must be at least zero.
        alpha - input double Specified scalar. When alpha is zero then A is not referenced and B need not be set before entry.
        A - input double[][] of dimension lda by k, where k is m when side = 'L' or 'l' and is n when side = 'R' or 'r'. Before entry with uplo = 'U' or 'u', the leading k by k upper triangular part of the array A must contain the upper triangular matrix and the strictly lower part of A is not referenced. Before entry with uplo = 'L' or 'l', the leading k by k lower triangular part of the array A must contain the lower triangular matrix and the strictly upper triangular part of A is not referenced. Note that when diag = 'U' or 'u', the diagonal elements of A are not referenced either, but are assumed to be unity.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. When side = 'L' or 'l', then lda must be at least max(1,m). When side = 'R' or 'r', then lda must be at least max(1,n).
        B - input/output double[][] of dimension ldb by n. Before entry, the leading m by n part of the array B must contain the right-hand side matrix B, and on exit is overwritten by the solution matrix X.
        ldb - input int On entry, ldb specifies the first dimension of B as declared in the calling (sub) program. ldb must be at least max(1,m).
      • dtrsv

        public void dtrsv​(char uplo,
                          char trans,
                          char diag,
                          int n,
                          double[][] A,
                          int lda,
                          double[] x,
                          int incx)
        This is a port of the 10/22/86 Blas routine DTRSV Original version written by: Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs. dtrsv solves one of the systems of equations A*x = b or A'*x = b where b and x are n element vectors and A is an n by n unit, or non-unit, upper or lower triangular matrix.

        No test for singularity or near-singularity is included in this routine. Such test must be performed before calling this routine.

        Parameters:
        uplo - input char On entry, uplo specifies whether the matrix is an upper or lower triangular matrix as follows = 'U' or 'u' A is an upper triangular matrix. = 'L' or 'l' A is a lower triangular matrix.
        trans - input char On entry, trans specifies the equations to be solved as follows: = 'N' or 'n' A*x = b = 'T' or 't' A'*x = b = 'C' or 'c' A'*x = b
        diag - input char On entry, diag specifies whether or not A is unit triangular as follows: = 'U' or 'u' A is assumed to be unit triangular. = 'N' or 'n' A is not assumed to be unit triangular.
        n - input int On entry, n specifies the order of matrix A. n must be at least zero.
        A - input double[][] of dimension lda by n Before entry with uplo = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular matrix and the strictly lower triangular part of A is not referenced. Before entry with uplo = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular matrix and the strictly upper triangular part of A is not referenced. Note that when diag = 'U' or 'u', the diagonal elements of A are not referenced either, but are assumed to be unity.
        lda - input int On entry, lda specifies the first dimension of A as declared in the calling (sub) program. lda must be at least max(1,n).
        x - input/output double[] of dimension at least (1 + (n-1)*abs(incx)). Before entry, the incremented array x must contain the n element right-hand side vector b. On exit, array x is overwritten with the solution vector x.
        incx - input int On entry, incx specifies the increment for the elements of x. incx must not be zero.
      • ieeeck

        private int ieeeck​(int ispec,
                           double zero,
                           double one)
        Version 3.2 auxiliary routine ported form LAPACK Original IEEECK created by Univ. of Tennessee, Univ. of California Berkeley, University of Colorado Denver, and NAG Ltd., November, 2006 ieeeck is called form the ilaenv routine to verify that infinity and possibly NaN arithmetic is safe (i.e. will not trap)
        Parameters:
        ispec - input int Specifies whether to test just for infinity arithmetic or whether to test for infinity and NaN arithmetic = 0: Verify infinity arithmetic only. = 1: Verify infinity and NaN aritmetic
        zero - input double Must contain the value 0.0. This is passed to prevent the compiler from optimizing away this code
        one - input double Must contain the value 1.0. This is passed to prevent the compiler from optimizing away this code.
        Returns:
        int = 0: Arithmetic failed to produce the correct answers = 1: Arithmetic produced the correct answers
      • ilaenv

        public int ilaenv​(int ispec,
                          java.lang.String name,
                          java.lang.String opts,
                          int n1,
                          int n2,
                          int n3,
                          int n4)
        ilaenv is ported from the version 3.2.1 LAPACK auxiliary routine Original ILAENV created by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd., April, 2009

        ilaenv is called from the LAPACK routines to choose problem-dependent parameters for the local environment. See ispec for a description of the parameters.

        This version provides a set of parameters which should give good, but not optimal, performance on many of the currently available computers. Users are encouraged to modify this subroutine to set the tuning parameters for their particular machine using the option and problem size information in the arguments.

        This routine will not function correctly if it is converted to all lower case. Converting it to all upper case is allowed.

        Parameters:
        ispec - input integer Specifies the parameter to be returned as the value of ilaenv. = 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 (deprecated) = 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: the crossover point for the multishift QR method for nonsymmetric eigenvalue problems (deprecated) = 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 can be trusted not to trap 12 <= ispec <= 16: xhseqr or one of its subroutines see iparmq for detailed explanation
        name - input String The name of the calling subroutine, in either upper case or lower case.
        opts - input String The character options to the subroutine name, concatenated into a single character string. For example, uplo = 'U', trans = 'T', and diag = 'N' for a triangular routine would be specified as opts = 'UTN'. opts has all the character options to subroutine name, in the same order that they appear in the argument list for name, even if they are not used in determining the value of the parameter specified by ispec.
        n1 - input integer
        n2 - input integer
        n3 - input integer
        n4 - input integer n1 to n4 have problem dimensions for the subroutine name; these may not all be required. The problem dimensions n1, n2, n3, and n4 are specified in the order that they appear in the argument list for name. n1 is used first, n2 second, and so on, and unused problem dimensions are passed a value of -1.
        Returns:
        answer output integer >= 0; the value of the parameter specified by ispec < 0: il answer = -k, the k-th parameter had an illegal value The parameter value returned by ilaenv is checked for validity in the calling routine.
      • xlaenv

        public 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.