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 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 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
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
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
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
00072 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
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 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 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 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 int scopy_(integer *, real *, integer *, real *,
00104 integer *), slahd2_(integer *, char *);
00105 integer log2ui;
00106 logical bidiag;
00107 extern 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 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 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 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 int ssvdch_(integer *, real *, real *, real *,
00132 real *, integer *);
00133 integer minwrk;
00134 real rtunfl, rtovfl, ulpinv, result[14];
00135 integer mtypes;
00136
00137
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
00149
00150
00151
00152
00153
00154
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 --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
00492
00493
00494
00495
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
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
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
00520
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
00525
00526 i__4 = mval[j], i__5 = nval[j], i__4 = max(i__4,i__5);
00527
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
00534 }
00535
00536
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
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
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
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
00608 }
00609
00610 for (j = 1; j <= 14; ++j) {
00611 result[j - 1] = -1.f;
00612
00613 }
00614
00615 *(unsigned char *)uplo = ' ';
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633 if (mtypes > 16) {
00634 goto L100;
00635 }
00636
00637 itype = ktype[jtype - 1];
00638 imode = kmode[jtype - 1];
00639
00640
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
00670
00671 iinfo = 0;
00672
00673 } else if (itype == 2) {
00674
00675
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
00682 }
00683
00684 } else if (itype == 4) {
00685
00686
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
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
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
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
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
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
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
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
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
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
00801
00802 if (! bidiag) {
00803
00804
00805
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
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
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
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
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
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
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
00894
00895
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
00907
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
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
00945
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
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
00979
00980
00981
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
00993
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
01005 }
01006 if (mnmin >= 1) {
01007 if (s1[mnmin] < 0.f) {
01008 result[7] = ulpinv;
01009 }
01010 }
01011
01012
01013
01014 temp2 = 0.f;
01015
01016 i__3 = mnmin;
01017 for (j = 1; j <= i__3; ++j) {
01018
01019
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
01027 }
01028
01029 result[8] = temp2;
01030
01031
01032
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
01044 }
01045
01046 L140:
01047 result[9] = temp1;
01048
01049
01050
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
01064
01065
01066
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
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
01101 }
01102 if (! bidiag) {
01103 ntest += 14;
01104 } else {
01105 ntest += 5;
01106 }
01107
01108 L170:
01109 ;
01110 }
01111
01112 }
01113
01114
01115
01116 alasum_(path, nout, &nfail, &ntest, &c__0);
01117
01118 return 0;
01119
01120
01121
01122
01123 }