00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
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
00032
00033 static doublecomplex c_b1 = {0.,0.};
00034 static doublecomplex c_b2 = {1.,0.};
00035 static integer c__0 = 0;
00036 static integer c__6 = 6;
00037 static doublereal c_b37 = 1.;
00038 static integer c__1 = 1;
00039 static doublereal c_b47 = 0.;
00040 static integer c__2 = 2;
00041 static integer c__4 = 4;
00042
00043 int zchkbd_(integer *nsizes, integer *mval, integer *nval,
00044 integer *ntypes, logical *dotype, integer *nrhs, integer *iseed,
00045 doublereal *thresh, doublecomplex *a, integer *lda, doublereal *bd,
00046 doublereal *be, doublereal *s1, doublereal *s2, doublecomplex *x,
00047 integer *ldx, doublecomplex *y, doublecomplex *z__, doublecomplex *q,
00048 integer *ldq, doublecomplex *pt, integer *ldpt, doublecomplex *u,
00049 doublecomplex *vt, doublecomplex *work, integer *lwork, doublereal *
00050 rwork, integer *nout, integer *info)
00051 {
00052
00053
00054 static integer ktype[16] = { 1,2,4,4,4,4,4,6,6,6,6,6,9,9,9,10 };
00055 static integer kmagn[16] = { 1,1,1,1,1,2,3,1,1,1,2,3,1,2,3,0 };
00056 static integer kmode[16] = { 0,0,4,3,1,4,4,4,3,1,4,4,0,0,0,0 };
00057
00058
00059 static char fmt_9998[] = "(\002 ZCHKBD: \002,a,\002 returned INFO=\002,i"
00060 "6,\002.\002,/9x,\002M=\002,i6,\002, N=\002,i6,\002, JTYPE=\002,i"
00061 "6,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00062 static char fmt_9999[] = "(\002 M=\002,i5,\002, N=\002,i5,\002, type "
00063 "\002,i2,\002, seed=\002,4(i4,\002,\002),\002 test(\002,i2,\002)"
00064 "=\002,g11.4)";
00065
00066
00067 integer a_dim1, a_offset, pt_dim1, pt_offset, q_dim1, q_offset, u_dim1,
00068 u_offset, vt_dim1, vt_offset, x_dim1, x_offset, y_dim1, y_offset,
00069 z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7;
00070 doublereal d__1, d__2, d__3, d__4, d__5, d__6, d__7;
00071
00072
00073 int s_copy(char *, char *, ftnlen, ftnlen);
00074 double log(doublereal), sqrt(doublereal), exp(doublereal);
00075 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00076
00077
00078 integer i__, j, m, n, mq;
00079 doublereal ulp, cond;
00080 integer jcol;
00081 char path[3];
00082 integer mmax, nmax;
00083 doublereal unfl, ovfl;
00084 char uplo[1];
00085 doublereal temp1, temp2;
00086 logical badmm, badnn;
00087 integer nfail, imode;
00088 doublereal dumma[1];
00089 integer iinfo;
00090 extern int zbdt01_(integer *, integer *, integer *,
00091 doublecomplex *, integer *, doublecomplex *, integer *,
00092 doublereal *, doublereal *, doublecomplex *, integer *,
00093 doublecomplex *, doublereal *, doublereal *), zbdt02_(integer *,
00094 integer *, doublecomplex *, integer *, doublecomplex *, integer *,
00095 doublecomplex *, integer *, doublecomplex *, doublereal *,
00096 doublereal *), zbdt03_(char *, integer *, integer *, doublereal *,
00097 doublereal *, doublecomplex *, integer *, doublereal *,
00098 doublecomplex *, integer *, doublecomplex *, doublereal *)
00099 ;
00100 doublereal anorm;
00101 integer mnmin;
00102 extern int dcopy_(integer *, doublereal *, integer *,
00103 doublereal *, integer *);
00104 integer mnmax;
00105 extern int zgemm_(char *, char *, integer *, integer *,
00106 integer *, doublecomplex *, doublecomplex *, integer *,
00107 doublecomplex *, integer *, doublecomplex *, doublecomplex *,
00108 integer *);
00109 integer jsize, itype, jtype, iwork[1], ntest;
00110 extern int dlahd2_(integer *, char *), zunt01_(
00111 char *, integer *, integer *, doublecomplex *, integer *,
00112 doublecomplex *, integer *, doublereal *, doublereal *);
00113 integer log2ui;
00114 extern int dlabad_(doublereal *, doublereal *);
00115 logical bidiag;
00116 extern doublereal dlamch_(char *), dlarnd_(integer *, integer *);
00117 extern int dsvdch_(integer *, doublereal *, doublereal *,
00118 doublereal *, doublereal *, integer *), xerbla_(char *, integer *
00119 );
00120 integer ioldsd[4];
00121 extern int zgebrd_(integer *, integer *, doublecomplex *,
00122 integer *, doublereal *, doublereal *, doublecomplex *,
00123 doublecomplex *, doublecomplex *, integer *, integer *), alasum_(
00124 char *, integer *, integer *, integer *, integer *);
00125 doublereal amninv;
00126 extern int zlacpy_(char *, integer *, integer *,
00127 doublecomplex *, integer *, doublecomplex *, integer *),
00128 zlaset_(char *, integer *, integer *, doublecomplex *,
00129 doublecomplex *, doublecomplex *, integer *), zbdsqr_(
00130 char *, integer *, integer *, integer *, integer *, doublereal *,
00131 doublereal *, doublecomplex *, integer *, doublecomplex *,
00132 integer *, doublecomplex *, integer *, doublereal *, integer *);
00133 integer minwrk;
00134 extern int zungbr_(char *, integer *, integer *, integer
00135 *, doublecomplex *, integer *, doublecomplex *, doublecomplex *,
00136 integer *, integer *), zlatmr_(integer *, integer *, char
00137 *, integer *, char *, doublecomplex *, integer *, doublereal *,
00138 doublecomplex *, char *, char *, doublecomplex *, integer *,
00139 doublereal *, doublecomplex *, integer *, doublereal *, char *,
00140 integer *, integer *, integer *, doublereal *, doublereal *, char
00141 *, doublecomplex *, integer *, integer *, integer *);
00142 doublereal rtunfl, rtovfl, ulpinv, result[14];
00143 extern int zlatms_(integer *, integer *, char *, integer
00144 *, char *, doublereal *, integer *, doublereal *, doublereal *,
00145 integer *, integer *, char *, doublecomplex *, integer *,
00146 doublecomplex *, integer *);
00147 integer mtypes;
00148
00149
00150 static cilist io___40 = { 0, 0, 0, fmt_9998, 0 };
00151 static cilist io___41 = { 0, 0, 0, fmt_9998, 0 };
00152 static cilist io___43 = { 0, 0, 0, fmt_9998, 0 };
00153 static cilist io___44 = { 0, 0, 0, fmt_9998, 0 };
00154 static cilist io___45 = { 0, 0, 0, fmt_9998, 0 };
00155 static cilist io___46 = { 0, 0, 0, fmt_9998, 0 };
00156 static cilist io___50 = { 0, 0, 0, fmt_9999, 0 };
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468 --mval;
00469 --nval;
00470 --dotype;
00471 --iseed;
00472 a_dim1 = *lda;
00473 a_offset = 1 + a_dim1;
00474 a -= a_offset;
00475 --bd;
00476 --be;
00477 --s1;
00478 --s2;
00479 z_dim1 = *ldx;
00480 z_offset = 1 + z_dim1;
00481 z__ -= z_offset;
00482 y_dim1 = *ldx;
00483 y_offset = 1 + y_dim1;
00484 y -= y_offset;
00485 x_dim1 = *ldx;
00486 x_offset = 1 + x_dim1;
00487 x -= x_offset;
00488 q_dim1 = *ldq;
00489 q_offset = 1 + q_dim1;
00490 q -= q_offset;
00491 vt_dim1 = *ldpt;
00492 vt_offset = 1 + vt_dim1;
00493 vt -= vt_offset;
00494 u_dim1 = *ldpt;
00495 u_offset = 1 + u_dim1;
00496 u -= u_offset;
00497 pt_dim1 = *ldpt;
00498 pt_offset = 1 + pt_dim1;
00499 pt -= pt_offset;
00500 --work;
00501 --rwork;
00502
00503
00504
00505
00506
00507
00508
00509 *info = 0;
00510
00511 badmm = FALSE_;
00512 badnn = FALSE_;
00513 mmax = 1;
00514 nmax = 1;
00515 mnmax = 1;
00516 minwrk = 1;
00517 i__1 = *nsizes;
00518 for (j = 1; j <= i__1; ++j) {
00519
00520 i__2 = mmax, i__3 = mval[j];
00521 mmax = max(i__2,i__3);
00522 if (mval[j] < 0) {
00523 badmm = TRUE_;
00524 }
00525
00526 i__2 = nmax, i__3 = nval[j];
00527 nmax = max(i__2,i__3);
00528 if (nval[j] < 0) {
00529 badnn = TRUE_;
00530 }
00531
00532
00533 i__4 = mval[j], i__5 = nval[j];
00534 i__2 = mnmax, i__3 = min(i__4,i__5);
00535 mnmax = max(i__2,i__3);
00536
00537
00538 i__4 = mval[j], i__5 = nval[j], i__4 = max(i__4,i__5);
00539
00540 i__6 = nval[j], i__7 = mval[j];
00541 i__2 = minwrk, i__3 = (mval[j] + nval[j]) * 3, i__2 = max(i__2,i__3),
00542 i__3 = mval[j] * (mval[j] + max(i__4,*nrhs) + 1) + nval[j] *
00543 min(i__6,i__7);
00544 minwrk = max(i__2,i__3);
00545
00546 }
00547
00548
00549
00550 if (*nsizes < 0) {
00551 *info = -1;
00552 } else if (badmm) {
00553 *info = -2;
00554 } else if (badnn) {
00555 *info = -3;
00556 } else if (*ntypes < 0) {
00557 *info = -4;
00558 } else if (*nrhs < 0) {
00559 *info = -6;
00560 } else if (*lda < mmax) {
00561 *info = -11;
00562 } else if (*ldx < mmax) {
00563 *info = -17;
00564 } else if (*ldq < mmax) {
00565 *info = -21;
00566 } else if (*ldpt < mnmax) {
00567 *info = -23;
00568 } else if (minwrk > *lwork) {
00569 *info = -27;
00570 }
00571
00572 if (*info != 0) {
00573 i__1 = -(*info);
00574 xerbla_("ZCHKBD", &i__1);
00575 return 0;
00576 }
00577
00578
00579
00580 s_copy(path, "Zomplex precision", (ftnlen)1, (ftnlen)17);
00581 s_copy(path + 1, "BD", (ftnlen)2, (ftnlen)2);
00582 nfail = 0;
00583 ntest = 0;
00584 unfl = dlamch_("Safe minimum");
00585 ovfl = dlamch_("Overflow");
00586 dlabad_(&unfl, &ovfl);
00587 ulp = dlamch_("Precision");
00588 ulpinv = 1. / ulp;
00589 log2ui = (integer) (log(ulpinv) / log(2.));
00590 rtunfl = sqrt(unfl);
00591 rtovfl = sqrt(ovfl);
00592 infoc_1.infot = 0;
00593
00594
00595
00596 i__1 = *nsizes;
00597 for (jsize = 1; jsize <= i__1; ++jsize) {
00598 m = mval[jsize];
00599 n = nval[jsize];
00600 mnmin = min(m,n);
00601
00602 i__2 = max(m,n);
00603 amninv = 1. / max(i__2,1);
00604
00605 if (*nsizes != 1) {
00606 mtypes = min(16,*ntypes);
00607 } else {
00608 mtypes = min(17,*ntypes);
00609 }
00610
00611 i__2 = mtypes;
00612 for (jtype = 1; jtype <= i__2; ++jtype) {
00613 if (! dotype[jtype]) {
00614 goto L170;
00615 }
00616
00617 for (j = 1; j <= 4; ++j) {
00618 ioldsd[j - 1] = iseed[j];
00619
00620 }
00621
00622 for (j = 1; j <= 14; ++j) {
00623 result[j - 1] = -1.;
00624
00625 }
00626
00627 *(unsigned char *)uplo = ' ';
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645 if (mtypes > 16) {
00646 goto L100;
00647 }
00648
00649 itype = ktype[jtype - 1];
00650 imode = kmode[jtype - 1];
00651
00652
00653
00654 switch (kmagn[jtype - 1]) {
00655 case 1: goto L40;
00656 case 2: goto L50;
00657 case 3: goto L60;
00658 }
00659
00660 L40:
00661 anorm = 1.;
00662 goto L70;
00663
00664 L50:
00665 anorm = rtovfl * ulp * amninv;
00666 goto L70;
00667
00668 L60:
00669 anorm = rtunfl * max(m,n) * ulpinv;
00670 goto L70;
00671
00672 L70:
00673
00674 zlaset_("Full", lda, &n, &c_b1, &c_b1, &a[a_offset], lda);
00675 iinfo = 0;
00676 cond = ulpinv;
00677
00678 bidiag = FALSE_;
00679 if (itype == 1) {
00680
00681
00682
00683 iinfo = 0;
00684
00685 } else if (itype == 2) {
00686
00687
00688
00689 i__3 = mnmin;
00690 for (jcol = 1; jcol <= i__3; ++jcol) {
00691 i__4 = jcol + jcol * a_dim1;
00692 a[i__4].r = anorm, a[i__4].i = 0.;
00693
00694 }
00695
00696 } else if (itype == 4) {
00697
00698
00699
00700 zlatms_(&mnmin, &mnmin, "S", &iseed[1], "N", &rwork[1], &
00701 imode, &cond, &anorm, &c__0, &c__0, "N", &a[a_offset],
00702 lda, &work[1], &iinfo);
00703
00704 } else if (itype == 5) {
00705
00706
00707
00708 zlatms_(&mnmin, &mnmin, "S", &iseed[1], "S", &rwork[1], &
00709 imode, &cond, &anorm, &m, &n, "N", &a[a_offset], lda,
00710 &work[1], &iinfo);
00711
00712 } else if (itype == 6) {
00713
00714
00715
00716 zlatms_(&m, &n, "S", &iseed[1], "N", &rwork[1], &imode, &cond,
00717 &anorm, &m, &n, "N", &a[a_offset], lda, &work[1], &
00718 iinfo);
00719
00720 } else if (itype == 7) {
00721
00722
00723
00724 zlatmr_(&mnmin, &mnmin, "S", &iseed[1], "N", &work[1], &c__6,
00725 &c_b37, &c_b2, "T", "N", &work[mnmin + 1], &c__1, &
00726 c_b37, &work[(mnmin << 1) + 1], &c__1, &c_b37, "N",
00727 iwork, &c__0, &c__0, &c_b47, &anorm, "NO", &a[
00728 a_offset], lda, iwork, &iinfo);
00729
00730 } else if (itype == 8) {
00731
00732
00733
00734 zlatmr_(&mnmin, &mnmin, "S", &iseed[1], "S", &work[1], &c__6,
00735 &c_b37, &c_b2, "T", "N", &work[mnmin + 1], &c__1, &
00736 c_b37, &work[m + mnmin + 1], &c__1, &c_b37, "N",
00737 iwork, &m, &n, &c_b47, &anorm, "NO", &a[a_offset],
00738 lda, iwork, &iinfo);
00739
00740 } else if (itype == 9) {
00741
00742
00743
00744 zlatmr_(&m, &n, "S", &iseed[1], "N", &work[1], &c__6, &c_b37,
00745 &c_b2, "T", "N", &work[mnmin + 1], &c__1, &c_b37, &
00746 work[m + mnmin + 1], &c__1, &c_b37, "N", iwork, &m, &
00747 n, &c_b47, &anorm, "NO", &a[a_offset], lda, iwork, &
00748 iinfo);
00749
00750 } else if (itype == 10) {
00751
00752
00753
00754 temp1 = log(ulp) * -2.;
00755 i__3 = mnmin;
00756 for (j = 1; j <= i__3; ++j) {
00757 bd[j] = exp(temp1 * dlarnd_(&c__2, &iseed[1]));
00758 if (j < mnmin) {
00759 be[j] = exp(temp1 * dlarnd_(&c__2, &iseed[1]));
00760 }
00761
00762 }
00763
00764 iinfo = 0;
00765 bidiag = TRUE_;
00766 if (m >= n) {
00767 *(unsigned char *)uplo = 'U';
00768 } else {
00769 *(unsigned char *)uplo = 'L';
00770 }
00771 } else {
00772 iinfo = 1;
00773 }
00774
00775 if (iinfo == 0) {
00776
00777
00778
00779 if (bidiag) {
00780 zlatmr_(&mnmin, nrhs, "S", &iseed[1], "N", &work[1], &
00781 c__6, &c_b37, &c_b2, "T", "N", &work[mnmin + 1], &
00782 c__1, &c_b37, &work[(mnmin << 1) + 1], &c__1, &
00783 c_b37, "N", iwork, &mnmin, nrhs, &c_b47, &c_b37,
00784 "NO", &y[y_offset], ldx, iwork, &iinfo);
00785 } else {
00786 zlatmr_(&m, nrhs, "S", &iseed[1], "N", &work[1], &c__6, &
00787 c_b37, &c_b2, "T", "N", &work[m + 1], &c__1, &
00788 c_b37, &work[(m << 1) + 1], &c__1, &c_b37, "N",
00789 iwork, &m, nrhs, &c_b47, &c_b37, "NO", &x[
00790 x_offset], ldx, iwork, &iinfo);
00791 }
00792 }
00793
00794
00795
00796 if (iinfo != 0) {
00797 io___40.ciunit = *nout;
00798 s_wsfe(&io___40);
00799 do_fio(&c__1, "Generator", (ftnlen)9);
00800 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00801 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00802 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00803 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00804 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00805 e_wsfe();
00806 *info = abs(iinfo);
00807 return 0;
00808 }
00809
00810 L100:
00811
00812
00813
00814 if (! bidiag) {
00815
00816
00817
00818
00819 zlacpy_(" ", &m, &n, &a[a_offset], lda, &q[q_offset], ldq);
00820 i__3 = *lwork - (mnmin << 1);
00821 zgebrd_(&m, &n, &q[q_offset], ldq, &bd[1], &be[1], &work[1], &
00822 work[mnmin + 1], &work[(mnmin << 1) + 1], &i__3, &
00823 iinfo);
00824
00825
00826
00827 if (iinfo != 0) {
00828 io___41.ciunit = *nout;
00829 s_wsfe(&io___41);
00830 do_fio(&c__1, "ZGEBRD", (ftnlen)6);
00831 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00832 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00833 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00834 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00835 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00836 ;
00837 e_wsfe();
00838 *info = abs(iinfo);
00839 return 0;
00840 }
00841
00842 zlacpy_(" ", &m, &n, &q[q_offset], ldq, &pt[pt_offset], ldpt);
00843 if (m >= n) {
00844 *(unsigned char *)uplo = 'U';
00845 } else {
00846 *(unsigned char *)uplo = 'L';
00847 }
00848
00849
00850
00851 mq = m;
00852 if (*nrhs <= 0) {
00853 mq = mnmin;
00854 }
00855 i__3 = *lwork - (mnmin << 1);
00856 zungbr_("Q", &m, &mq, &n, &q[q_offset], ldq, &work[1], &work[(
00857 mnmin << 1) + 1], &i__3, &iinfo);
00858
00859
00860
00861 if (iinfo != 0) {
00862 io___43.ciunit = *nout;
00863 s_wsfe(&io___43);
00864 do_fio(&c__1, "ZUNGBR(Q)", (ftnlen)9);
00865 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00866 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00867 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00868 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00869 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00870 ;
00871 e_wsfe();
00872 *info = abs(iinfo);
00873 return 0;
00874 }
00875
00876
00877
00878 i__3 = *lwork - (mnmin << 1);
00879 zungbr_("P", &mnmin, &n, &m, &pt[pt_offset], ldpt, &work[
00880 mnmin + 1], &work[(mnmin << 1) + 1], &i__3, &iinfo);
00881
00882
00883
00884 if (iinfo != 0) {
00885 io___44.ciunit = *nout;
00886 s_wsfe(&io___44);
00887 do_fio(&c__1, "ZUNGBR(P)", (ftnlen)9);
00888 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00889 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00890 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00891 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00892 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00893 ;
00894 e_wsfe();
00895 *info = abs(iinfo);
00896 return 0;
00897 }
00898
00899
00900
00901 zgemm_("Conjugate transpose", "No transpose", &m, nrhs, &m, &
00902 c_b2, &q[q_offset], ldq, &x[x_offset], ldx, &c_b1, &y[
00903 y_offset], ldx);
00904
00905
00906
00907
00908
00909 zbdt01_(&m, &n, &c__1, &a[a_offset], lda, &q[q_offset], ldq, &
00910 bd[1], &be[1], &pt[pt_offset], ldpt, &work[1], &rwork[
00911 1], result);
00912 zunt01_("Columns", &m, &mq, &q[q_offset], ldq, &work[1],
00913 lwork, &rwork[1], &result[1]);
00914 zunt01_("Rows", &mnmin, &n, &pt[pt_offset], ldpt, &work[1],
00915 lwork, &rwork[1], &result[2]);
00916 }
00917
00918
00919
00920
00921 dcopy_(&mnmin, &bd[1], &c__1, &s1[1], &c__1);
00922 if (mnmin > 0) {
00923 i__3 = mnmin - 1;
00924 dcopy_(&i__3, &be[1], &c__1, &rwork[1], &c__1);
00925 }
00926 zlacpy_(" ", &m, nrhs, &y[y_offset], ldx, &z__[z_offset], ldx);
00927 zlaset_("Full", &mnmin, &mnmin, &c_b1, &c_b2, &u[u_offset], ldpt);
00928 zlaset_("Full", &mnmin, &mnmin, &c_b1, &c_b2, &vt[vt_offset],
00929 ldpt);
00930
00931 zbdsqr_(uplo, &mnmin, &mnmin, &mnmin, nrhs, &s1[1], &rwork[1], &
00932 vt[vt_offset], ldpt, &u[u_offset], ldpt, &z__[z_offset],
00933 ldx, &rwork[mnmin + 1], &iinfo);
00934
00935
00936
00937 if (iinfo != 0) {
00938 io___45.ciunit = *nout;
00939 s_wsfe(&io___45);
00940 do_fio(&c__1, "ZBDSQR(vects)", (ftnlen)13);
00941 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00942 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00943 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00944 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00945 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00946 e_wsfe();
00947 *info = abs(iinfo);
00948 if (iinfo < 0) {
00949 return 0;
00950 } else {
00951 result[3] = ulpinv;
00952 goto L150;
00953 }
00954 }
00955
00956
00957
00958
00959 dcopy_(&mnmin, &bd[1], &c__1, &s2[1], &c__1);
00960 if (mnmin > 0) {
00961 i__3 = mnmin - 1;
00962 dcopy_(&i__3, &be[1], &c__1, &rwork[1], &c__1);
00963 }
00964
00965 zbdsqr_(uplo, &mnmin, &c__0, &c__0, &c__0, &s2[1], &rwork[1], &vt[
00966 vt_offset], ldpt, &u[u_offset], ldpt, &z__[z_offset], ldx,
00967 &rwork[mnmin + 1], &iinfo);
00968
00969
00970
00971 if (iinfo != 0) {
00972 io___46.ciunit = *nout;
00973 s_wsfe(&io___46);
00974 do_fio(&c__1, "ZBDSQR(values)", (ftnlen)14);
00975 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00976 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00977 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00978 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00979 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00980 e_wsfe();
00981 *info = abs(iinfo);
00982 if (iinfo < 0) {
00983 return 0;
00984 } else {
00985 result[8] = ulpinv;
00986 goto L150;
00987 }
00988 }
00989
00990
00991
00992
00993
00994
00995 zbdt03_(uplo, &mnmin, &c__1, &bd[1], &be[1], &u[u_offset], ldpt, &
00996 s1[1], &vt[vt_offset], ldpt, &work[1], &result[3]);
00997 zbdt02_(&mnmin, nrhs, &y[y_offset], ldx, &z__[z_offset], ldx, &u[
00998 u_offset], ldpt, &work[1], &rwork[1], &result[4]);
00999 zunt01_("Columns", &mnmin, &mnmin, &u[u_offset], ldpt, &work[1],
01000 lwork, &rwork[1], &result[5]);
01001 zunt01_("Rows", &mnmin, &mnmin, &vt[vt_offset], ldpt, &work[1],
01002 lwork, &rwork[1], &result[6]);
01003
01004
01005
01006
01007 result[7] = 0.;
01008 i__3 = mnmin - 1;
01009 for (i__ = 1; i__ <= i__3; ++i__) {
01010 if (s1[i__] < s1[i__ + 1]) {
01011 result[7] = ulpinv;
01012 }
01013 if (s1[i__] < 0.) {
01014 result[7] = ulpinv;
01015 }
01016
01017 }
01018 if (mnmin >= 1) {
01019 if (s1[mnmin] < 0.) {
01020 result[7] = ulpinv;
01021 }
01022 }
01023
01024
01025
01026 temp2 = 0.;
01027
01028 i__3 = mnmin;
01029 for (j = 1; j <= i__3; ++j) {
01030
01031
01032 d__6 = (d__1 = s1[j], abs(d__1)), d__7 = (d__2 = s2[j], abs(
01033 d__2));
01034 d__4 = sqrt(unfl) * max(s1[1],1.), d__5 = ulp * max(d__6,d__7)
01035 ;
01036 temp1 = (d__3 = s1[j] - s2[j], abs(d__3)) / max(d__4,d__5);
01037 temp2 = max(temp1,temp2);
01038
01039 }
01040
01041 result[8] = temp2;
01042
01043
01044
01045
01046 temp1 = *thresh * (.5 - ulp);
01047
01048 i__3 = log2ui;
01049 for (j = 0; j <= i__3; ++j) {
01050 dsvdch_(&mnmin, &bd[1], &be[1], &s1[1], &temp1, &iinfo);
01051 if (iinfo == 0) {
01052 goto L140;
01053 }
01054 temp1 *= 2.;
01055
01056 }
01057
01058 L140:
01059 result[9] = temp1;
01060
01061
01062
01063
01064 if (! bidiag) {
01065 dcopy_(&mnmin, &bd[1], &c__1, &s2[1], &c__1);
01066 if (mnmin > 0) {
01067 i__3 = mnmin - 1;
01068 dcopy_(&i__3, &be[1], &c__1, &rwork[1], &c__1);
01069 }
01070
01071 zbdsqr_(uplo, &mnmin, &n, &m, nrhs, &s2[1], &rwork[1], &pt[
01072 pt_offset], ldpt, &q[q_offset], ldq, &y[y_offset],
01073 ldx, &rwork[mnmin + 1], &iinfo);
01074
01075
01076
01077
01078
01079
01080 zbdt01_(&m, &n, &c__0, &a[a_offset], lda, &q[q_offset], ldq, &
01081 s2[1], dumma, &pt[pt_offset], ldpt, &work[1], &rwork[
01082 1], &result[10]);
01083 zbdt02_(&m, nrhs, &x[x_offset], ldx, &y[y_offset], ldx, &q[
01084 q_offset], ldq, &work[1], &rwork[1], &result[11]);
01085 zunt01_("Columns", &m, &mq, &q[q_offset], ldq, &work[1],
01086 lwork, &rwork[1], &result[12]);
01087 zunt01_("Rows", &mnmin, &n, &pt[pt_offset], ldpt, &work[1],
01088 lwork, &rwork[1], &result[13]);
01089 }
01090
01091
01092
01093 L150:
01094 for (j = 1; j <= 14; ++j) {
01095 if (result[j - 1] >= *thresh) {
01096 if (nfail == 0) {
01097 dlahd2_(nout, path);
01098 }
01099 io___50.ciunit = *nout;
01100 s_wsfe(&io___50);
01101 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
01102 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01103 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01104 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01105 ;
01106 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
01107 do_fio(&c__1, (char *)&result[j - 1], (ftnlen)sizeof(
01108 doublereal));
01109 e_wsfe();
01110 ++nfail;
01111 }
01112
01113 }
01114 if (! bidiag) {
01115 ntest += 14;
01116 } else {
01117 ntest += 5;
01118 }
01119
01120 L170:
01121 ;
01122 }
01123
01124 }
01125
01126
01127
01128 alasum_(path, nout, &nfail, &ntest, &c__0);
01129
01130 return 0;
01131
01132
01133
01134
01135 }