schkbb.c
Go to the documentation of this file.
00001 /* schkbb.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Table of constant values */
00017 
00018 static real c_b18 = 0.f;
00019 static integer c__0 = 0;
00020 static integer c__6 = 6;
00021 static real c_b35 = 1.f;
00022 static integer c__1 = 1;
00023 static integer c__4 = 4;
00024 static integer c_n1 = -1;
00025 
00026 /* Subroutine */ int schkbb_(integer *nsizes, integer *mval, integer *nval, 
00027         integer *nwdths, integer *kk, integer *ntypes, logical *dotype, 
00028         integer *nrhs, integer *iseed, real *thresh, integer *nounit, real *a, 
00029          integer *lda, real *ab, integer *ldab, real *bd, real *be, real *q, 
00030         integer *ldq, real *p, integer *ldp, real *c__, integer *ldc, real *
00031         cc, real *work, integer *lwork, real *result, integer *info)
00032 {
00033     /* Initialized data */
00034 
00035     static integer ktype[15] = { 1,2,4,4,4,4,4,6,6,6,6,6,9,9,9 };
00036     static integer kmagn[15] = { 1,1,1,1,1,2,3,1,1,1,2,3,1,2,3 };
00037     static integer kmode[15] = { 0,0,4,3,1,4,4,4,3,1,4,4,0,0,0 };
00038 
00039     /* Format strings */
00040     static char fmt_9999[] = "(\002 SCHKBB: \002,a,\002 returned INFO=\002,i"
00041             "5,\002.\002,/9x,\002M=\002,i5,\002 N=\002,i5,\002 K=\002,i5,\002"
00042             ", JTYPE=\002,i5,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00043     static char fmt_9998[] = "(\002 M =\002,i4,\002 N=\002,i4,\002, K=\002,i"
00044             "3,\002, seed=\002,4(i4,\002,\002),\002 type \002,i2,\002, test"
00045             "(\002,i2,\002)=\002,g10.3)";
00046 
00047     /* System generated locals */
00048     integer a_dim1, a_offset, ab_dim1, ab_offset, c_dim1, c_offset, cc_dim1, 
00049             cc_offset, p_dim1, p_offset, q_dim1, q_offset, i__1, i__2, i__3, 
00050             i__4, i__5, i__6, i__7, i__8, i__9;
00051 
00052     /* Builtin functions */
00053     double sqrt(doublereal);
00054     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00055 
00056     /* Local variables */
00057     integer i__, j, k, m, n, kl, jr, ku;
00058     real ulp, cond;
00059     integer jcol, kmax, mmax, nmax;
00060     real unfl, ovfl;
00061     logical badmm, badnn;
00062     integer imode;
00063     extern /* Subroutine */ int sbdt01_(integer *, integer *, integer *, real 
00064             *, integer *, real *, integer *, real *, real *, real *, integer *
00065 , real *, real *), sbdt02_(integer *, integer *, real *, integer *
00066 , real *, integer *, real *, integer *, real *, real *);
00067     integer iinfo;
00068     real anorm;
00069     integer mnmin, mnmax, nmats, jsize;
00070     extern /* Subroutine */ int sort01_(char *, integer *, integer *, real *, 
00071             integer *, real *, integer *, real *);
00072     integer nerrs, itype, jtype, ntest;
00073     extern /* Subroutine */ int slahd2_(integer *, char *);
00074     logical badnnb;
00075     extern /* Subroutine */ int sgbbrd_(char *, integer *, integer *, integer 
00076             *, integer *, integer *, real *, integer *, real *, real *, real *
00077 , integer *, real *, integer *, real *, integer *, real *, 
00078             integer *);
00079     extern doublereal slamch_(char *);
00080     integer idumma[1];
00081     extern /* Subroutine */ int xerbla_(char *, integer *);
00082     integer ioldsd[4];
00083     real amninv;
00084     integer jwidth;
00085     extern /* Subroutine */ int slacpy_(char *, integer *, integer *, real *, 
00086             integer *, real *, integer *), slaset_(char *, integer *, 
00087             integer *, real *, real *, real *, integer *), slatmr_(
00088             integer *, integer *, char *, integer *, char *, real *, integer *
00089 , real *, real *, char *, char *, real *, integer *, real *, real 
00090             *, integer *, real *, char *, integer *, integer *, integer *, 
00091             real *, real *, char *, real *, integer *, integer *, integer *), slatms_(integer *
00092 , integer *, char *, integer *, char *, real *, integer *, real *, 
00093              real *, integer *, integer *, char *, real *, integer *, real *, 
00094             integer *), slasum_(char *, integer *, 
00095             integer *, integer *);
00096     real rtunfl, rtovfl, ulpinv;
00097     integer mtypes, ntestt;
00098 
00099     /* Fortran I/O blocks */
00100     static cilist io___41 = { 0, 0, 0, fmt_9999, 0 };
00101     static cilist io___43 = { 0, 0, 0, fmt_9999, 0 };
00102     static cilist io___45 = { 0, 0, 0, fmt_9998, 0 };
00103 
00104 
00105 
00106 /*  -- LAPACK test routine (release 2.0) -- */
00107 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00108 /*     November 2006 */
00109 
00110 /*     .. Scalar Arguments .. */
00111 /*     .. */
00112 /*     .. Array Arguments .. */
00113 /*     .. */
00114 
00115 /*  Purpose */
00116 /*  ======= */
00117 
00118 /*  SCHKBB tests the reduction of a general real rectangular band */
00119 /*  matrix to bidiagonal form. */
00120 
00121 /*  SGBBRD factors a general band matrix A as  Q B P* , where * means */
00122 /*  transpose, B is upper bidiagonal, and Q and P are orthogonal; */
00123 /*  SGBBRD can also overwrite a given matrix C with Q* C . */
00124 
00125 /*  For each pair of matrix dimensions (M,N) and each selected matrix */
00126 /*  type, an M by N matrix A and an M by NRHS matrix C are generated. */
00127 /*  The problem dimensions are as follows */
00128 /*     A:          M x N */
00129 /*     Q:          M x M */
00130 /*     P:          N x N */
00131 /*     B:          min(M,N) x min(M,N) */
00132 /*     C:          M x NRHS */
00133 
00134 /*  For each generated matrix, 4 tests are performed: */
00135 
00136 /*  (1)   | A - Q B PT | / ( |A| max(M,N) ulp ), PT = P' */
00137 
00138 /*  (2)   | I - Q' Q | / ( M ulp ) */
00139 
00140 /*  (3)   | I - PT PT' | / ( N ulp ) */
00141 
00142 /*  (4)   | Y - Q' C | / ( |Y| max(M,NRHS) ulp ), where Y = Q' C. */
00143 
00144 /*  The "types" are specified by a logical array DOTYPE( 1:NTYPES ); */
00145 /*  if DOTYPE(j) is .TRUE., then matrix type "j" will be generated. */
00146 /*  Currently, the list of possible types is: */
00147 
00148 /*  The possible matrix types are */
00149 
00150 /*  (1)  The zero matrix. */
00151 /*  (2)  The identity matrix. */
00152 
00153 /*  (3)  A diagonal matrix with evenly spaced entries */
00154 /*       1, ..., ULP  and random signs. */
00155 /*       (ULP = (first number larger than 1) - 1 ) */
00156 /*  (4)  A diagonal matrix with geometrically spaced entries */
00157 /*       1, ..., ULP  and random signs. */
00158 /*  (5)  A diagonal matrix with "clustered" entries 1, ULP, ..., ULP */
00159 /*       and random signs. */
00160 
00161 /*  (6)  Same as (3), but multiplied by SQRT( overflow threshold ) */
00162 /*  (7)  Same as (3), but multiplied by SQRT( underflow threshold ) */
00163 
00164 /*  (8)  A matrix of the form  U D V, where U and V are orthogonal and */
00165 /*       D has evenly spaced entries 1, ..., ULP with random signs */
00166 /*       on the diagonal. */
00167 
00168 /*  (9)  A matrix of the form  U D V, where U and V are orthogonal and */
00169 /*       D has geometrically spaced entries 1, ..., ULP with random */
00170 /*       signs on the diagonal. */
00171 
00172 /*  (10) A matrix of the form  U D V, where U and V are orthogonal and */
00173 /*       D has "clustered" entries 1, ULP,..., ULP with random */
00174 /*       signs on the diagonal. */
00175 
00176 /*  (11) Same as (8), but multiplied by SQRT( overflow threshold ) */
00177 /*  (12) Same as (8), but multiplied by SQRT( underflow threshold ) */
00178 
00179 /*  (13) Rectangular matrix with random entries chosen from (-1,1). */
00180 /*  (14) Same as (13), but multiplied by SQRT( overflow threshold ) */
00181 /*  (15) Same as (13), but multiplied by SQRT( underflow threshold ) */
00182 
00183 /*  Arguments */
00184 /*  ========= */
00185 
00186 /*  NSIZES  (input) INTEGER */
00187 /*          The number of values of M and N contained in the vectors */
00188 /*          MVAL and NVAL.  The matrix sizes are used in pairs (M,N). */
00189 /*          If NSIZES is zero, SCHKBB does nothing.  NSIZES must be at */
00190 /*          least zero. */
00191 
00192 /*  MVAL    (input) INTEGER array, dimension (NSIZES) */
00193 /*          The values of the matrix row dimension M. */
00194 
00195 /*  NVAL    (input) INTEGER array, dimension (NSIZES) */
00196 /*          The values of the matrix column dimension N. */
00197 
00198 /*  NWDTHS  (input) INTEGER */
00199 /*          The number of bandwidths to use.  If it is zero, */
00200 /*          SCHKBB does nothing.  It must be at least zero. */
00201 
00202 /*  KK      (input) INTEGER array, dimension (NWDTHS) */
00203 /*          An array containing the bandwidths to be used for the band */
00204 /*          matrices.  The values must be at least zero. */
00205 
00206 /*  NTYPES  (input) INTEGER */
00207 /*          The number of elements in DOTYPE.   If it is zero, SCHKBB */
00208 /*          does nothing.  It must be at least zero.  If it is MAXTYP+1 */
00209 /*          and NSIZES is 1, then an additional type, MAXTYP+1 is */
00210 /*          defined, which is to use whatever matrix is in A.  This */
00211 /*          is only useful if DOTYPE(1:MAXTYP) is .FALSE. and */
00212 /*          DOTYPE(MAXTYP+1) is .TRUE. . */
00213 
00214 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00215 /*          If DOTYPE(j) is .TRUE., then for each size in NN a */
00216 /*          matrix of that size and of type j will be generated. */
00217 /*          If NTYPES is smaller than the maximum number of types */
00218 /*          defined (PARAMETER MAXTYP), then types NTYPES+1 through */
00219 /*          MAXTYP will not be generated.  If NTYPES is larger */
00220 /*          than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES) */
00221 /*          will be ignored. */
00222 
00223 /*  NRHS    (input) INTEGER */
00224 /*          The number of columns in the "right-hand side" matrix C. */
00225 /*          If NRHS = 0, then the operations on the right-hand side will */
00226 /*          not be tested. NRHS must be at least 0. */
00227 
00228 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00229 /*          On entry ISEED specifies the seed of the random number */
00230 /*          generator. The array elements should be between 0 and 4095; */
00231 /*          if not they will be reduced mod 4096.  Also, ISEED(4) must */
00232 /*          be odd.  The random number generator uses a linear */
00233 /*          congruential sequence limited to small integers, and so */
00234 /*          should produce machine independent random numbers. The */
00235 /*          values of ISEED are changed on exit, and can be used in the */
00236 /*          next call to SCHKBB to continue the same random number */
00237 /*          sequence. */
00238 
00239 /*  THRESH  (input) REAL */
00240 /*          A test will count as "failed" if the "error", computed as */
00241 /*          described above, exceeds THRESH.  Note that the error */
00242 /*          is scaled to be O(1), so THRESH should be a reasonably */
00243 /*          small multiple of 1, e.g., 10 or 100.  In particular, */
00244 /*          it should not depend on the precision (single vs. double) */
00245 /*          or the size of the matrix.  It must be at least zero. */
00246 
00247 /*  NOUNIT  (input) INTEGER */
00248 /*          The FORTRAN unit number for printing out error messages */
00249 /*          (e.g., if a routine returns IINFO not equal to 0.) */
00250 
00251 /*  A       (input/workspace) REAL array, dimension */
00252 /*                            (LDA, max(NN)) */
00253 /*          Used to hold the matrix A. */
00254 
00255 /*  LDA     (input) INTEGER */
00256 /*          The leading dimension of A.  It must be at least 1 */
00257 /*          and at least max( NN ). */
00258 
00259 /*  AB      (workspace) REAL array, dimension (LDAB, max(NN)) */
00260 /*          Used to hold A in band storage format. */
00261 
00262 /*  LDAB    (input) INTEGER */
00263 /*          The leading dimension of AB.  It must be at least 2 (not 1!) */
00264 /*          and at least max( KK )+1. */
00265 
00266 /*  BD      (workspace) REAL array, dimension (max(NN)) */
00267 /*          Used to hold the diagonal of the bidiagonal matrix computed */
00268 /*          by SGBBRD. */
00269 
00270 /*  BE      (workspace) REAL array, dimension (max(NN)) */
00271 /*          Used to hold the off-diagonal of the bidiagonal matrix */
00272 /*          computed by SGBBRD. */
00273 
00274 /*  Q       (workspace) REAL array, dimension (LDQ, max(NN)) */
00275 /*          Used to hold the orthogonal matrix Q computed by SGBBRD. */
00276 
00277 /*  LDQ     (input) INTEGER */
00278 /*          The leading dimension of Q.  It must be at least 1 */
00279 /*          and at least max( NN ). */
00280 
00281 /*  P       (workspace) REAL array, dimension (LDP, max(NN)) */
00282 /*          Used to hold the orthogonal matrix P computed by SGBBRD. */
00283 
00284 /*  LDP     (input) INTEGER */
00285 /*          The leading dimension of P.  It must be at least 1 */
00286 /*          and at least max( NN ). */
00287 
00288 /*  C       (workspace) REAL array, dimension (LDC, max(NN)) */
00289 /*          Used to hold the matrix C updated by SGBBRD. */
00290 
00291 /*  LDC     (input) INTEGER */
00292 /*          The leading dimension of U.  It must be at least 1 */
00293 /*          and at least max( NN ). */
00294 
00295 /*  CC      (workspace) REAL array, dimension (LDC, max(NN)) */
00296 /*          Used to hold a copy of the matrix C. */
00297 
00298 /*  WORK    (workspace) REAL array, dimension (LWORK) */
00299 
00300 /*  LWORK   (input) INTEGER */
00301 /*          The number of entries in WORK.  This must be at least */
00302 /*          max( LDA+1, max(NN)+1 )*max(NN). */
00303 
00304 /*  RESULT  (output) REAL array, dimension (4) */
00305 /*          The values computed by the tests described above. */
00306 /*          The values are currently limited to 1/ulp, to avoid */
00307 /*          overflow. */
00308 
00309 /*  INFO    (output) INTEGER */
00310 /*          If 0, then everything ran OK. */
00311 
00312 /* ----------------------------------------------------------------------- */
00313 
00314 /*       Some Local Variables and Parameters: */
00315 /*       ---- ----- --------- --- ---------- */
00316 /*       ZERO, ONE       Real 0 and 1. */
00317 /*       MAXTYP          The number of types defined. */
00318 /*       NTEST           The number of tests performed, or which can */
00319 /*                       be performed so far, for the current matrix. */
00320 /*       NTESTT          The total number of tests performed so far. */
00321 /*       NMAX            Largest value in NN. */
00322 /*       NMATS           The number of matrices generated so far. */
00323 /*       NERRS           The number of tests which have exceeded THRESH */
00324 /*                       so far. */
00325 /*       COND, IMODE     Values to be passed to the matrix generators. */
00326 /*       ANORM           Norm of A; passed to matrix generators. */
00327 
00328 /*       OVFL, UNFL      Overflow and underflow thresholds. */
00329 /*       ULP, ULPINV     Finest relative precision and its inverse. */
00330 /*       RTOVFL, RTUNFL  Square roots of the previous 2 values. */
00331 /*               The following four arrays decode JTYPE: */
00332 /*       KTYPE(j)        The general type (1-10) for type "j". */
00333 /*       KMODE(j)        The MODE value to be passed to the matrix */
00334 /*                       generator for type "j". */
00335 /*       KMAGN(j)        The order of magnitude ( O(1), */
00336 /*                       O(overflow^(1/2) ), O(underflow^(1/2) ) */
00337 
00338 /*  ===================================================================== */
00339 
00340 /*     .. Parameters .. */
00341 /*     .. */
00342 /*     .. Local Scalars .. */
00343 /*     .. */
00344 /*     .. Local Arrays .. */
00345 /*     .. */
00346 /*     .. External Functions .. */
00347 /*     .. */
00348 /*     .. External Subroutines .. */
00349 /*     .. */
00350 /*     .. Intrinsic Functions .. */
00351 /*     .. */
00352 /*     .. Data statements .. */
00353     /* Parameter adjustments */
00354     --mval;
00355     --nval;
00356     --kk;
00357     --dotype;
00358     --iseed;
00359     a_dim1 = *lda;
00360     a_offset = 1 + a_dim1;
00361     a -= a_offset;
00362     ab_dim1 = *ldab;
00363     ab_offset = 1 + ab_dim1;
00364     ab -= ab_offset;
00365     --bd;
00366     --be;
00367     q_dim1 = *ldq;
00368     q_offset = 1 + q_dim1;
00369     q -= q_offset;
00370     p_dim1 = *ldp;
00371     p_offset = 1 + p_dim1;
00372     p -= p_offset;
00373     cc_dim1 = *ldc;
00374     cc_offset = 1 + cc_dim1;
00375     cc -= cc_offset;
00376     c_dim1 = *ldc;
00377     c_offset = 1 + c_dim1;
00378     c__ -= c_offset;
00379     --work;
00380     --result;
00381 
00382     /* Function Body */
00383 /*     .. */
00384 /*     .. Executable Statements .. */
00385 
00386 /*     Check for errors */
00387 
00388     ntestt = 0;
00389     *info = 0;
00390 
00391 /*     Important constants */
00392 
00393     badmm = FALSE_;
00394     badnn = FALSE_;
00395     mmax = 1;
00396     nmax = 1;
00397     mnmax = 1;
00398     i__1 = *nsizes;
00399     for (j = 1; j <= i__1; ++j) {
00400 /* Computing MAX */
00401         i__2 = mmax, i__3 = mval[j];
00402         mmax = max(i__2,i__3);
00403         if (mval[j] < 0) {
00404             badmm = TRUE_;
00405         }
00406 /* Computing MAX */
00407         i__2 = nmax, i__3 = nval[j];
00408         nmax = max(i__2,i__3);
00409         if (nval[j] < 0) {
00410             badnn = TRUE_;
00411         }
00412 /* Computing MAX */
00413 /* Computing MIN */
00414         i__4 = mval[j], i__5 = nval[j];
00415         i__2 = mnmax, i__3 = min(i__4,i__5);
00416         mnmax = max(i__2,i__3);
00417 /* L10: */
00418     }
00419 
00420     badnnb = FALSE_;
00421     kmax = 0;
00422     i__1 = *nwdths;
00423     for (j = 1; j <= i__1; ++j) {
00424 /* Computing MAX */
00425         i__2 = kmax, i__3 = kk[j];
00426         kmax = max(i__2,i__3);
00427         if (kk[j] < 0) {
00428             badnnb = TRUE_;
00429         }
00430 /* L20: */
00431     }
00432 
00433 /*     Check for errors */
00434 
00435     if (*nsizes < 0) {
00436         *info = -1;
00437     } else if (badmm) {
00438         *info = -2;
00439     } else if (badnn) {
00440         *info = -3;
00441     } else if (*nwdths < 0) {
00442         *info = -4;
00443     } else if (badnnb) {
00444         *info = -5;
00445     } else if (*ntypes < 0) {
00446         *info = -6;
00447     } else if (*nrhs < 0) {
00448         *info = -8;
00449     } else if (*lda < nmax) {
00450         *info = -13;
00451     } else if (*ldab < (kmax << 1) + 1) {
00452         *info = -15;
00453     } else if (*ldq < nmax) {
00454         *info = -19;
00455     } else if (*ldp < nmax) {
00456         *info = -21;
00457     } else if (*ldc < nmax) {
00458         *info = -23;
00459     } else if ((max(*lda,nmax) + 1) * nmax > *lwork) {
00460         *info = -26;
00461     }
00462 
00463     if (*info != 0) {
00464         i__1 = -(*info);
00465         xerbla_("SCHKBB", &i__1);
00466         return 0;
00467     }
00468 
00469 /*     Quick return if possible */
00470 
00471     if (*nsizes == 0 || *ntypes == 0 || *nwdths == 0) {
00472         return 0;
00473     }
00474 
00475 /*     More Important constants */
00476 
00477     unfl = slamch_("Safe minimum");
00478     ovfl = 1.f / unfl;
00479     ulp = slamch_("Epsilon") * slamch_("Base");
00480     ulpinv = 1.f / ulp;
00481     rtunfl = sqrt(unfl);
00482     rtovfl = sqrt(ovfl);
00483 
00484 /*     Loop over sizes, widths, types */
00485 
00486     nerrs = 0;
00487     nmats = 0;
00488 
00489     i__1 = *nsizes;
00490     for (jsize = 1; jsize <= i__1; ++jsize) {
00491         m = mval[jsize];
00492         n = nval[jsize];
00493         mnmin = min(m,n);
00494 /* Computing MAX */
00495         i__2 = max(1,m);
00496         amninv = 1.f / (real) max(i__2,n);
00497 
00498         i__2 = *nwdths;
00499         for (jwidth = 1; jwidth <= i__2; ++jwidth) {
00500             k = kk[jwidth];
00501             if (k >= m && k >= n) {
00502                 goto L150;
00503             }
00504 /* Computing MAX */
00505 /* Computing MIN */
00506             i__5 = m - 1;
00507             i__3 = 0, i__4 = min(i__5,k);
00508             kl = max(i__3,i__4);
00509 /* Computing MAX */
00510 /* Computing MIN */
00511             i__5 = n - 1;
00512             i__3 = 0, i__4 = min(i__5,k);
00513             ku = max(i__3,i__4);
00514 
00515             if (*nsizes != 1) {
00516                 mtypes = min(15,*ntypes);
00517             } else {
00518                 mtypes = min(16,*ntypes);
00519             }
00520 
00521             i__3 = mtypes;
00522             for (jtype = 1; jtype <= i__3; ++jtype) {
00523                 if (! dotype[jtype]) {
00524                     goto L140;
00525                 }
00526                 ++nmats;
00527                 ntest = 0;
00528 
00529                 for (j = 1; j <= 4; ++j) {
00530                     ioldsd[j - 1] = iseed[j];
00531 /* L30: */
00532                 }
00533 
00534 /*              Compute "A". */
00535 
00536 /*              Control parameters: */
00537 
00538 /*                  KMAGN  KMODE        KTYPE */
00539 /*              =1  O(1)   clustered 1  zero */
00540 /*              =2  large  clustered 2  identity */
00541 /*              =3  small  exponential  (none) */
00542 /*              =4         arithmetic   diagonal, (w/ singular values) */
00543 /*              =5         random log   (none) */
00544 /*              =6         random       nonhermitian, w/ singular values */
00545 /*              =7                      (none) */
00546 /*              =8                      (none) */
00547 /*              =9                      random nonhermitian */
00548 
00549                 if (mtypes > 15) {
00550                     goto L90;
00551                 }
00552 
00553                 itype = ktype[jtype - 1];
00554                 imode = kmode[jtype - 1];
00555 
00556 /*              Compute norm */
00557 
00558                 switch (kmagn[jtype - 1]) {
00559                     case 1:  goto L40;
00560                     case 2:  goto L50;
00561                     case 3:  goto L60;
00562                 }
00563 
00564 L40:
00565                 anorm = 1.f;
00566                 goto L70;
00567 
00568 L50:
00569                 anorm = rtovfl * ulp * amninv;
00570                 goto L70;
00571 
00572 L60:
00573                 anorm = rtunfl * max(m,n) * ulpinv;
00574                 goto L70;
00575 
00576 L70:
00577 
00578                 slaset_("Full", lda, &n, &c_b18, &c_b18, &a[a_offset], lda);
00579                 slaset_("Full", ldab, &n, &c_b18, &c_b18, &ab[ab_offset], 
00580                         ldab);
00581                 iinfo = 0;
00582                 cond = ulpinv;
00583 
00584 /*              Special Matrices -- Identity & Jordan block */
00585 
00586 /*                 Zero */
00587 
00588                 if (itype == 1) {
00589                     iinfo = 0;
00590 
00591                 } else if (itype == 2) {
00592 
00593 /*                 Identity */
00594 
00595                     i__4 = n;
00596                     for (jcol = 1; jcol <= i__4; ++jcol) {
00597                         a[jcol + jcol * a_dim1] = anorm;
00598 /* L80: */
00599                     }
00600 
00601                 } else if (itype == 4) {
00602 
00603 /*                 Diagonal Matrix, singular values specified */
00604 
00605                     slatms_(&m, &n, "S", &iseed[1], "N", &work[1], &imode, &
00606                             cond, &anorm, &c__0, &c__0, "N", &a[a_offset], 
00607                             lda, &work[m + 1], &iinfo);
00608 
00609                 } else if (itype == 6) {
00610 
00611 /*                 Nonhermitian, singular values specified */
00612 
00613                     slatms_(&m, &n, "S", &iseed[1], "N", &work[1], &imode, &
00614                             cond, &anorm, &kl, &ku, "N", &a[a_offset], lda, &
00615                             work[m + 1], &iinfo);
00616 
00617                 } else if (itype == 9) {
00618 
00619 /*                 Nonhermitian, random entries */
00620 
00621                     slatmr_(&m, &n, "S", &iseed[1], "N", &work[1], &c__6, &
00622                             c_b35, &c_b35, "T", "N", &work[n + 1], &c__1, &
00623                             c_b35, &work[(n << 1) + 1], &c__1, &c_b35, "N", 
00624                             idumma, &kl, &ku, &c_b18, &anorm, "N", &a[
00625                             a_offset], lda, idumma, &iinfo);
00626 
00627                 } else {
00628 
00629                     iinfo = 1;
00630                 }
00631 
00632 /*              Generate Right-Hand Side */
00633 
00634                 slatmr_(&m, nrhs, "S", &iseed[1], "N", &work[1], &c__6, &
00635                         c_b35, &c_b35, "T", "N", &work[m + 1], &c__1, &c_b35, 
00636                         &work[(m << 1) + 1], &c__1, &c_b35, "N", idumma, &m, 
00637                         nrhs, &c_b18, &c_b35, "NO", &c__[c_offset], ldc, 
00638                         idumma, &iinfo);
00639 
00640                 if (iinfo != 0) {
00641                     io___41.ciunit = *nounit;
00642                     s_wsfe(&io___41);
00643                     do_fio(&c__1, "Generator", (ftnlen)9);
00644                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00645                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00646                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00647                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00648                             ;
00649                     e_wsfe();
00650                     *info = abs(iinfo);
00651                     return 0;
00652                 }
00653 
00654 L90:
00655 
00656 /*              Copy A to band storage. */
00657 
00658                 i__4 = n;
00659                 for (j = 1; j <= i__4; ++j) {
00660 /* Computing MAX */
00661                     i__5 = 1, i__6 = j - ku;
00662 /* Computing MIN */
00663                     i__8 = m, i__9 = j + kl;
00664                     i__7 = min(i__8,i__9);
00665                     for (i__ = max(i__5,i__6); i__ <= i__7; ++i__) {
00666                         ab[ku + 1 + i__ - j + j * ab_dim1] = a[i__ + j * 
00667                                 a_dim1];
00668 /* L100: */
00669                     }
00670 /* L110: */
00671                 }
00672 
00673 /*              Copy C */
00674 
00675                 slacpy_("Full", &m, nrhs, &c__[c_offset], ldc, &cc[cc_offset], 
00676                          ldc);
00677 
00678 /*              Call SGBBRD to compute B, Q and P, and to update C. */
00679 
00680                 sgbbrd_("B", &m, &n, nrhs, &kl, &ku, &ab[ab_offset], ldab, &
00681                         bd[1], &be[1], &q[q_offset], ldq, &p[p_offset], ldp, &
00682                         cc[cc_offset], ldc, &work[1], &iinfo);
00683 
00684                 if (iinfo != 0) {
00685                     io___43.ciunit = *nounit;
00686                     s_wsfe(&io___43);
00687                     do_fio(&c__1, "SGBBRD", (ftnlen)6);
00688                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00689                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00690                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00691                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00692                             ;
00693                     e_wsfe();
00694                     *info = abs(iinfo);
00695                     if (iinfo < 0) {
00696                         return 0;
00697                     } else {
00698                         result[1] = ulpinv;
00699                         goto L120;
00700                     }
00701                 }
00702 
00703 /*              Test 1:  Check the decomposition A := Q * B * P' */
00704 /*                   2:  Check the orthogonality of Q */
00705 /*                   3:  Check the orthogonality of P */
00706 /*                   4:  Check the computation of Q' * C */
00707 
00708                 sbdt01_(&m, &n, &c_n1, &a[a_offset], lda, &q[q_offset], ldq, &
00709                         bd[1], &be[1], &p[p_offset], ldp, &work[1], &result[1]
00710 );
00711                 sort01_("Columns", &m, &m, &q[q_offset], ldq, &work[1], lwork, 
00712                          &result[2]);
00713                 sort01_("Rows", &n, &n, &p[p_offset], ldp, &work[1], lwork, &
00714                         result[3]);
00715                 sbdt02_(&m, nrhs, &c__[c_offset], ldc, &cc[cc_offset], ldc, &
00716                         q[q_offset], ldq, &work[1], &result[4]);
00717 
00718 /*              End of Loop -- Check for RESULT(j) > THRESH */
00719 
00720                 ntest = 4;
00721 L120:
00722                 ntestt += ntest;
00723 
00724 /*              Print out tests which fail. */
00725 
00726                 i__4 = ntest;
00727                 for (jr = 1; jr <= i__4; ++jr) {
00728                     if (result[jr] >= *thresh) {
00729                         if (nerrs == 0) {
00730                             slahd2_(nounit, "SBB");
00731                         }
00732                         ++nerrs;
00733                         io___45.ciunit = *nounit;
00734                         s_wsfe(&io___45);
00735                         do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00736                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00737                         do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer));
00738                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
00739                                 integer));
00740                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
00741                                 ;
00742                         do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
00743                         do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
00744                                 real));
00745                         e_wsfe();
00746                     }
00747 /* L130: */
00748                 }
00749 
00750 L140:
00751                 ;
00752             }
00753 L150:
00754             ;
00755         }
00756 /* L160: */
00757     }
00758 
00759 /*     Summary */
00760 
00761     slasum_("SBB", nounit, &nerrs, &ntestt);
00762     return 0;
00763 
00764 
00765 /*     End of SCHKBB */
00766 
00767 } /* schkbb_ */


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