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 doublereal c_b20 = 0.;
00034 static integer c__0 = 0;
00035 static integer c__6 = 6;
00036 static doublereal c_b37 = 1.;
00037 static integer c__1 = 1;
00038 static integer c__2 = 2;
00039 static integer c__4 = 4;
00040
00041 int dchkbd_(integer *nsizes, integer *mval, integer *nval,
00042 integer *ntypes, logical *dotype, integer *nrhs, integer *iseed,
00043 doublereal *thresh, doublereal *a, integer *lda, doublereal *bd,
00044 doublereal *be, doublereal *s1, doublereal *s2, doublereal *x,
00045 integer *ldx, doublereal *y, doublereal *z__, doublereal *q, integer *
00046 ldq, doublereal *pt, integer *ldpt, doublereal *u, doublereal *vt,
00047 doublereal *work, integer *lwork, integer *iwork, integer *nout,
00048 integer *info)
00049 {
00050
00051
00052 static integer ktype[16] = { 1,2,4,4,4,4,4,6,6,6,6,6,9,9,9,10 };
00053 static integer kmagn[16] = { 1,1,1,1,1,2,3,1,1,1,2,3,1,2,3,0 };
00054 static integer kmode[16] = { 0,0,4,3,1,4,4,4,3,1,4,4,0,0,0,0 };
00055
00056
00057 static char fmt_9998[] = "(\002 DCHKBD: \002,a,\002 returned INFO=\002,i"
00058 "6,\002.\002,/9x,\002M=\002,i6,\002, N=\002,i6,\002, JTYPE=\002,i"
00059 "6,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00060 static char fmt_9999[] = "(\002 M=\002,i5,\002, N=\002,i5,\002, type "
00061 "\002,i2,\002, seed=\002,4(i4,\002,\002),\002 test(\002,i2,\002)"
00062 "=\002,g11.4)";
00063
00064
00065 integer a_dim1, a_offset, pt_dim1, pt_offset, q_dim1, q_offset, u_dim1,
00066 u_offset, vt_dim1, vt_offset, x_dim1, x_offset, y_dim1, y_offset,
00067 z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7;
00068 doublereal d__1, d__2, d__3, d__4, d__5, d__6, d__7;
00069
00070
00071 int s_copy(char *, char *, ftnlen, ftnlen);
00072 double log(doublereal), sqrt(doublereal), exp(doublereal);
00073 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00074
00075
00076 integer i__, j, m, n, mq;
00077 doublereal dum[1], ulp, cond;
00078 integer jcol;
00079 char path[3];
00080 integer idum[1], mmax, nmax;
00081 doublereal unfl, ovfl;
00082 char uplo[1];
00083 doublereal temp1, temp2;
00084 extern int dbdt01_(integer *, integer *, integer *,
00085 doublereal *, integer *, doublereal *, integer *, doublereal *,
00086 doublereal *, doublereal *, integer *, doublereal *, doublereal *)
00087 , dbdt02_(integer *, integer *, doublereal *, integer *,
00088 doublereal *, integer *, doublereal *, integer *, doublereal *,
00089 doublereal *);
00090 logical badmm;
00091 extern int dbdt03_(char *, integer *, integer *,
00092 doublereal *, doublereal *, doublereal *, integer *, doublereal *,
00093 doublereal *, integer *, doublereal *, doublereal *);
00094 logical badnn;
00095 integer nfail;
00096 extern int dgemm_(char *, char *, integer *, integer *,
00097 integer *, doublereal *, doublereal *, integer *, doublereal *,
00098 integer *, doublereal *, doublereal *, integer *);
00099 integer imode;
00100 doublereal dumma[1];
00101 integer iinfo;
00102 extern int dort01_(char *, integer *, integer *,
00103 doublereal *, integer *, doublereal *, integer *, doublereal *);
00104 doublereal anorm;
00105 integer mnmin;
00106 extern int dcopy_(integer *, doublereal *, integer *,
00107 doublereal *, integer *);
00108 integer mnmax, jsize, itype, jtype, ntest;
00109 extern int dlahd2_(integer *, char *);
00110 integer log2ui;
00111 extern int dlabad_(doublereal *, doublereal *);
00112 logical bidiag;
00113 extern int dbdsdc_(char *, char *, integer *, doublereal
00114 *, doublereal *, doublereal *, integer *, doublereal *, integer *,
00115 doublereal *, integer *, doublereal *, integer *, integer *), dgebrd_(integer *, integer *, doublereal *,
00116 integer *, doublereal *, doublereal *, doublereal *, doublereal *,
00117 doublereal *, integer *, integer *);
00118 extern doublereal dlamch_(char *), dlarnd_(integer *, integer *);
00119 extern int dlacpy_(char *, integer *, integer *,
00120 doublereal *, integer *, doublereal *, integer *),
00121 dlaset_(char *, integer *, integer *, doublereal *, doublereal *,
00122 doublereal *, integer *);
00123 integer ioldsd[4];
00124 extern int dbdsqr_(char *, integer *, integer *, integer
00125 *, integer *, doublereal *, doublereal *, doublereal *, integer *,
00126 doublereal *, integer *, doublereal *, integer *, doublereal *,
00127 integer *), dorgbr_(char *, integer *, integer *, integer
00128 *, doublereal *, integer *, doublereal *, doublereal *, integer *,
00129 integer *), xerbla_(char *, integer *), alasum_(
00130 char *, integer *, integer *, integer *, integer *),
00131 dlatmr_(integer *, integer *, char *, integer *, char *,
00132 doublereal *, integer *, doublereal *, doublereal *, char *, char
00133 *, doublereal *, integer *, doublereal *, doublereal *, integer *,
00134 doublereal *, char *, integer *, integer *, integer *,
00135 doublereal *, doublereal *, char *, doublereal *, integer *,
00136 integer *, integer *), dlatms_(integer *, integer *, char *, integer *, char *,
00137 doublereal *, integer *, doublereal *, doublereal *, integer *,
00138 integer *, char *, doublereal *, integer *, doublereal *, integer
00139 *);
00140 doublereal amninv;
00141 integer minwrk;
00142 doublereal rtunfl, rtovfl, ulpinv, result[19];
00143 integer mtypes;
00144
00145
00146 static cilist io___39 = { 0, 0, 0, fmt_9998, 0 };
00147 static cilist io___40 = { 0, 0, 0, fmt_9998, 0 };
00148 static cilist io___42 = { 0, 0, 0, fmt_9998, 0 };
00149 static cilist io___43 = { 0, 0, 0, fmt_9998, 0 };
00150 static cilist io___44 = { 0, 0, 0, fmt_9998, 0 };
00151 static cilist io___45 = { 0, 0, 0, fmt_9998, 0 };
00152 static cilist io___51 = { 0, 0, 0, fmt_9998, 0 };
00153 static cilist io___52 = { 0, 0, 0, fmt_9998, 0 };
00154 static cilist io___53 = { 0, 0, 0, fmt_9999, 0 };
00155
00156
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
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487 --mval;
00488 --nval;
00489 --dotype;
00490 --iseed;
00491 a_dim1 = *lda;
00492 a_offset = 1 + a_dim1;
00493 a -= a_offset;
00494 --bd;
00495 --be;
00496 --s1;
00497 --s2;
00498 z_dim1 = *ldx;
00499 z_offset = 1 + z_dim1;
00500 z__ -= z_offset;
00501 y_dim1 = *ldx;
00502 y_offset = 1 + y_dim1;
00503 y -= y_offset;
00504 x_dim1 = *ldx;
00505 x_offset = 1 + x_dim1;
00506 x -= x_offset;
00507 q_dim1 = *ldq;
00508 q_offset = 1 + q_dim1;
00509 q -= q_offset;
00510 vt_dim1 = *ldpt;
00511 vt_offset = 1 + vt_dim1;
00512 vt -= vt_offset;
00513 u_dim1 = *ldpt;
00514 u_offset = 1 + u_dim1;
00515 u -= u_offset;
00516 pt_dim1 = *ldpt;
00517 pt_offset = 1 + pt_dim1;
00518 pt -= pt_offset;
00519 --work;
00520 --iwork;
00521
00522
00523
00524
00525
00526
00527
00528 *info = 0;
00529
00530 badmm = FALSE_;
00531 badnn = FALSE_;
00532 mmax = 1;
00533 nmax = 1;
00534 mnmax = 1;
00535 minwrk = 1;
00536 i__1 = *nsizes;
00537 for (j = 1; j <= i__1; ++j) {
00538
00539 i__2 = mmax, i__3 = mval[j];
00540 mmax = max(i__2,i__3);
00541 if (mval[j] < 0) {
00542 badmm = TRUE_;
00543 }
00544
00545 i__2 = nmax, i__3 = nval[j];
00546 nmax = max(i__2,i__3);
00547 if (nval[j] < 0) {
00548 badnn = TRUE_;
00549 }
00550
00551
00552 i__4 = mval[j], i__5 = nval[j];
00553 i__2 = mnmax, i__3 = min(i__4,i__5);
00554 mnmax = max(i__2,i__3);
00555
00556
00557 i__4 = mval[j], i__5 = nval[j], i__4 = max(i__4,i__5);
00558
00559 i__6 = nval[j], i__7 = mval[j];
00560 i__2 = minwrk, i__3 = (mval[j] + nval[j]) * 3, i__2 = max(i__2,i__3),
00561 i__3 = mval[j] * (mval[j] + max(i__4,*nrhs) + 1) + nval[j] *
00562 min(i__6,i__7);
00563 minwrk = max(i__2,i__3);
00564
00565 }
00566
00567
00568
00569 if (*nsizes < 0) {
00570 *info = -1;
00571 } else if (badmm) {
00572 *info = -2;
00573 } else if (badnn) {
00574 *info = -3;
00575 } else if (*ntypes < 0) {
00576 *info = -4;
00577 } else if (*nrhs < 0) {
00578 *info = -6;
00579 } else if (*lda < mmax) {
00580 *info = -11;
00581 } else if (*ldx < mmax) {
00582 *info = -17;
00583 } else if (*ldq < mmax) {
00584 *info = -21;
00585 } else if (*ldpt < mnmax) {
00586 *info = -23;
00587 } else if (minwrk > *lwork) {
00588 *info = -27;
00589 }
00590
00591 if (*info != 0) {
00592 i__1 = -(*info);
00593 xerbla_("DCHKBD", &i__1);
00594 return 0;
00595 }
00596
00597
00598
00599 s_copy(path, "Double precision", (ftnlen)1, (ftnlen)16);
00600 s_copy(path + 1, "BD", (ftnlen)2, (ftnlen)2);
00601 nfail = 0;
00602 ntest = 0;
00603 unfl = dlamch_("Safe minimum");
00604 ovfl = dlamch_("Overflow");
00605 dlabad_(&unfl, &ovfl);
00606 ulp = dlamch_("Precision");
00607 ulpinv = 1. / ulp;
00608 log2ui = (integer) (log(ulpinv) / log(2.));
00609 rtunfl = sqrt(unfl);
00610 rtovfl = sqrt(ovfl);
00611 infoc_1.infot = 0;
00612
00613
00614
00615 i__1 = *nsizes;
00616 for (jsize = 1; jsize <= i__1; ++jsize) {
00617 m = mval[jsize];
00618 n = nval[jsize];
00619 mnmin = min(m,n);
00620
00621 i__2 = max(m,n);
00622 amninv = 1. / max(i__2,1);
00623
00624 if (*nsizes != 1) {
00625 mtypes = min(16,*ntypes);
00626 } else {
00627 mtypes = min(17,*ntypes);
00628 }
00629
00630 i__2 = mtypes;
00631 for (jtype = 1; jtype <= i__2; ++jtype) {
00632 if (! dotype[jtype]) {
00633 goto L190;
00634 }
00635
00636 for (j = 1; j <= 4; ++j) {
00637 ioldsd[j - 1] = iseed[j];
00638
00639 }
00640
00641 for (j = 1; j <= 14; ++j) {
00642 result[j - 1] = -1.;
00643
00644 }
00645
00646 *(unsigned char *)uplo = ' ';
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664 if (mtypes > 16) {
00665 goto L100;
00666 }
00667
00668 itype = ktype[jtype - 1];
00669 imode = kmode[jtype - 1];
00670
00671
00672
00673 switch (kmagn[jtype - 1]) {
00674 case 1: goto L40;
00675 case 2: goto L50;
00676 case 3: goto L60;
00677 }
00678
00679 L40:
00680 anorm = 1.;
00681 goto L70;
00682
00683 L50:
00684 anorm = rtovfl * ulp * amninv;
00685 goto L70;
00686
00687 L60:
00688 anorm = rtunfl * max(m,n) * ulpinv;
00689 goto L70;
00690
00691 L70:
00692
00693 dlaset_("Full", lda, &n, &c_b20, &c_b20, &a[a_offset], lda);
00694 iinfo = 0;
00695 cond = ulpinv;
00696
00697 bidiag = FALSE_;
00698 if (itype == 1) {
00699
00700
00701
00702 iinfo = 0;
00703
00704 } else if (itype == 2) {
00705
00706
00707
00708 i__3 = mnmin;
00709 for (jcol = 1; jcol <= i__3; ++jcol) {
00710 a[jcol + jcol * a_dim1] = anorm;
00711
00712 }
00713
00714 } else if (itype == 4) {
00715
00716
00717
00718 dlatms_(&mnmin, &mnmin, "S", &iseed[1], "N", &work[1], &imode,
00719 &cond, &anorm, &c__0, &c__0, "N", &a[a_offset], lda,
00720 &work[mnmin + 1], &iinfo);
00721
00722 } else if (itype == 5) {
00723
00724
00725
00726 dlatms_(&mnmin, &mnmin, "S", &iseed[1], "S", &work[1], &imode,
00727 &cond, &anorm, &m, &n, "N", &a[a_offset], lda, &work[
00728 mnmin + 1], &iinfo);
00729
00730 } else if (itype == 6) {
00731
00732
00733
00734 dlatms_(&m, &n, "S", &iseed[1], "N", &work[1], &imode, &cond,
00735 &anorm, &m, &n, "N", &a[a_offset], lda, &work[mnmin +
00736 1], &iinfo);
00737
00738 } else if (itype == 7) {
00739
00740
00741
00742 dlatmr_(&mnmin, &mnmin, "S", &iseed[1], "N", &work[1], &c__6,
00743 &c_b37, &c_b37, "T", "N", &work[mnmin + 1], &c__1, &
00744 c_b37, &work[(mnmin << 1) + 1], &c__1, &c_b37, "N", &
00745 iwork[1], &c__0, &c__0, &c_b20, &anorm, "NO", &a[
00746 a_offset], lda, &iwork[1], &iinfo);
00747
00748 } else if (itype == 8) {
00749
00750
00751
00752 dlatmr_(&mnmin, &mnmin, "S", &iseed[1], "S", &work[1], &c__6,
00753 &c_b37, &c_b37, "T", "N", &work[mnmin + 1], &c__1, &
00754 c_b37, &work[m + mnmin + 1], &c__1, &c_b37, "N", &
00755 iwork[1], &m, &n, &c_b20, &anorm, "NO", &a[a_offset],
00756 lda, &iwork[1], &iinfo);
00757
00758 } else if (itype == 9) {
00759
00760
00761
00762 dlatmr_(&m, &n, "S", &iseed[1], "N", &work[1], &c__6, &c_b37,
00763 &c_b37, "T", "N", &work[mnmin + 1], &c__1, &c_b37, &
00764 work[m + mnmin + 1], &c__1, &c_b37, "N", &iwork[1], &
00765 m, &n, &c_b20, &anorm, "NO", &a[a_offset], lda, &
00766 iwork[1], &iinfo);
00767
00768 } else if (itype == 10) {
00769
00770
00771
00772 temp1 = log(ulp) * -2.;
00773 i__3 = mnmin;
00774 for (j = 1; j <= i__3; ++j) {
00775 bd[j] = exp(temp1 * dlarnd_(&c__2, &iseed[1]));
00776 if (j < mnmin) {
00777 be[j] = exp(temp1 * dlarnd_(&c__2, &iseed[1]));
00778 }
00779
00780 }
00781
00782 iinfo = 0;
00783 bidiag = TRUE_;
00784 if (m >= n) {
00785 *(unsigned char *)uplo = 'U';
00786 } else {
00787 *(unsigned char *)uplo = 'L';
00788 }
00789 } else {
00790 iinfo = 1;
00791 }
00792
00793 if (iinfo == 0) {
00794
00795
00796
00797 if (bidiag) {
00798 dlatmr_(&mnmin, nrhs, "S", &iseed[1], "N", &work[1], &
00799 c__6, &c_b37, &c_b37, "T", "N", &work[mnmin + 1],
00800 &c__1, &c_b37, &work[(mnmin << 1) + 1], &c__1, &
00801 c_b37, "N", &iwork[1], &mnmin, nrhs, &c_b20, &
00802 c_b37, "NO", &y[y_offset], ldx, &iwork[1], &iinfo);
00803 } else {
00804 dlatmr_(&m, nrhs, "S", &iseed[1], "N", &work[1], &c__6, &
00805 c_b37, &c_b37, "T", "N", &work[m + 1], &c__1, &
00806 c_b37, &work[(m << 1) + 1], &c__1, &c_b37, "N", &
00807 iwork[1], &m, nrhs, &c_b20, &c_b37, "NO", &x[
00808 x_offset], ldx, &iwork[1], &iinfo);
00809 }
00810 }
00811
00812
00813
00814 if (iinfo != 0) {
00815 io___39.ciunit = *nout;
00816 s_wsfe(&io___39);
00817 do_fio(&c__1, "Generator", (ftnlen)9);
00818 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00819 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00820 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00821 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00822 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00823 e_wsfe();
00824 *info = abs(iinfo);
00825 return 0;
00826 }
00827
00828 L100:
00829
00830
00831
00832 if (! bidiag) {
00833
00834
00835
00836
00837 dlacpy_(" ", &m, &n, &a[a_offset], lda, &q[q_offset], ldq);
00838 i__3 = *lwork - (mnmin << 1);
00839 dgebrd_(&m, &n, &q[q_offset], ldq, &bd[1], &be[1], &work[1], &
00840 work[mnmin + 1], &work[(mnmin << 1) + 1], &i__3, &
00841 iinfo);
00842
00843
00844
00845 if (iinfo != 0) {
00846 io___40.ciunit = *nout;
00847 s_wsfe(&io___40);
00848 do_fio(&c__1, "DGEBRD", (ftnlen)6);
00849 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00850 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00851 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00852 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00853 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00854 ;
00855 e_wsfe();
00856 *info = abs(iinfo);
00857 return 0;
00858 }
00859
00860 dlacpy_(" ", &m, &n, &q[q_offset], ldq, &pt[pt_offset], ldpt);
00861 if (m >= n) {
00862 *(unsigned char *)uplo = 'U';
00863 } else {
00864 *(unsigned char *)uplo = 'L';
00865 }
00866
00867
00868
00869 mq = m;
00870 if (*nrhs <= 0) {
00871 mq = mnmin;
00872 }
00873 i__3 = *lwork - (mnmin << 1);
00874 dorgbr_("Q", &m, &mq, &n, &q[q_offset], ldq, &work[1], &work[(
00875 mnmin << 1) + 1], &i__3, &iinfo);
00876
00877
00878
00879 if (iinfo != 0) {
00880 io___42.ciunit = *nout;
00881 s_wsfe(&io___42);
00882 do_fio(&c__1, "DORGBR(Q)", (ftnlen)9);
00883 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00884 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00885 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00886 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00887 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00888 ;
00889 e_wsfe();
00890 *info = abs(iinfo);
00891 return 0;
00892 }
00893
00894
00895
00896 i__3 = *lwork - (mnmin << 1);
00897 dorgbr_("P", &mnmin, &n, &m, &pt[pt_offset], ldpt, &work[
00898 mnmin + 1], &work[(mnmin << 1) + 1], &i__3, &iinfo);
00899
00900
00901
00902 if (iinfo != 0) {
00903 io___43.ciunit = *nout;
00904 s_wsfe(&io___43);
00905 do_fio(&c__1, "DORGBR(P)", (ftnlen)9);
00906 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00907 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00908 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00909 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00910 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00911 ;
00912 e_wsfe();
00913 *info = abs(iinfo);
00914 return 0;
00915 }
00916
00917
00918
00919 dgemm_("Transpose", "No transpose", &m, nrhs, &m, &c_b37, &q[
00920 q_offset], ldq, &x[x_offset], ldx, &c_b20, &y[
00921 y_offset], ldx);
00922
00923
00924
00925
00926
00927 dbdt01_(&m, &n, &c__1, &a[a_offset], lda, &q[q_offset], ldq, &
00928 bd[1], &be[1], &pt[pt_offset], ldpt, &work[1], result)
00929 ;
00930 dort01_("Columns", &m, &mq, &q[q_offset], ldq, &work[1],
00931 lwork, &result[1]);
00932 dort01_("Rows", &mnmin, &n, &pt[pt_offset], ldpt, &work[1],
00933 lwork, &result[2]);
00934 }
00935
00936
00937
00938
00939 dcopy_(&mnmin, &bd[1], &c__1, &s1[1], &c__1);
00940 if (mnmin > 0) {
00941 i__3 = mnmin - 1;
00942 dcopy_(&i__3, &be[1], &c__1, &work[1], &c__1);
00943 }
00944 dlacpy_(" ", &m, nrhs, &y[y_offset], ldx, &z__[z_offset], ldx);
00945 dlaset_("Full", &mnmin, &mnmin, &c_b20, &c_b37, &u[u_offset],
00946 ldpt);
00947 dlaset_("Full", &mnmin, &mnmin, &c_b20, &c_b37, &vt[vt_offset],
00948 ldpt);
00949
00950 dbdsqr_(uplo, &mnmin, &mnmin, &mnmin, nrhs, &s1[1], &work[1], &vt[
00951 vt_offset], ldpt, &u[u_offset], ldpt, &z__[z_offset], ldx,
00952 &work[mnmin + 1], &iinfo);
00953
00954
00955
00956 if (iinfo != 0) {
00957 io___44.ciunit = *nout;
00958 s_wsfe(&io___44);
00959 do_fio(&c__1, "DBDSQR(vects)", (ftnlen)13);
00960 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00961 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00962 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00963 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00964 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00965 e_wsfe();
00966 *info = abs(iinfo);
00967 if (iinfo < 0) {
00968 return 0;
00969 } else {
00970 result[3] = ulpinv;
00971 goto L170;
00972 }
00973 }
00974
00975
00976
00977
00978 dcopy_(&mnmin, &bd[1], &c__1, &s2[1], &c__1);
00979 if (mnmin > 0) {
00980 i__3 = mnmin - 1;
00981 dcopy_(&i__3, &be[1], &c__1, &work[1], &c__1);
00982 }
00983
00984 dbdsqr_(uplo, &mnmin, &c__0, &c__0, &c__0, &s2[1], &work[1], &vt[
00985 vt_offset], ldpt, &u[u_offset], ldpt, &z__[z_offset], ldx,
00986 &work[mnmin + 1], &iinfo);
00987
00988
00989
00990 if (iinfo != 0) {
00991 io___45.ciunit = *nout;
00992 s_wsfe(&io___45);
00993 do_fio(&c__1, "DBDSQR(values)", (ftnlen)14);
00994 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00995 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00996 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00997 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00998 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00999 e_wsfe();
01000 *info = abs(iinfo);
01001 if (iinfo < 0) {
01002 return 0;
01003 } else {
01004 result[8] = ulpinv;
01005 goto L170;
01006 }
01007 }
01008
01009
01010
01011
01012
01013
01014 dbdt03_(uplo, &mnmin, &c__1, &bd[1], &be[1], &u[u_offset], ldpt, &
01015 s1[1], &vt[vt_offset], ldpt, &work[1], &result[3]);
01016 dbdt02_(&mnmin, nrhs, &y[y_offset], ldx, &z__[z_offset], ldx, &u[
01017 u_offset], ldpt, &work[1], &result[4]);
01018 dort01_("Columns", &mnmin, &mnmin, &u[u_offset], ldpt, &work[1],
01019 lwork, &result[5]);
01020 dort01_("Rows", &mnmin, &mnmin, &vt[vt_offset], ldpt, &work[1],
01021 lwork, &result[6]);
01022
01023
01024
01025
01026 result[7] = 0.;
01027 i__3 = mnmin - 1;
01028 for (i__ = 1; i__ <= i__3; ++i__) {
01029 if (s1[i__] < s1[i__ + 1]) {
01030 result[7] = ulpinv;
01031 }
01032 if (s1[i__] < 0.) {
01033 result[7] = ulpinv;
01034 }
01035
01036 }
01037 if (mnmin >= 1) {
01038 if (s1[mnmin] < 0.) {
01039 result[7] = ulpinv;
01040 }
01041 }
01042
01043
01044
01045 temp2 = 0.;
01046
01047 i__3 = mnmin;
01048 for (j = 1; j <= i__3; ++j) {
01049
01050
01051 d__6 = (d__1 = s1[j], abs(d__1)), d__7 = (d__2 = s2[j], abs(
01052 d__2));
01053 d__4 = sqrt(unfl) * max(s1[1],1.), d__5 = ulp * max(d__6,d__7)
01054 ;
01055 temp1 = (d__3 = s1[j] - s2[j], abs(d__3)) / max(d__4,d__5);
01056 temp2 = max(temp1,temp2);
01057
01058 }
01059
01060 result[8] = temp2;
01061
01062
01063
01064
01065 temp1 = *thresh * (.5 - ulp);
01066
01067 i__3 = log2ui;
01068 for (j = 0; j <= i__3; ++j) {
01069
01070 if (iinfo == 0) {
01071 goto L140;
01072 }
01073 temp1 *= 2.;
01074
01075 }
01076
01077 L140:
01078 result[9] = temp1;
01079
01080
01081
01082
01083 if (! bidiag) {
01084 dcopy_(&mnmin, &bd[1], &c__1, &s2[1], &c__1);
01085 if (mnmin > 0) {
01086 i__3 = mnmin - 1;
01087 dcopy_(&i__3, &be[1], &c__1, &work[1], &c__1);
01088 }
01089
01090 dbdsqr_(uplo, &mnmin, &n, &m, nrhs, &s2[1], &work[1], &pt[
01091 pt_offset], ldpt, &q[q_offset], ldq, &y[y_offset],
01092 ldx, &work[mnmin + 1], &iinfo);
01093
01094
01095
01096
01097
01098
01099 dbdt01_(&m, &n, &c__0, &a[a_offset], lda, &q[q_offset], ldq, &
01100 s2[1], dumma, &pt[pt_offset], ldpt, &work[1], &result[
01101 10]);
01102 dbdt02_(&m, nrhs, &x[x_offset], ldx, &y[y_offset], ldx, &q[
01103 q_offset], ldq, &work[1], &result[11]);
01104 dort01_("Columns", &m, &mq, &q[q_offset], ldq, &work[1],
01105 lwork, &result[12]);
01106 dort01_("Rows", &mnmin, &n, &pt[pt_offset], ldpt, &work[1],
01107 lwork, &result[13]);
01108 }
01109
01110
01111
01112
01113 dcopy_(&mnmin, &bd[1], &c__1, &s1[1], &c__1);
01114 if (mnmin > 0) {
01115 i__3 = mnmin - 1;
01116 dcopy_(&i__3, &be[1], &c__1, &work[1], &c__1);
01117 }
01118 dlaset_("Full", &mnmin, &mnmin, &c_b20, &c_b37, &u[u_offset],
01119 ldpt);
01120 dlaset_("Full", &mnmin, &mnmin, &c_b20, &c_b37, &vt[vt_offset],
01121 ldpt);
01122
01123 dbdsdc_(uplo, "I", &mnmin, &s1[1], &work[1], &u[u_offset], ldpt, &
01124 vt[vt_offset], ldpt, dum, idum, &work[mnmin + 1], &iwork[
01125 1], &iinfo);
01126
01127
01128
01129 if (iinfo != 0) {
01130 io___51.ciunit = *nout;
01131 s_wsfe(&io___51);
01132 do_fio(&c__1, "DBDSDC(vects)", (ftnlen)13);
01133 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01134 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
01135 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01136 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01137 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01138 e_wsfe();
01139 *info = abs(iinfo);
01140 if (iinfo < 0) {
01141 return 0;
01142 } else {
01143 result[14] = ulpinv;
01144 goto L170;
01145 }
01146 }
01147
01148
01149
01150
01151 dcopy_(&mnmin, &bd[1], &c__1, &s2[1], &c__1);
01152 if (mnmin > 0) {
01153 i__3 = mnmin - 1;
01154 dcopy_(&i__3, &be[1], &c__1, &work[1], &c__1);
01155 }
01156
01157 dbdsdc_(uplo, "N", &mnmin, &s2[1], &work[1], dum, &c__1, dum, &
01158 c__1, dum, idum, &work[mnmin + 1], &iwork[1], &iinfo);
01159
01160
01161
01162 if (iinfo != 0) {
01163 io___52.ciunit = *nout;
01164 s_wsfe(&io___52);
01165 do_fio(&c__1, "DBDSDC(values)", (ftnlen)14);
01166 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01167 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
01168 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01169 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01170 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01171 e_wsfe();
01172 *info = abs(iinfo);
01173 if (iinfo < 0) {
01174 return 0;
01175 } else {
01176 result[17] = ulpinv;
01177 goto L170;
01178 }
01179 }
01180
01181
01182
01183
01184
01185 dbdt03_(uplo, &mnmin, &c__1, &bd[1], &be[1], &u[u_offset], ldpt, &
01186 s1[1], &vt[vt_offset], ldpt, &work[1], &result[14]);
01187 dort01_("Columns", &mnmin, &mnmin, &u[u_offset], ldpt, &work[1],
01188 lwork, &result[15]);
01189 dort01_("Rows", &mnmin, &mnmin, &vt[vt_offset], ldpt, &work[1],
01190 lwork, &result[16]);
01191
01192
01193
01194
01195 result[17] = 0.;
01196 i__3 = mnmin - 1;
01197 for (i__ = 1; i__ <= i__3; ++i__) {
01198 if (s1[i__] < s1[i__ + 1]) {
01199 result[17] = ulpinv;
01200 }
01201 if (s1[i__] < 0.) {
01202 result[17] = ulpinv;
01203 }
01204
01205 }
01206 if (mnmin >= 1) {
01207 if (s1[mnmin] < 0.) {
01208 result[17] = ulpinv;
01209 }
01210 }
01211
01212
01213
01214 temp2 = 0.;
01215
01216 i__3 = mnmin;
01217 for (j = 1; j <= i__3; ++j) {
01218
01219
01220 d__4 = abs(s1[1]), d__5 = abs(s2[1]);
01221 d__2 = sqrt(unfl) * max(s1[1],1.), d__3 = ulp * max(d__4,d__5)
01222 ;
01223 temp1 = (d__1 = s1[j] - s2[j], abs(d__1)) / max(d__2,d__3);
01224 temp2 = max(temp1,temp2);
01225
01226 }
01227
01228 result[18] = temp2;
01229
01230
01231
01232 L170:
01233 for (j = 1; j <= 19; ++j) {
01234 if (result[j - 1] >= *thresh) {
01235 if (nfail == 0) {
01236 dlahd2_(nout, path);
01237 }
01238 io___53.ciunit = *nout;
01239 s_wsfe(&io___53);
01240 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
01241 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01242 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01243 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01244 ;
01245 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
01246 do_fio(&c__1, (char *)&result[j - 1], (ftnlen)sizeof(
01247 doublereal));
01248 e_wsfe();
01249 ++nfail;
01250 }
01251
01252 }
01253 if (! bidiag) {
01254 ntest += 19;
01255 } else {
01256 ntest += 5;
01257 }
01258
01259 L190:
01260 ;
01261 }
01262
01263 }
01264
01265
01266
01267 alasum_(path, nout, &nfail, &ntest, &c__0);
01268
01269 return 0;
01270
01271
01272
01273
01274 }