zckgqr.c
Go to the documentation of this file.
00001 /* zckgqr.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 integer c__8 = 8;
00019 static integer c__1 = 1;
00020 static integer c__0 = 0;
00021 
00022 /* Subroutine */ int zckgqr_(integer *nm, integer *mval, integer *np, integer 
00023         *pval, integer *nn, integer *nval, integer *nmats, integer *iseed, 
00024         doublereal *thresh, integer *nmax, doublecomplex *a, doublecomplex *
00025         af, doublecomplex *aq, doublecomplex *ar, doublecomplex *taua, 
00026         doublecomplex *b, doublecomplex *bf, doublecomplex *bz, doublecomplex 
00027         *bt, doublecomplex *bwk, doublecomplex *taub, doublecomplex *work, 
00028         doublereal *rwork, integer *nin, integer *nout, integer *info)
00029 {
00030     /* Format strings */
00031     static char fmt_9999[] = "(\002 ZLATMS in ZCKGQR:    INFO = \002,i5)";
00032     static char fmt_9998[] = "(\002 M=\002,i4,\002 P=\002,i4,\002, N=\002,"
00033             "i4,\002, type \002,i2,\002, test \002,i2,\002, ratio=\002,g13.6)";
00034     static char fmt_9997[] = "(\002 N=\002,i4,\002 M=\002,i4,\002, P=\002,"
00035             "i4,\002, type \002,i2,\002, test \002,i2,\002, ratio=\002,g13.6)";
00036 
00037     /* System generated locals */
00038     integer i__1, i__2, i__3, i__4;
00039 
00040     /* Builtin functions */
00041     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00042     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00043 
00044     /* Local variables */
00045     integer i__, m, n, p, im, in, ip, nt, lda, ldb, kla, klb, kua, kub;
00046     char path[3];
00047     integer imat;
00048     char type__[1];
00049     integer nrun, modea, modeb, nfail;
00050     char dista[1], distb[1];
00051     integer iinfo;
00052     doublereal anorm, bnorm;
00053     integer lwork;
00054     extern /* Subroutine */ int dlatb9_(char *, integer *, integer *, integer 
00055             *, integer *, char *, integer *, integer *, integer *, integer *, 
00056             doublereal *, doublereal *, integer *, integer *, doublereal *, 
00057             doublereal *, char *, char *), 
00058             alahdg_(integer *, char *);
00059     doublereal cndnma, cndnmb;
00060     extern /* Subroutine */ int alareq_(char *, integer *, logical *, integer 
00061             *, integer *, integer *), alasum_(char *, integer *, 
00062             integer *, integer *, integer *);
00063     logical dotype[8];
00064     extern /* Subroutine */ int zlatms_(integer *, integer *, char *, integer 
00065             *, char *, doublereal *, integer *, doublereal *, doublereal *, 
00066             integer *, integer *, char *, doublecomplex *, integer *, 
00067             doublecomplex *, integer *);
00068     logical firstt;
00069     doublereal result[7];
00070     extern /* Subroutine */ int zgqrts_(integer *, integer *, integer *, 
00071             doublecomplex *, doublecomplex *, doublecomplex *, doublecomplex *
00072 , integer *, doublecomplex *, doublecomplex *, doublecomplex *, 
00073             doublecomplex *, doublecomplex *, doublecomplex *, integer *, 
00074             doublecomplex *, doublecomplex *, integer *, doublereal *, 
00075             doublereal *), zgrqts_(integer *, integer *, integer *, 
00076             doublecomplex *, doublecomplex *, doublecomplex *, doublecomplex *
00077 , integer *, doublecomplex *, doublecomplex *, doublecomplex *, 
00078             doublecomplex *, doublecomplex *, doublecomplex *, integer *, 
00079             doublecomplex *, doublecomplex *, integer *, doublereal *, 
00080             doublereal *);
00081 
00082     /* Fortran I/O blocks */
00083     static cilist io___30 = { 0, 0, 0, fmt_9999, 0 };
00084     static cilist io___31 = { 0, 0, 0, fmt_9999, 0 };
00085     static cilist io___35 = { 0, 0, 0, fmt_9998, 0 };
00086     static cilist io___36 = { 0, 0, 0, fmt_9999, 0 };
00087     static cilist io___37 = { 0, 0, 0, fmt_9999, 0 };
00088     static cilist io___38 = { 0, 0, 0, fmt_9997, 0 };
00089 
00090 
00091 
00092 /*  -- LAPACK test routine (version 3.1) -- */
00093 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00094 /*     November 2006 */
00095 
00096 /*     .. Scalar Arguments .. */
00097 /*     .. */
00098 /*     .. Array Arguments .. */
00099 /*     .. */
00100 
00101 /*  Purpose */
00102 /*  ======= */
00103 
00104 /*  ZCKGQR tests */
00105 /*  ZGGQRF: GQR factorization for N-by-M matrix A and N-by-P matrix B, */
00106 /*  ZGGRQF: GRQ factorization for M-by-N matrix A and P-by-N matrix B. */
00107 
00108 /*  Arguments */
00109 /*  ========= */
00110 
00111 /*  NM      (input) INTEGER */
00112 /*          The number of values of M contained in the vector MVAL. */
00113 
00114 /*  MVAL    (input) INTEGER array, dimension (NM) */
00115 /*          The values of the matrix row(column) dimension M. */
00116 
00117 /*  NP      (input) INTEGER */
00118 /*          The number of values of P contained in the vector PVAL. */
00119 
00120 /*  PVAL    (input) INTEGER array, dimension (NP) */
00121 /*          The values of the matrix row(column) dimension P. */
00122 
00123 /*  NN      (input) INTEGER */
00124 /*          The number of values of N contained in the vector NVAL. */
00125 
00126 /*  NVAL    (input) INTEGER array, dimension (NN) */
00127 /*          The values of the matrix column(row) dimension N. */
00128 
00129 /*  NMATS   (input) INTEGER */
00130 /*          The number of matrix types to be tested for each combination */
00131 /*          of matrix dimensions.  If NMATS >= NTYPES (the maximum */
00132 /*          number of matrix types), then all the different types are */
00133 /*          generated for testing.  If NMATS < NTYPES, another input line */
00134 /*          is read to get the numbers of the matrix types to be used. */
00135 
00136 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00137 /*          On entry, the seed of the random number generator.  The array */
00138 /*          elements should be between 0 and 4095, otherwise they will be */
00139 /*          reduced mod 4096, and ISEED(4) must be odd. */
00140 /*          On exit, the next seed in the random number sequence after */
00141 /*          all the test matrices have been generated. */
00142 
00143 /*  THRESH  (input) DOUBLE PRECISION */
00144 /*          The threshold value for the test ratios.  A result is */
00145 /*          included in the output file if RESULT >= THRESH.  To have */
00146 /*          every test ratio printed, use THRESH = 0. */
00147 
00148 /*  NMAX    (input) INTEGER */
00149 /*          The maximum value permitted for M or N, used in dimensioning */
00150 /*          the work arrays. */
00151 
00152 /*  A       (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00153 
00154 /*  AF      (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00155 
00156 /*  AQ      (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00157 
00158 /*  AR      (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00159 
00160 /*  TAUA    (workspace) COMPLEX*16 array, dimension (NMAX) */
00161 
00162 /*  B       (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00163 
00164 /*  BF      (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00165 
00166 /*  BZ      (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00167 
00168 /*  BT      (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00169 
00170 /*  BWK     (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00171 
00172 /*  TAUB    (workspace) COMPLEX*16 array, dimension (NMAX) */
00173 
00174 /*  WORK    (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00175 
00176 /*  RWORK   (workspace) DOUBLE PRECISION array, dimension (NMAX) */
00177 
00178 /*  NIN     (input) INTEGER */
00179 /*          The unit number for input. */
00180 
00181 /*  NOUT    (input) INTEGER */
00182 /*          The unit number for output. */
00183 
00184 /*  INFO    (output) INTEGER */
00185 /*          = 0 :  successful exit */
00186 /*          > 0 :  If ZLATMS returns an error code, the absolute value */
00187 /*                 of it is returned. */
00188 
00189 /*  ===================================================================== */
00190 
00191 /*     .. Parameters .. */
00192 /*     .. */
00193 /*     .. Local Scalars .. */
00194 /*     .. */
00195 /*     .. Local Arrays .. */
00196 /*     .. */
00197 /*     .. External Subroutines .. */
00198 /*     .. */
00199 /*     .. Intrinsic Functions .. */
00200 /*     .. */
00201 /*     .. Executable Statements .. */
00202 
00203 /*     Initialize constants. */
00204 
00205     /* Parameter adjustments */
00206     --rwork;
00207     --work;
00208     --taub;
00209     --bwk;
00210     --bt;
00211     --bz;
00212     --bf;
00213     --b;
00214     --taua;
00215     --ar;
00216     --aq;
00217     --af;
00218     --a;
00219     --iseed;
00220     --nval;
00221     --pval;
00222     --mval;
00223 
00224     /* Function Body */
00225     s_copy(path, "GQR", (ftnlen)3, (ftnlen)3);
00226     *info = 0;
00227     nrun = 0;
00228     nfail = 0;
00229     firstt = TRUE_;
00230     alareq_(path, nmats, dotype, &c__8, nin, nout);
00231     lda = *nmax;
00232     ldb = *nmax;
00233     lwork = *nmax * *nmax;
00234 
00235 /*     Do for each value of M in MVAL. */
00236 
00237     i__1 = *nm;
00238     for (im = 1; im <= i__1; ++im) {
00239         m = mval[im];
00240 
00241 /*        Do for each value of P in PVAL. */
00242 
00243         i__2 = *np;
00244         for (ip = 1; ip <= i__2; ++ip) {
00245             p = pval[ip];
00246 
00247 /*           Do for each value of N in NVAL. */
00248 
00249             i__3 = *nn;
00250             for (in = 1; in <= i__3; ++in) {
00251                 n = nval[in];
00252 
00253                 for (imat = 1; imat <= 8; ++imat) {
00254 
00255 /*                 Do the tests only if DOTYPE( IMAT ) is true. */
00256 
00257                     if (! dotype[imat - 1]) {
00258                         goto L30;
00259                     }
00260 
00261 /*                 Test ZGGRQF */
00262 
00263 /*                 Set up parameters with DLATB9 and generate test */
00264 /*                 matrices A and B with ZLATMS. */
00265 
00266                     dlatb9_("GRQ", &imat, &m, &p, &n, type__, &kla, &kua, &
00267                             klb, &kub, &anorm, &bnorm, &modea, &modeb, &
00268                             cndnma, &cndnmb, dista, distb);
00269 
00270                     zlatms_(&m, &n, dista, &iseed[1], type__, &rwork[1], &
00271                             modea, &cndnma, &anorm, &kla, &kua, "No packing", 
00272                             &a[1], &lda, &work[1], &iinfo);
00273                     if (iinfo != 0) {
00274                         io___30.ciunit = *nout;
00275                         s_wsfe(&io___30);
00276                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00277                                 ;
00278                         e_wsfe();
00279                         *info = abs(iinfo);
00280                         goto L30;
00281                     }
00282 
00283                     zlatms_(&p, &n, distb, &iseed[1], type__, &rwork[1], &
00284                             modeb, &cndnmb, &bnorm, &klb, &kub, "No packing", 
00285                             &b[1], &ldb, &work[1], &iinfo);
00286                     if (iinfo != 0) {
00287                         io___31.ciunit = *nout;
00288                         s_wsfe(&io___31);
00289                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00290                                 ;
00291                         e_wsfe();
00292                         *info = abs(iinfo);
00293                         goto L30;
00294                     }
00295 
00296                     nt = 4;
00297 
00298                     zgrqts_(&m, &p, &n, &a[1], &af[1], &aq[1], &ar[1], &lda, &
00299                             taua[1], &b[1], &bf[1], &bz[1], &bt[1], &bwk[1], &
00300                             ldb, &taub[1], &work[1], &lwork, &rwork[1], 
00301                             result);
00302 
00303 /*                 Print information about the tests that did not */
00304 /*                 pass the threshold. */
00305 
00306                     i__4 = nt;
00307                     for (i__ = 1; i__ <= i__4; ++i__) {
00308                         if (result[i__ - 1] >= *thresh) {
00309                             if (nfail == 0 && firstt) {
00310                                 firstt = FALSE_;
00311                                 alahdg_(nout, "GRQ");
00312                             }
00313                             io___35.ciunit = *nout;
00314                             s_wsfe(&io___35);
00315                             do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer))
00316                                     ;
00317                             do_fio(&c__1, (char *)&p, (ftnlen)sizeof(integer))
00318                                     ;
00319                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00320                                     ;
00321                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00322                                     integer));
00323                             do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(
00324                                     integer));
00325                             do_fio(&c__1, (char *)&result[i__ - 1], (ftnlen)
00326                                     sizeof(doublereal));
00327                             e_wsfe();
00328                             ++nfail;
00329                         }
00330 /* L10: */
00331                     }
00332                     nrun += nt;
00333 
00334 /*                 Test ZGGQRF */
00335 
00336 /*                 Set up parameters with DLATB9 and generate test */
00337 /*                 matrices A and B with ZLATMS. */
00338 
00339                     dlatb9_("GQR", &imat, &m, &p, &n, type__, &kla, &kua, &
00340                             klb, &kub, &anorm, &bnorm, &modea, &modeb, &
00341                             cndnma, &cndnmb, dista, distb);
00342 
00343                     zlatms_(&n, &m, dista, &iseed[1], type__, &rwork[1], &
00344                             modea, &cndnma, &anorm, &kla, &kua, "No packing", 
00345                             &a[1], &lda, &work[1], &iinfo);
00346                     if (iinfo != 0) {
00347                         io___36.ciunit = *nout;
00348                         s_wsfe(&io___36);
00349                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00350                                 ;
00351                         e_wsfe();
00352                         *info = abs(iinfo);
00353                         goto L30;
00354                     }
00355 
00356                     zlatms_(&n, &p, distb, &iseed[1], type__, &rwork[1], &
00357                             modea, &cndnma, &bnorm, &klb, &kub, "No packing", 
00358                             &b[1], &ldb, &work[1], &iinfo);
00359                     if (iinfo != 0) {
00360                         io___37.ciunit = *nout;
00361                         s_wsfe(&io___37);
00362                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00363                                 ;
00364                         e_wsfe();
00365                         *info = abs(iinfo);
00366                         goto L30;
00367                     }
00368 
00369                     nt = 4;
00370 
00371                     zgqrts_(&n, &m, &p, &a[1], &af[1], &aq[1], &ar[1], &lda, &
00372                             taua[1], &b[1], &bf[1], &bz[1], &bt[1], &bwk[1], &
00373                             ldb, &taub[1], &work[1], &lwork, &rwork[1], 
00374                             result);
00375 
00376 /*                 Print information about the tests that did not */
00377 /*                 pass the threshold. */
00378 
00379                     i__4 = nt;
00380                     for (i__ = 1; i__ <= i__4; ++i__) {
00381                         if (result[i__ - 1] >= *thresh) {
00382                             if (nfail == 0 && firstt) {
00383                                 firstt = FALSE_;
00384                                 alahdg_(nout, path);
00385                             }
00386                             io___38.ciunit = *nout;
00387                             s_wsfe(&io___38);
00388                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00389                                     ;
00390                             do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer))
00391                                     ;
00392                             do_fio(&c__1, (char *)&p, (ftnlen)sizeof(integer))
00393                                     ;
00394                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00395                                     integer));
00396                             do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(
00397                                     integer));
00398                             do_fio(&c__1, (char *)&result[i__ - 1], (ftnlen)
00399                                     sizeof(doublereal));
00400                             e_wsfe();
00401                             ++nfail;
00402                         }
00403 /* L20: */
00404                     }
00405                     nrun += nt;
00406 
00407 L30:
00408                     ;
00409                 }
00410 /* L40: */
00411             }
00412 /* L50: */
00413         }
00414 /* L60: */
00415     }
00416 
00417 /*     Print a summary of the results. */
00418 
00419     alasum_(path, nout, &nfail, &nrun, &c__0);
00420 
00421     return 0;
00422 
00423 /*     End of ZCKGQR */
00424 
00425 } /* zckgqr_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:21