cchkbd.c
Go to the documentation of this file.
00001 /* cchkbd.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Common Block Declarations */
00017 
00018 struct {
00019     integer infot, nunit;
00020     logical ok, lerr;
00021 } infoc_;
00022 
00023 #define infoc_1 infoc_
00024 
00025 struct {
00026     char srnamt[32];
00027 } srnamc_;
00028 
00029 #define srnamc_1 srnamc_
00030 
00031 /* Table of constant values */
00032 
00033 static complex c_b1 = {0.f,0.f};
00034 static complex c_b2 = {1.f,0.f};
00035 static integer c__0 = 0;
00036 static integer c__6 = 6;
00037 static real c_b37 = 1.f;
00038 static integer c__1 = 1;
00039 static real c_b47 = 0.f;
00040 static integer c__2 = 2;
00041 static integer c__4 = 4;
00042 
00043 /* Subroutine */ int cchkbd_(integer *nsizes, integer *mval, integer *nval, 
00044         integer *ntypes, logical *dotype, integer *nrhs, integer *iseed, real 
00045         *thresh, complex *a, integer *lda, real *bd, real *be, real *s1, real 
00046         *s2, complex *x, integer *ldx, complex *y, complex *z__, complex *q, 
00047         integer *ldq, complex *pt, integer *ldpt, complex *u, complex *vt, 
00048         complex *work, integer *lwork, real *rwork, integer *nout, integer *
00049         info)
00050 {
00051     /* Initialized data */
00052 
00053     static integer ktype[16] = { 1,2,4,4,4,4,4,6,6,6,6,6,9,9,9,10 };
00054     static integer kmagn[16] = { 1,1,1,1,1,2,3,1,1,1,2,3,1,2,3,0 };
00055     static integer kmode[16] = { 0,0,4,3,1,4,4,4,3,1,4,4,0,0,0,0 };
00056 
00057     /* Format strings */
00058     static char fmt_9998[] = "(\002 CCHKBD: \002,a,\002 returned INFO=\002,i"
00059             "6,\002.\002,/9x,\002M=\002,i6,\002, N=\002,i6,\002, JTYPE=\002,i"
00060             "6,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00061     static char fmt_9999[] = "(\002 M=\002,i5,\002, N=\002,i5,\002, type "
00062             "\002,i2,\002, seed=\002,4(i4,\002,\002),\002 test(\002,i2,\002)"
00063             "=\002,g11.4)";
00064 
00065     /* System generated locals */
00066     integer a_dim1, a_offset, pt_dim1, pt_offset, q_dim1, q_offset, u_dim1, 
00067             u_offset, vt_dim1, vt_offset, x_dim1, x_offset, y_dim1, y_offset, 
00068             z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7;
00069     real r__1, r__2, r__3, r__4, r__5, r__6, r__7;
00070 
00071     /* Builtin functions */
00072     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00073     double log(doublereal), sqrt(doublereal), exp(doublereal);
00074     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00075 
00076     /* Local variables */
00077     integer i__, j, m, n, mq;
00078     real ulp, cond;
00079     integer jcol;
00080     char path[3];
00081     integer mmax, nmax;
00082     real unfl, ovfl;
00083     char uplo[1];
00084     real temp1, temp2;
00085     extern /* Subroutine */ int cbdt01_(integer *, integer *, integer *, 
00086             complex *, integer *, complex *, integer *, real *, real *, 
00087             complex *, integer *, complex *, real *, real *), cbdt02_(integer 
00088             *, integer *, complex *, integer *, complex *, integer *, complex 
00089             *, integer *, complex *, real *, real *), cbdt03_(char *, integer 
00090             *, integer *, real *, real *, complex *, integer *, real *, 
00091             complex *, integer *, complex *, real *);
00092     logical badmm, badnn;
00093     extern /* Subroutine */ int cgemm_(char *, char *, integer *, integer *, 
00094             integer *, complex *, complex *, integer *, complex *, integer *, 
00095             complex *, complex *, integer *);
00096     integer nfail, imode;
00097     real dumma[1];
00098     integer iinfo;
00099     extern /* Subroutine */ int cunt01_(char *, integer *, integer *, complex 
00100             *, integer *, complex *, integer *, real *, real *);
00101     real anorm;
00102     integer mnmin, mnmax, jsize, itype, jtype, iwork[1], ntest;
00103     extern /* Subroutine */ int scopy_(integer *, real *, integer *, real *, 
00104             integer *), slahd2_(integer *, char *);
00105     integer log2ui;
00106     logical bidiag;
00107     extern /* Subroutine */ int cgebrd_(integer *, integer *, complex *, 
00108             integer *, real *, real *, complex *, complex *, complex *, 
00109             integer *, integer *), slabad_(real *, real *);
00110     extern doublereal slamch_(char *);
00111     extern /* Subroutine */ int clacpy_(char *, integer *, integer *, complex 
00112             *, integer *, complex *, integer *), claset_(char *, 
00113             integer *, integer *, complex *, complex *, complex *, integer *), xerbla_(char *, integer *);
00114     integer ioldsd[4];
00115     extern /* Subroutine */ int cbdsqr_(char *, integer *, integer *, integer 
00116             *, integer *, real *, real *, complex *, integer *, complex *, 
00117             integer *, complex *, integer *, real *, integer *), 
00118             cungbr_(char *, integer *, integer *, integer *, complex *, 
00119             integer *, complex *, complex *, integer *, integer *), 
00120             alasum_(char *, integer *, integer *, integer *, integer *);
00121     extern doublereal slarnd_(integer *, integer *);
00122     extern /* Subroutine */ int clatmr_(integer *, integer *, char *, integer 
00123             *, char *, complex *, integer *, real *, complex *, char *, char *
00124 , complex *, integer *, real *, complex *, integer *, real *, 
00125             char *, integer *, integer *, integer *, real *, real *, char *, 
00126             complex *, integer *, integer *, integer *), clatms_(integer *, integer *, 
00127             char *, integer *, char *, real *, integer *, real *, real *, 
00128             integer *, integer *, char *, complex *, integer *, complex *, 
00129             integer *);
00130     real amninv;
00131     extern /* Subroutine */ int ssvdch_(integer *, real *, real *, real *, 
00132             real *, integer *);
00133     integer minwrk;
00134     real rtunfl, rtovfl, ulpinv, result[14];
00135     integer mtypes;
00136 
00137     /* Fortran I/O blocks */
00138     static cilist io___40 = { 0, 0, 0, fmt_9998, 0 };
00139     static cilist io___41 = { 0, 0, 0, fmt_9998, 0 };
00140     static cilist io___43 = { 0, 0, 0, fmt_9998, 0 };
00141     static cilist io___44 = { 0, 0, 0, fmt_9998, 0 };
00142     static cilist io___45 = { 0, 0, 0, fmt_9998, 0 };
00143     static cilist io___46 = { 0, 0, 0, fmt_9998, 0 };
00144     static cilist io___50 = { 0, 0, 0, fmt_9999, 0 };
00145 
00146 
00147 
00148 /*  -- LAPACK test routine (version 3.1) -- */
00149 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00150 /*     November 2006 */
00151 
00152 /*     .. Scalar Arguments .. */
00153 /*     .. */
00154 /*     .. Array Arguments .. */
00155 /*     .. */
00156 
00157 /*  Purpose */
00158 /*  ======= */
00159 
00160 /*  CCHKBD checks the singular value decomposition (SVD) routines. */
00161 
00162 /*  CGEBRD reduces a complex general m by n matrix A to real upper or */
00163 /*  lower bidiagonal form by an orthogonal transformation: Q' * A * P = B */
00164 /*  (or A = Q * B * P').  The matrix B is upper bidiagonal if m >= n */
00165 /*  and lower bidiagonal if m < n. */
00166 
00167 /*  CUNGBR generates the orthogonal matrices Q and P' from CGEBRD. */
00168 /*  Note that Q and P are not necessarily square. */
00169 
00170 /*  CBDSQR computes the singular value decomposition of the bidiagonal */
00171 /*  matrix B as B = U S V'.  It is called three times to compute */
00172 /*     1)  B = U S1 V', where S1 is the diagonal matrix of singular */
00173 /*         values and the columns of the matrices U and V are the left */
00174 /*         and right singular vectors, respectively, of B. */
00175 /*     2)  Same as 1), but the singular values are stored in S2 and the */
00176 /*         singular vectors are not computed. */
00177 /*     3)  A = (UQ) S (P'V'), the SVD of the original matrix A. */
00178 /*  In addition, CBDSQR has an option to apply the left orthogonal matrix */
00179 /*  U to a matrix X, useful in least squares applications. */
00180 
00181 /*  For each pair of matrix dimensions (M,N) and each selected matrix */
00182 /*  type, an M by N matrix A and an M by NRHS matrix X are generated. */
00183 /*  The problem dimensions are as follows */
00184 /*     A:          M x N */
00185 /*     Q:          M x min(M,N) (but M x M if NRHS > 0) */
00186 /*     P:          min(M,N) x N */
00187 /*     B:          min(M,N) x min(M,N) */
00188 /*     U, V:       min(M,N) x min(M,N) */
00189 /*     S1, S2      diagonal, order min(M,N) */
00190 /*     X:          M x NRHS */
00191 
00192 /*  For each generated matrix, 14 tests are performed: */
00193 
00194 /*  Test CGEBRD and CUNGBR */
00195 
00196 /*  (1)   | A - Q B PT | / ( |A| max(M,N) ulp ), PT = P' */
00197 
00198 /*  (2)   | I - Q' Q | / ( M ulp ) */
00199 
00200 /*  (3)   | I - PT PT' | / ( N ulp ) */
00201 
00202 /*  Test CBDSQR on bidiagonal matrix B */
00203 
00204 /*  (4)   | B - U S1 VT | / ( |B| min(M,N) ulp ), VT = V' */
00205 
00206 /*  (5)   | Y - U Z | / ( |Y| max(min(M,N),k) ulp ), where Y = Q' X */
00207 /*                                                   and   Z = U' Y. */
00208 /*  (6)   | I - U' U | / ( min(M,N) ulp ) */
00209 
00210 /*  (7)   | I - VT VT' | / ( min(M,N) ulp ) */
00211 
00212 /*  (8)   S1 contains min(M,N) nonnegative values in decreasing order. */
00213 /*        (Return 0 if true, 1/ULP if false.) */
00214 
00215 /*  (9)   0 if the true singular values of B are within THRESH of */
00216 /*        those in S1.  2*THRESH if they are not.  (Tested using */
00217 /*        SSVDCH) */
00218 
00219 /*  (10)  | S1 - S2 | / ( |S1| ulp ), where S2 is computed without */
00220 /*                                    computing U and V. */
00221 
00222 /*  Test CBDSQR on matrix A */
00223 
00224 /*  (11)  | A - (QU) S (VT PT) | / ( |A| max(M,N) ulp ) */
00225 
00226 /*  (12)  | X - (QU) Z | / ( |X| max(M,k) ulp ) */
00227 
00228 /*  (13)  | I - (QU)'(QU) | / ( M ulp ) */
00229 
00230 /*  (14)  | I - (VT PT) (PT'VT') | / ( N ulp ) */
00231 
00232 /*  The possible matrix types are */
00233 
00234 /*  (1)  The zero matrix. */
00235 /*  (2)  The identity matrix. */
00236 
00237 /*  (3)  A diagonal matrix with evenly spaced entries */
00238 /*       1, ..., ULP  and random signs. */
00239 /*       (ULP = (first number larger than 1) - 1 ) */
00240 /*  (4)  A diagonal matrix with geometrically spaced entries */
00241 /*       1, ..., ULP  and random signs. */
00242 /*  (5)  A diagonal matrix with "clustered" entries 1, ULP, ..., ULP */
00243 /*       and random signs. */
00244 
00245 /*  (6)  Same as (3), but multiplied by SQRT( overflow threshold ) */
00246 /*  (7)  Same as (3), but multiplied by SQRT( underflow threshold ) */
00247 
00248 /*  (8)  A matrix of the form  U D V, where U and V are orthogonal and */
00249 /*       D has evenly spaced entries 1, ..., ULP with random signs */
00250 /*       on the diagonal. */
00251 
00252 /*  (9)  A matrix of the form  U D V, where U and V are orthogonal and */
00253 /*       D has geometrically spaced entries 1, ..., ULP with random */
00254 /*       signs on the diagonal. */
00255 
00256 /*  (10) A matrix of the form  U D V, where U and V are orthogonal and */
00257 /*       D has "clustered" entries 1, ULP,..., ULP with random */
00258 /*       signs on the diagonal. */
00259 
00260 /*  (11) Same as (8), but multiplied by SQRT( overflow threshold ) */
00261 /*  (12) Same as (8), but multiplied by SQRT( underflow threshold ) */
00262 
00263 /*  (13) Rectangular matrix with random entries chosen from (-1,1). */
00264 /*  (14) Same as (13), but multiplied by SQRT( overflow threshold ) */
00265 /*  (15) Same as (13), but multiplied by SQRT( underflow threshold ) */
00266 
00267 /*  Special case: */
00268 /*  (16) A bidiagonal matrix with random entries chosen from a */
00269 /*       logarithmic distribution on [ulp^2,ulp^(-2)]  (I.e., each */
00270 /*       entry is  e^x, where x is chosen uniformly on */
00271 /*       [ 2 log(ulp), -2 log(ulp) ] .)  For *this* type: */
00272 /*       (a) CGEBRD is not called to reduce it to bidiagonal form. */
00273 /*       (b) the bidiagonal is  min(M,N) x min(M,N); if M<N, the */
00274 /*           matrix will be lower bidiagonal, otherwise upper. */
00275 /*       (c) only tests 5--8 and 14 are performed. */
00276 
00277 /*  A subset of the full set of matrix types may be selected through */
00278 /*  the logical array DOTYPE. */
00279 
00280 /*  Arguments */
00281 /*  ========== */
00282 
00283 /*  NSIZES  (input) INTEGER */
00284 /*          The number of values of M and N contained in the vectors */
00285 /*          MVAL and NVAL.  The matrix sizes are used in pairs (M,N). */
00286 
00287 /*  MVAL    (input) INTEGER array, dimension (NM) */
00288 /*          The values of the matrix row dimension M. */
00289 
00290 /*  NVAL    (input) INTEGER array, dimension (NM) */
00291 /*          The values of the matrix column dimension N. */
00292 
00293 /*  NTYPES  (input) INTEGER */
00294 /*          The number of elements in DOTYPE.   If it is zero, CCHKBD */
00295 /*          does nothing.  It must be at least zero.  If it is MAXTYP+1 */
00296 /*          and NSIZES is 1, then an additional type, MAXTYP+1 is */
00297 /*          defined, which is to use whatever matrices are in A and B. */
00298 /*          This is only useful if DOTYPE(1:MAXTYP) is .FALSE. and */
00299 /*          DOTYPE(MAXTYP+1) is .TRUE. . */
00300 
00301 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00302 /*          If DOTYPE(j) is .TRUE., then for each size (m,n), a matrix */
00303 /*          of type j will be generated.  If NTYPES is smaller than the */
00304 /*          maximum number of types defined (PARAMETER MAXTYP), then */
00305 /*          types NTYPES+1 through MAXTYP will not be generated.  If */
00306 /*          NTYPES is larger than MAXTYP, DOTYPE(MAXTYP+1) through */
00307 /*          DOTYPE(NTYPES) will be ignored. */
00308 
00309 /*  NRHS    (input) INTEGER */
00310 /*          The number of columns in the "right-hand side" matrices X, Y, */
00311 /*          and Z, used in testing CBDSQR.  If NRHS = 0, then the */
00312 /*          operations on the right-hand side will not be tested. */
00313 /*          NRHS must be at least 0. */
00314 
00315 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00316 /*          On entry ISEED specifies the seed of the random number */
00317 /*          generator. The array elements should be between 0 and 4095; */
00318 /*          if not they will be reduced mod 4096.  Also, ISEED(4) must */
00319 /*          be odd.  The values of ISEED are changed on exit, and can be */
00320 /*          used in the next call to CCHKBD to continue the same random */
00321 /*          number sequence. */
00322 
00323 /*  THRESH  (input) REAL */
00324 /*          The threshold value for the test ratios.  A result is */
00325 /*          included in the output file if RESULT >= THRESH.  To have */
00326 /*          every test ratio printed, use THRESH = 0.  Note that the */
00327 /*          expected value of the test ratios is O(1), so THRESH should */
00328 /*          be a reasonably small multiple of 1, e.g., 10 or 100. */
00329 
00330 /*  A       (workspace) COMPLEX array, dimension (LDA,NMAX) */
00331 /*          where NMAX is the maximum value of N in NVAL. */
00332 
00333 /*  LDA     (input) INTEGER */
00334 /*          The leading dimension of the array A.  LDA >= max(1,MMAX), */
00335 /*          where MMAX is the maximum value of M in MVAL. */
00336 
00337 /*  BD      (workspace) REAL array, dimension */
00338 /*                      (max(min(MVAL(j),NVAL(j)))) */
00339 
00340 /*  BE      (workspace) REAL array, dimension */
00341 /*                      (max(min(MVAL(j),NVAL(j)))) */
00342 
00343 /*  S1      (workspace) REAL array, dimension */
00344 /*                      (max(min(MVAL(j),NVAL(j)))) */
00345 
00346 /*  S2      (workspace) REAL array, dimension */
00347 /*                      (max(min(MVAL(j),NVAL(j)))) */
00348 
00349 /*  X       (workspace) COMPLEX array, dimension (LDX,NRHS) */
00350 
00351 /*  LDX     (input) INTEGER */
00352 /*          The leading dimension of the arrays X, Y, and Z. */
00353 /*          LDX >= max(1,MMAX). */
00354 
00355 /*  Y       (workspace) COMPLEX array, dimension (LDX,NRHS) */
00356 
00357 /*  Z       (workspace) COMPLEX array, dimension (LDX,NRHS) */
00358 
00359 /*  Q       (workspace) COMPLEX array, dimension (LDQ,MMAX) */
00360 
00361 /*  LDQ     (input) INTEGER */
00362 /*          The leading dimension of the array Q.  LDQ >= max(1,MMAX). */
00363 
00364 /*  PT      (workspace) COMPLEX array, dimension (LDPT,NMAX) */
00365 
00366 /*  LDPT    (input) INTEGER */
00367 /*          The leading dimension of the arrays PT, U, and V. */
00368 /*          LDPT >= max(1, max(min(MVAL(j),NVAL(j)))). */
00369 
00370 /*  U       (workspace) COMPLEX array, dimension */
00371 /*                      (LDPT,max(min(MVAL(j),NVAL(j)))) */
00372 
00373 /*  V       (workspace) COMPLEX array, dimension */
00374 /*                      (LDPT,max(min(MVAL(j),NVAL(j)))) */
00375 
00376 /*  WORK    (workspace) COMPLEX array, dimension (LWORK) */
00377 
00378 /*  LWORK   (input) INTEGER */
00379 /*          The number of entries in WORK.  This must be at least */
00380 /*          3(M+N) and  M(M + max(M,N,k) + 1) + N*min(M,N)  for all */
00381 /*          pairs  (M,N)=(MM(j),NN(j)) */
00382 
00383 /*  RWORK   (workspace) REAL array, dimension */
00384 /*                      (5*max(min(M,N))) */
00385 
00386 /*  NOUT    (input) INTEGER */
00387 /*          The FORTRAN unit number for printing out error messages */
00388 /*          (e.g., if a routine returns IINFO not equal to 0.) */
00389 
00390 /*  INFO    (output) INTEGER */
00391 /*          If 0, then everything ran OK. */
00392 /*           -1: NSIZES < 0 */
00393 /*           -2: Some MM(j) < 0 */
00394 /*           -3: Some NN(j) < 0 */
00395 /*           -4: NTYPES < 0 */
00396 /*           -6: NRHS  < 0 */
00397 /*           -8: THRESH < 0 */
00398 /*          -11: LDA < 1 or LDA < MMAX, where MMAX is max( MM(j) ). */
00399 /*          -17: LDB < 1 or LDB < MMAX. */
00400 /*          -21: LDQ < 1 or LDQ < MMAX. */
00401 /*          -23: LDP < 1 or LDP < MNMAX. */
00402 /*          -27: LWORK too small. */
00403 /*          If  CLATMR, CLATMS, CGEBRD, CUNGBR, or CBDSQR, */
00404 /*              returns an error code, the */
00405 /*              absolute value of it is returned. */
00406 
00407 /* ----------------------------------------------------------------------- */
00408 
00409 /*     Some Local Variables and Parameters: */
00410 /*     ---- ----- --------- --- ---------- */
00411 
00412 /*     ZERO, ONE       Real 0 and 1. */
00413 /*     MAXTYP          The number of types defined. */
00414 /*     NTEST           The number of tests performed, or which can */
00415 /*                     be performed so far, for the current matrix. */
00416 /*     MMAX            Largest value in NN. */
00417 /*     NMAX            Largest value in NN. */
00418 /*     MNMIN           min(MM(j), NN(j)) (the dimension of the bidiagonal */
00419 /*                     matrix.) */
00420 /*     MNMAX           The maximum value of MNMIN for j=1,...,NSIZES. */
00421 /*     NFAIL           The number of tests which have exceeded THRESH */
00422 /*     COND, IMODE     Values to be passed to the matrix generators. */
00423 /*     ANORM           Norm of A; passed to matrix generators. */
00424 
00425 /*     OVFL, UNFL      Overflow and underflow thresholds. */
00426 /*     RTOVFL, RTUNFL  Square roots of the previous 2 values. */
00427 /*     ULP, ULPINV     Finest relative precision and its inverse. */
00428 
00429 /*             The following four arrays decode JTYPE: */
00430 /*     KTYPE(j)        The general type (1-10) for type "j". */
00431 /*     KMODE(j)        The MODE value to be passed to the matrix */
00432 /*                     generator for type "j". */
00433 /*     KMAGN(j)        The order of magnitude ( O(1), */
00434 /*                     O(overflow^(1/2) ), O(underflow^(1/2) ) */
00435 
00436 /* ====================================================================== */
00437 
00438 /*     .. Parameters .. */
00439 /*     .. */
00440 /*     .. Local Scalars .. */
00441 /*     .. */
00442 /*     .. Local Arrays .. */
00443 /*     .. */
00444 /*     .. External Functions .. */
00445 /*     .. */
00446 /*     .. External Subroutines .. */
00447 /*     .. */
00448 /*     .. Intrinsic Functions .. */
00449 /*     .. */
00450 /*     .. Scalars in Common .. */
00451 /*     .. */
00452 /*     .. Common blocks .. */
00453 /*     .. */
00454 /*     .. Data statements .. */
00455     /* Parameter adjustments */
00456     --mval;
00457     --nval;
00458     --dotype;
00459     --iseed;
00460     a_dim1 = *lda;
00461     a_offset = 1 + a_dim1;
00462     a -= a_offset;
00463     --bd;
00464     --be;
00465     --s1;
00466     --s2;
00467     z_dim1 = *ldx;
00468     z_offset = 1 + z_dim1;
00469     z__ -= z_offset;
00470     y_dim1 = *ldx;
00471     y_offset = 1 + y_dim1;
00472     y -= y_offset;
00473     x_dim1 = *ldx;
00474     x_offset = 1 + x_dim1;
00475     x -= x_offset;
00476     q_dim1 = *ldq;
00477     q_offset = 1 + q_dim1;
00478     q -= q_offset;
00479     vt_dim1 = *ldpt;
00480     vt_offset = 1 + vt_dim1;
00481     vt -= vt_offset;
00482     u_dim1 = *ldpt;
00483     u_offset = 1 + u_dim1;
00484     u -= u_offset;
00485     pt_dim1 = *ldpt;
00486     pt_offset = 1 + pt_dim1;
00487     pt -= pt_offset;
00488     --work;
00489     --rwork;
00490 
00491     /* Function Body */
00492 /*     .. */
00493 /*     .. Executable Statements .. */
00494 
00495 /*     Check for errors */
00496 
00497     *info = 0;
00498 
00499     badmm = FALSE_;
00500     badnn = FALSE_;
00501     mmax = 1;
00502     nmax = 1;
00503     mnmax = 1;
00504     minwrk = 1;
00505     i__1 = *nsizes;
00506     for (j = 1; j <= i__1; ++j) {
00507 /* Computing MAX */
00508         i__2 = mmax, i__3 = mval[j];
00509         mmax = max(i__2,i__3);
00510         if (mval[j] < 0) {
00511             badmm = TRUE_;
00512         }
00513 /* Computing MAX */
00514         i__2 = nmax, i__3 = nval[j];
00515         nmax = max(i__2,i__3);
00516         if (nval[j] < 0) {
00517             badnn = TRUE_;
00518         }
00519 /* Computing MAX */
00520 /* Computing MIN */
00521         i__4 = mval[j], i__5 = nval[j];
00522         i__2 = mnmax, i__3 = min(i__4,i__5);
00523         mnmax = max(i__2,i__3);
00524 /* Computing MAX */
00525 /* Computing MAX */
00526         i__4 = mval[j], i__5 = nval[j], i__4 = max(i__4,i__5);
00527 /* Computing MIN */
00528         i__6 = nval[j], i__7 = mval[j];
00529         i__2 = minwrk, i__3 = (mval[j] + nval[j]) * 3, i__2 = max(i__2,i__3), 
00530                 i__3 = mval[j] * (mval[j] + max(i__4,*nrhs) + 1) + nval[j] * 
00531                 min(i__6,i__7);
00532         minwrk = max(i__2,i__3);
00533 /* L10: */
00534     }
00535 
00536 /*     Check for errors */
00537 
00538     if (*nsizes < 0) {
00539         *info = -1;
00540     } else if (badmm) {
00541         *info = -2;
00542     } else if (badnn) {
00543         *info = -3;
00544     } else if (*ntypes < 0) {
00545         *info = -4;
00546     } else if (*nrhs < 0) {
00547         *info = -6;
00548     } else if (*lda < mmax) {
00549         *info = -11;
00550     } else if (*ldx < mmax) {
00551         *info = -17;
00552     } else if (*ldq < mmax) {
00553         *info = -21;
00554     } else if (*ldpt < mnmax) {
00555         *info = -23;
00556     } else if (minwrk > *lwork) {
00557         *info = -27;
00558     }
00559 
00560     if (*info != 0) {
00561         i__1 = -(*info);
00562         xerbla_("CCHKBD", &i__1);
00563         return 0;
00564     }
00565 
00566 /*     Initialize constants */
00567 
00568     s_copy(path, "Complex precision", (ftnlen)1, (ftnlen)17);
00569     s_copy(path + 1, "BD", (ftnlen)2, (ftnlen)2);
00570     nfail = 0;
00571     ntest = 0;
00572     unfl = slamch_("Safe minimum");
00573     ovfl = slamch_("Overflow");
00574     slabad_(&unfl, &ovfl);
00575     ulp = slamch_("Precision");
00576     ulpinv = 1.f / ulp;
00577     log2ui = (integer) (log(ulpinv) / log(2.f));
00578     rtunfl = sqrt(unfl);
00579     rtovfl = sqrt(ovfl);
00580     infoc_1.infot = 0;
00581 
00582 /*     Loop over sizes, types */
00583 
00584     i__1 = *nsizes;
00585     for (jsize = 1; jsize <= i__1; ++jsize) {
00586         m = mval[jsize];
00587         n = nval[jsize];
00588         mnmin = min(m,n);
00589 /* Computing MAX */
00590         i__2 = max(m,n);
00591         amninv = 1.f / max(i__2,1);
00592 
00593         if (*nsizes != 1) {
00594             mtypes = min(16,*ntypes);
00595         } else {
00596             mtypes = min(17,*ntypes);
00597         }
00598 
00599         i__2 = mtypes;
00600         for (jtype = 1; jtype <= i__2; ++jtype) {
00601             if (! dotype[jtype]) {
00602                 goto L170;
00603             }
00604 
00605             for (j = 1; j <= 4; ++j) {
00606                 ioldsd[j - 1] = iseed[j];
00607 /* L20: */
00608             }
00609 
00610             for (j = 1; j <= 14; ++j) {
00611                 result[j - 1] = -1.f;
00612 /* L30: */
00613             }
00614 
00615             *(unsigned char *)uplo = ' ';
00616 
00617 /*           Compute "A" */
00618 
00619 /*           Control parameters: */
00620 
00621 /*           KMAGN  KMODE        KTYPE */
00622 /*       =1  O(1)   clustered 1  zero */
00623 /*       =2  large  clustered 2  identity */
00624 /*       =3  small  exponential  (none) */
00625 /*       =4         arithmetic   diagonal, (w/ eigenvalues) */
00626 /*       =5         random       symmetric, w/ eigenvalues */
00627 /*       =6                      nonsymmetric, w/ singular values */
00628 /*       =7                      random diagonal */
00629 /*       =8                      random symmetric */
00630 /*       =9                      random nonsymmetric */
00631 /*       =10                     random bidiagonal (log. distrib.) */
00632 
00633             if (mtypes > 16) {
00634                 goto L100;
00635             }
00636 
00637             itype = ktype[jtype - 1];
00638             imode = kmode[jtype - 1];
00639 
00640 /*           Compute norm */
00641 
00642             switch (kmagn[jtype - 1]) {
00643                 case 1:  goto L40;
00644                 case 2:  goto L50;
00645                 case 3:  goto L60;
00646             }
00647 
00648 L40:
00649             anorm = 1.f;
00650             goto L70;
00651 
00652 L50:
00653             anorm = rtovfl * ulp * amninv;
00654             goto L70;
00655 
00656 L60:
00657             anorm = rtunfl * max(m,n) * ulpinv;
00658             goto L70;
00659 
00660 L70:
00661 
00662             claset_("Full", lda, &n, &c_b1, &c_b1, &a[a_offset], lda);
00663             iinfo = 0;
00664             cond = ulpinv;
00665 
00666             bidiag = FALSE_;
00667             if (itype == 1) {
00668 
00669 /*              Zero matrix */
00670 
00671                 iinfo = 0;
00672 
00673             } else if (itype == 2) {
00674 
00675 /*              Identity */
00676 
00677                 i__3 = mnmin;
00678                 for (jcol = 1; jcol <= i__3; ++jcol) {
00679                     i__4 = jcol + jcol * a_dim1;
00680                     a[i__4].r = anorm, a[i__4].i = 0.f;
00681 /* L80: */
00682                 }
00683 
00684             } else if (itype == 4) {
00685 
00686 /*              Diagonal Matrix, [Eigen]values Specified */
00687 
00688                 clatms_(&mnmin, &mnmin, "S", &iseed[1], "N", &rwork[1], &
00689                         imode, &cond, &anorm, &c__0, &c__0, "N", &a[a_offset], 
00690                          lda, &work[1], &iinfo);
00691 
00692             } else if (itype == 5) {
00693 
00694 /*              Symmetric, eigenvalues specified */
00695 
00696                 clatms_(&mnmin, &mnmin, "S", &iseed[1], "S", &rwork[1], &
00697                         imode, &cond, &anorm, &m, &n, "N", &a[a_offset], lda, 
00698                         &work[1], &iinfo);
00699 
00700             } else if (itype == 6) {
00701 
00702 /*              Nonsymmetric, singular values specified */
00703 
00704                 clatms_(&m, &n, "S", &iseed[1], "N", &rwork[1], &imode, &cond, 
00705                          &anorm, &m, &n, "N", &a[a_offset], lda, &work[1], &
00706                         iinfo);
00707 
00708             } else if (itype == 7) {
00709 
00710 /*              Diagonal, random entries */
00711 
00712                 clatmr_(&mnmin, &mnmin, "S", &iseed[1], "N", &work[1], &c__6, 
00713                         &c_b37, &c_b2, "T", "N", &work[mnmin + 1], &c__1, &
00714                         c_b37, &work[(mnmin << 1) + 1], &c__1, &c_b37, "N", 
00715                         iwork, &c__0, &c__0, &c_b47, &anorm, "NO", &a[
00716                         a_offset], lda, iwork, &iinfo);
00717 
00718             } else if (itype == 8) {
00719 
00720 /*              Symmetric, random entries */
00721 
00722                 clatmr_(&mnmin, &mnmin, "S", &iseed[1], "S", &work[1], &c__6, 
00723                         &c_b37, &c_b2, "T", "N", &work[mnmin + 1], &c__1, &
00724                         c_b37, &work[m + mnmin + 1], &c__1, &c_b37, "N", 
00725                         iwork, &m, &n, &c_b47, &anorm, "NO", &a[a_offset], 
00726                         lda, iwork, &iinfo);
00727 
00728             } else if (itype == 9) {
00729 
00730 /*              Nonsymmetric, random entries */
00731 
00732                 clatmr_(&m, &n, "S", &iseed[1], "N", &work[1], &c__6, &c_b37, 
00733                         &c_b2, "T", "N", &work[mnmin + 1], &c__1, &c_b37, &
00734                         work[m + mnmin + 1], &c__1, &c_b37, "N", iwork, &m, &
00735                         n, &c_b47, &anorm, "NO", &a[a_offset], lda, iwork, &
00736                         iinfo);
00737 
00738             } else if (itype == 10) {
00739 
00740 /*              Bidiagonal, random entries */
00741 
00742                 temp1 = log(ulp) * -2.f;
00743                 i__3 = mnmin;
00744                 for (j = 1; j <= i__3; ++j) {
00745                     bd[j] = exp(temp1 * slarnd_(&c__2, &iseed[1]));
00746                     if (j < mnmin) {
00747                         be[j] = exp(temp1 * slarnd_(&c__2, &iseed[1]));
00748                     }
00749 /* L90: */
00750                 }
00751 
00752                 iinfo = 0;
00753                 bidiag = TRUE_;
00754                 if (m >= n) {
00755                     *(unsigned char *)uplo = 'U';
00756                 } else {
00757                     *(unsigned char *)uplo = 'L';
00758                 }
00759             } else {
00760                 iinfo = 1;
00761             }
00762 
00763             if (iinfo == 0) {
00764 
00765 /*              Generate Right-Hand Side */
00766 
00767                 if (bidiag) {
00768                     clatmr_(&mnmin, nrhs, "S", &iseed[1], "N", &work[1], &
00769                             c__6, &c_b37, &c_b2, "T", "N", &work[mnmin + 1], &
00770                             c__1, &c_b37, &work[(mnmin << 1) + 1], &c__1, &
00771                             c_b37, "N", iwork, &mnmin, nrhs, &c_b47, &c_b37, 
00772                             "NO", &y[y_offset], ldx, iwork, &iinfo);
00773                 } else {
00774                     clatmr_(&m, nrhs, "S", &iseed[1], "N", &work[1], &c__6, &
00775                             c_b37, &c_b2, "T", "N", &work[m + 1], &c__1, &
00776                             c_b37, &work[(m << 1) + 1], &c__1, &c_b37, "N", 
00777                             iwork, &m, nrhs, &c_b47, &c_b37, "NO", &x[
00778                             x_offset], ldx, iwork, &iinfo);
00779                 }
00780             }
00781 
00782 /*           Error Exit */
00783 
00784             if (iinfo != 0) {
00785                 io___40.ciunit = *nout;
00786                 s_wsfe(&io___40);
00787                 do_fio(&c__1, "Generator", (ftnlen)9);
00788                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00789                 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00790                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00791                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00792                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00793                 e_wsfe();
00794                 *info = abs(iinfo);
00795                 return 0;
00796             }
00797 
00798 L100:
00799 
00800 /*           Call CGEBRD and CUNGBR to compute B, Q, and P, do tests. */
00801 
00802             if (! bidiag) {
00803 
00804 /*              Compute transformations to reduce A to bidiagonal form: */
00805 /*              B := Q' * A * P. */
00806 
00807                 clacpy_(" ", &m, &n, &a[a_offset], lda, &q[q_offset], ldq);
00808                 i__3 = *lwork - (mnmin << 1);
00809                 cgebrd_(&m, &n, &q[q_offset], ldq, &bd[1], &be[1], &work[1], &
00810                         work[mnmin + 1], &work[(mnmin << 1) + 1], &i__3, &
00811                         iinfo);
00812 
00813 /*              Check error code from CGEBRD. */
00814 
00815                 if (iinfo != 0) {
00816                     io___41.ciunit = *nout;
00817                     s_wsfe(&io___41);
00818                     do_fio(&c__1, "CGEBRD", (ftnlen)6);
00819                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00820                     do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00821                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00822                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00823                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00824                             ;
00825                     e_wsfe();
00826                     *info = abs(iinfo);
00827                     return 0;
00828                 }
00829 
00830                 clacpy_(" ", &m, &n, &q[q_offset], ldq, &pt[pt_offset], ldpt);
00831                 if (m >= n) {
00832                     *(unsigned char *)uplo = 'U';
00833                 } else {
00834                     *(unsigned char *)uplo = 'L';
00835                 }
00836 
00837 /*              Generate Q */
00838 
00839                 mq = m;
00840                 if (*nrhs <= 0) {
00841                     mq = mnmin;
00842                 }
00843                 i__3 = *lwork - (mnmin << 1);
00844                 cungbr_("Q", &m, &mq, &n, &q[q_offset], ldq, &work[1], &work[(
00845                         mnmin << 1) + 1], &i__3, &iinfo);
00846 
00847 /*              Check error code from CUNGBR. */
00848 
00849                 if (iinfo != 0) {
00850                     io___43.ciunit = *nout;
00851                     s_wsfe(&io___43);
00852                     do_fio(&c__1, "CUNGBR(Q)", (ftnlen)9);
00853                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00854                     do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00855                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00856                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00857                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00858                             ;
00859                     e_wsfe();
00860                     *info = abs(iinfo);
00861                     return 0;
00862                 }
00863 
00864 /*              Generate P' */
00865 
00866                 i__3 = *lwork - (mnmin << 1);
00867                 cungbr_("P", &mnmin, &n, &m, &pt[pt_offset], ldpt, &work[
00868                         mnmin + 1], &work[(mnmin << 1) + 1], &i__3, &iinfo);
00869 
00870 /*              Check error code from CUNGBR. */
00871 
00872                 if (iinfo != 0) {
00873                     io___44.ciunit = *nout;
00874                     s_wsfe(&io___44);
00875                     do_fio(&c__1, "CUNGBR(P)", (ftnlen)9);
00876                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00877                     do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00878                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00879                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00880                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00881                             ;
00882                     e_wsfe();
00883                     *info = abs(iinfo);
00884                     return 0;
00885                 }
00886 
00887 /*              Apply Q' to an M by NRHS matrix X:  Y := Q' * X. */
00888 
00889                 cgemm_("Conjugate transpose", "No transpose", &m, nrhs, &m, &
00890                         c_b2, &q[q_offset], ldq, &x[x_offset], ldx, &c_b1, &y[
00891                         y_offset], ldx);
00892 
00893 /*              Test 1:  Check the decomposition A := Q * B * PT */
00894 /*                   2:  Check the orthogonality of Q */
00895 /*                   3:  Check the orthogonality of PT */
00896 
00897                 cbdt01_(&m, &n, &c__1, &a[a_offset], lda, &q[q_offset], ldq, &
00898                         bd[1], &be[1], &pt[pt_offset], ldpt, &work[1], &rwork[
00899                         1], result);
00900                 cunt01_("Columns", &m, &mq, &q[q_offset], ldq, &work[1], 
00901                         lwork, &rwork[1], &result[1]);
00902                 cunt01_("Rows", &mnmin, &n, &pt[pt_offset], ldpt, &work[1], 
00903                         lwork, &rwork[1], &result[2]);
00904             }
00905 
00906 /*           Use CBDSQR to form the SVD of the bidiagonal matrix B: */
00907 /*           B := U * S1 * VT, and compute Z = U' * Y. */
00908 
00909             scopy_(&mnmin, &bd[1], &c__1, &s1[1], &c__1);
00910             if (mnmin > 0) {
00911                 i__3 = mnmin - 1;
00912                 scopy_(&i__3, &be[1], &c__1, &rwork[1], &c__1);
00913             }
00914             clacpy_(" ", &m, nrhs, &y[y_offset], ldx, &z__[z_offset], ldx);
00915             claset_("Full", &mnmin, &mnmin, &c_b1, &c_b2, &u[u_offset], ldpt);
00916             claset_("Full", &mnmin, &mnmin, &c_b1, &c_b2, &vt[vt_offset], 
00917                     ldpt);
00918 
00919             cbdsqr_(uplo, &mnmin, &mnmin, &mnmin, nrhs, &s1[1], &rwork[1], &
00920                     vt[vt_offset], ldpt, &u[u_offset], ldpt, &z__[z_offset], 
00921                     ldx, &rwork[mnmin + 1], &iinfo);
00922 
00923 /*           Check error code from CBDSQR. */
00924 
00925             if (iinfo != 0) {
00926                 io___45.ciunit = *nout;
00927                 s_wsfe(&io___45);
00928                 do_fio(&c__1, "CBDSQR(vects)", (ftnlen)13);
00929                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00930                 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00931                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00932                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00933                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00934                 e_wsfe();
00935                 *info = abs(iinfo);
00936                 if (iinfo < 0) {
00937                     return 0;
00938                 } else {
00939                     result[3] = ulpinv;
00940                     goto L150;
00941                 }
00942             }
00943 
00944 /*           Use CBDSQR to compute only the singular values of the */
00945 /*           bidiagonal matrix B;  U, VT, and Z should not be modified. */
00946 
00947             scopy_(&mnmin, &bd[1], &c__1, &s2[1], &c__1);
00948             if (mnmin > 0) {
00949                 i__3 = mnmin - 1;
00950                 scopy_(&i__3, &be[1], &c__1, &rwork[1], &c__1);
00951             }
00952 
00953             cbdsqr_(uplo, &mnmin, &c__0, &c__0, &c__0, &s2[1], &rwork[1], &vt[
00954                     vt_offset], ldpt, &u[u_offset], ldpt, &z__[z_offset], ldx, 
00955                      &rwork[mnmin + 1], &iinfo);
00956 
00957 /*           Check error code from CBDSQR. */
00958 
00959             if (iinfo != 0) {
00960                 io___46.ciunit = *nout;
00961                 s_wsfe(&io___46);
00962                 do_fio(&c__1, "CBDSQR(values)", (ftnlen)14);
00963                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00964                 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00965                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00966                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00967                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00968                 e_wsfe();
00969                 *info = abs(iinfo);
00970                 if (iinfo < 0) {
00971                     return 0;
00972                 } else {
00973                     result[8] = ulpinv;
00974                     goto L150;
00975                 }
00976             }
00977 
00978 /*           Test 4:  Check the decomposition B := U * S1 * VT */
00979 /*                5:  Check the computation Z := U' * Y */
00980 /*                6:  Check the orthogonality of U */
00981 /*                7:  Check the orthogonality of VT */
00982 
00983             cbdt03_(uplo, &mnmin, &c__1, &bd[1], &be[1], &u[u_offset], ldpt, &
00984                     s1[1], &vt[vt_offset], ldpt, &work[1], &result[3]);
00985             cbdt02_(&mnmin, nrhs, &y[y_offset], ldx, &z__[z_offset], ldx, &u[
00986                     u_offset], ldpt, &work[1], &rwork[1], &result[4]);
00987             cunt01_("Columns", &mnmin, &mnmin, &u[u_offset], ldpt, &work[1], 
00988                     lwork, &rwork[1], &result[5]);
00989             cunt01_("Rows", &mnmin, &mnmin, &vt[vt_offset], ldpt, &work[1], 
00990                     lwork, &rwork[1], &result[6]);
00991 
00992 /*           Test 8:  Check that the singular values are sorted in */
00993 /*                    non-increasing order and are non-negative */
00994 
00995             result[7] = 0.f;
00996             i__3 = mnmin - 1;
00997             for (i__ = 1; i__ <= i__3; ++i__) {
00998                 if (s1[i__] < s1[i__ + 1]) {
00999                     result[7] = ulpinv;
01000                 }
01001                 if (s1[i__] < 0.f) {
01002                     result[7] = ulpinv;
01003                 }
01004 /* L110: */
01005             }
01006             if (mnmin >= 1) {
01007                 if (s1[mnmin] < 0.f) {
01008                     result[7] = ulpinv;
01009                 }
01010             }
01011 
01012 /*           Test 9:  Compare CBDSQR with and without singular vectors */
01013 
01014             temp2 = 0.f;
01015 
01016             i__3 = mnmin;
01017             for (j = 1; j <= i__3; ++j) {
01018 /* Computing MAX */
01019 /* Computing MAX */
01020                 r__6 = (r__1 = s1[j], dabs(r__1)), r__7 = (r__2 = s2[j], dabs(
01021                         r__2));
01022                 r__4 = sqrt(unfl) * dmax(s1[1],1.f), r__5 = ulp * dmax(r__6,
01023                         r__7);
01024                 temp1 = (r__3 = s1[j] - s2[j], dabs(r__3)) / dmax(r__4,r__5);
01025                 temp2 = dmax(temp1,temp2);
01026 /* L120: */
01027             }
01028 
01029             result[8] = temp2;
01030 
01031 /*           Test 10:  Sturm sequence test of singular values */
01032 /*                     Go up by factors of two until it succeeds */
01033 
01034             temp1 = *thresh * (.5f - ulp);
01035 
01036             i__3 = log2ui;
01037             for (j = 0; j <= i__3; ++j) {
01038                 ssvdch_(&mnmin, &bd[1], &be[1], &s1[1], &temp1, &iinfo);
01039                 if (iinfo == 0) {
01040                     goto L140;
01041                 }
01042                 temp1 *= 2.f;
01043 /* L130: */
01044             }
01045 
01046 L140:
01047             result[9] = temp1;
01048 
01049 /*           Use CBDSQR to form the decomposition A := (QU) S (VT PT) */
01050 /*           from the bidiagonal form A := Q B PT. */
01051 
01052             if (! bidiag) {
01053                 scopy_(&mnmin, &bd[1], &c__1, &s2[1], &c__1);
01054                 if (mnmin > 0) {
01055                     i__3 = mnmin - 1;
01056                     scopy_(&i__3, &be[1], &c__1, &rwork[1], &c__1);
01057                 }
01058 
01059                 cbdsqr_(uplo, &mnmin, &n, &m, nrhs, &s2[1], &rwork[1], &pt[
01060                         pt_offset], ldpt, &q[q_offset], ldq, &y[y_offset], 
01061                         ldx, &rwork[mnmin + 1], &iinfo);
01062 
01063 /*              Test 11:  Check the decomposition A := Q*U * S2 * VT*PT */
01064 /*                   12:  Check the computation Z := U' * Q' * X */
01065 /*                   13:  Check the orthogonality of Q*U */
01066 /*                   14:  Check the orthogonality of VT*PT */
01067 
01068                 cbdt01_(&m, &n, &c__0, &a[a_offset], lda, &q[q_offset], ldq, &
01069                         s2[1], dumma, &pt[pt_offset], ldpt, &work[1], &rwork[
01070                         1], &result[10]);
01071                 cbdt02_(&m, nrhs, &x[x_offset], ldx, &y[y_offset], ldx, &q[
01072                         q_offset], ldq, &work[1], &rwork[1], &result[11]);
01073                 cunt01_("Columns", &m, &mq, &q[q_offset], ldq, &work[1], 
01074                         lwork, &rwork[1], &result[12]);
01075                 cunt01_("Rows", &mnmin, &n, &pt[pt_offset], ldpt, &work[1], 
01076                         lwork, &rwork[1], &result[13]);
01077             }
01078 
01079 /*           End of Loop -- Check for RESULT(j) > THRESH */
01080 
01081 L150:
01082             for (j = 1; j <= 14; ++j) {
01083                 if (result[j - 1] >= *thresh) {
01084                     if (nfail == 0) {
01085                         slahd2_(nout, path);
01086                     }
01087                     io___50.ciunit = *nout;
01088                     s_wsfe(&io___50);
01089                     do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
01090                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01091                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01092                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01093                             ;
01094                     do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
01095                     do_fio(&c__1, (char *)&result[j - 1], (ftnlen)sizeof(real)
01096                             );
01097                     e_wsfe();
01098                     ++nfail;
01099                 }
01100 /* L160: */
01101             }
01102             if (! bidiag) {
01103                 ntest += 14;
01104             } else {
01105                 ntest += 5;
01106             }
01107 
01108 L170:
01109             ;
01110         }
01111 /* L180: */
01112     }
01113 
01114 /*     Summary */
01115 
01116     alasum_(path, nout, &nfail, &ntest, &c__0);
01117 
01118     return 0;
01119 
01120 /*     End of CCHKBD */
01121 
01122 
01123 } /* cchkbd_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:18