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


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