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