sckgsv.c
Go to the documentation of this file.
00001 /* sckgsv.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 sckgsv_(integer *nm, integer *mval, integer *pval, 
00023         integer *nval, integer *nmats, integer *iseed, real *thresh, integer *
00024         nmax, real *a, real *af, real *b, real *bf, real *u, real *v, real *q, 
00025          real *alpha, real *beta, real *r__, integer *iwork, real *work, real 
00026         *rwork, integer *nin, integer *nout, integer *info)
00027 {
00028     /* Format strings */
00029     static char fmt_9999[] = "(\002 SLATMS in SCKGSV   INFO = \002,i5)";
00030     static char fmt_9998[] = "(\002 M=\002,i4,\002 P=\002,i4,\002, N=\002,"
00031             "i4,\002, type \002,i2,\002, test \002,i2,\002, ratio=\002,g13.6)";
00032 
00033     /* System generated locals */
00034     integer i__1, i__2;
00035 
00036     /* Builtin functions */
00037     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00038     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00039 
00040     /* Local variables */
00041     integer i__, m, n, p, im, nt, lda, ldb, kla, klb, kua, kub, ldq, ldr, ldu,
00042              ldv, imat;
00043     char path[3], type__[1];
00044     integer nrun, modea, modeb, nfail;
00045     char dista[1], distb[1];
00046     integer iinfo;
00047     real anorm, bnorm;
00048     integer lwork;
00049     extern /* Subroutine */ int slatb9_(char *, integer *, integer *, integer 
00050             *, integer *, char *, integer *, integer *, integer *, integer *, 
00051             real *, real *, integer *, integer *, real *, real *, char *, 
00052             char *), alahdg_(integer *, char *
00053 );
00054     real cndnma, cndnmb;
00055     extern /* Subroutine */ int alareq_(char *, integer *, logical *, integer 
00056             *, integer *, integer *), alasum_(char *, integer *, 
00057             integer *, integer *, integer *), slatms_(integer *, 
00058             integer *, char *, integer *, char *, real *, integer *, real *, 
00059             real *, integer *, integer *, char *, real *, integer *, real *, 
00060             integer *);
00061     logical dotype[8], firstt;
00062     real result[7];
00063     extern /* Subroutine */ int sgsvts_(integer *, integer *, integer *, real 
00064             *, real *, integer *, real *, real *, integer *, real *, integer *
00065 , real *, integer *, real *, integer *, real *, real *, real *, 
00066             integer *, integer *, real *, integer *, real *, real *);
00067 
00068     /* Fortran I/O blocks */
00069     static cilist io___32 = { 0, 0, 0, fmt_9999, 0 };
00070     static cilist io___33 = { 0, 0, 0, fmt_9999, 0 };
00071     static cilist io___37 = { 0, 0, 0, fmt_9998, 0 };
00072 
00073 
00074 
00075 /*  -- LAPACK test routine (version 3.1) -- */
00076 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00077 /*     November 2006 */
00078 
00079 /*     .. Scalar Arguments .. */
00080 /*     .. */
00081 /*     .. Array Arguments .. */
00082 /*     .. */
00083 
00084 /*  Purpose */
00085 /*  ======= */
00086 
00087 /*  SCKGSV tests SGGSVD: */
00088 /*         the GSVD for M-by-N matrix A and P-by-N matrix B. */
00089 
00090 /*  Arguments */
00091 /*  ========= */
00092 
00093 /*  NM      (input) INTEGER */
00094 /*          The number of values of M contained in the vector MVAL. */
00095 
00096 /*  MVAL    (input) INTEGER array, dimension (NM) */
00097 /*          The values of the matrix row dimension M. */
00098 
00099 /*  PVAL    (input) INTEGER array, dimension (NP) */
00100 /*          The values of the matrix row dimension P. */
00101 
00102 /*  NVAL    (input) INTEGER array, dimension (NN) */
00103 /*          The values of the matrix column dimension N. */
00104 
00105 /*  NMATS   (input) INTEGER */
00106 /*          The number of matrix types to be tested for each combination */
00107 /*          of matrix dimensions.  If NMATS >= NTYPES (the maximum */
00108 /*          number of matrix types), then all the different types are */
00109 /*          generated for testing.  If NMATS < NTYPES, another input line */
00110 /*          is read to get the numbers of the matrix types to be used. */
00111 
00112 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00113 /*          On entry, the seed of the random number generator.  The array */
00114 /*          elements should be between 0 and 4095, otherwise they will be */
00115 /*          reduced mod 4096, and ISEED(4) must be odd. */
00116 /*          On exit, the next seed in the random number sequence after */
00117 /*          all the test matrices have been generated. */
00118 
00119 /*  THRESH  (input) REAL */
00120 /*          The threshold value for the test ratios.  A result is */
00121 /*          included in the output file if RESULT >= THRESH.  To have */
00122 /*          every test ratio printed, use THRESH = 0. */
00123 
00124 /*  NMAX    (input) INTEGER */
00125 /*          The maximum value permitted for M or N, used in dimensioning */
00126 /*          the work arrays. */
00127 
00128 /*  A       (workspace) REAL array, dimension (NMAX*NMAX) */
00129 
00130 /*  AF      (workspace) REAL array, dimension (NMAX*NMAX) */
00131 
00132 /*  B       (workspace) REAL array, dimension (NMAX*NMAX) */
00133 
00134 /*  BF      (workspace) REAL array, dimension (NMAX*NMAX) */
00135 
00136 /*  U       (workspace) REAL array, dimension (NMAX*NMAX) */
00137 
00138 /*  V       (workspace) REAL array, dimension (NMAX*NMAX) */
00139 
00140 /*  Q       (workspace) REAL array, dimension (NMAX*NMAX) */
00141 
00142 /*  ALPHA   (workspace) REAL array, dimension (NMAX) */
00143 
00144 /*  BETA    (workspace) REAL array, dimension (NMAX) */
00145 
00146 /*  R       (workspace) REAL array, dimension (NMAX*NMAX) */
00147 
00148 /*  IWORK   (workspace) INTEGER array, dimension (NMAX) */
00149 
00150 /*  WORK    (workspace) REAL array, dimension (NMAX*NMAX) */
00151 
00152 /*  RWORK   (workspace) REAL array, dimension (NMAX) */
00153 
00154 /*  NIN     (input) INTEGER */
00155 /*          The unit number for input. */
00156 
00157 /*  NOUT    (input) INTEGER */
00158 /*          The unit number for output. */
00159 
00160 /*  INFO    (output) INTEGER */
00161 /*          = 0 :  successful exit */
00162 /*          > 0 :  If SLATMS returns an error code, the absolute value */
00163 /*                 of it is returned. */
00164 
00165 /*  ===================================================================== */
00166 
00167 /*     .. Parameters .. */
00168 /*     .. */
00169 /*     .. Local Scalars .. */
00170 /*     .. */
00171 /*     .. Local Arrays .. */
00172 /*     .. */
00173 /*     .. External Subroutines .. */
00174 /*     .. */
00175 /*     .. Intrinsic Functions .. */
00176 /*     .. */
00177 /*     .. Executable Statements .. */
00178 
00179 /*     Initialize constants and the random number seed. */
00180 
00181     /* Parameter adjustments */
00182     --rwork;
00183     --work;
00184     --iwork;
00185     --r__;
00186     --beta;
00187     --alpha;
00188     --q;
00189     --v;
00190     --u;
00191     --bf;
00192     --b;
00193     --af;
00194     --a;
00195     --iseed;
00196     --nval;
00197     --pval;
00198     --mval;
00199 
00200     /* Function Body */
00201     s_copy(path, "GSV", (ftnlen)3, (ftnlen)3);
00202     *info = 0;
00203     nrun = 0;
00204     nfail = 0;
00205     firstt = TRUE_;
00206     alareq_(path, nmats, dotype, &c__8, nin, nout);
00207     lda = *nmax;
00208     ldb = *nmax;
00209     ldu = *nmax;
00210     ldv = *nmax;
00211     ldq = *nmax;
00212     ldr = *nmax;
00213     lwork = *nmax * *nmax;
00214 
00215 /*     Do for each value of M in MVAL. */
00216 
00217     i__1 = *nm;
00218     for (im = 1; im <= i__1; ++im) {
00219         m = mval[im];
00220         p = pval[im];
00221         n = nval[im];
00222 
00223         for (imat = 1; imat <= 8; ++imat) {
00224 
00225 /*           Do the tests only if DOTYPE( IMAT ) is true. */
00226 
00227             if (! dotype[imat - 1]) {
00228                 goto L20;
00229             }
00230 
00231 /*           Set up parameters with SLATB9 and generate test */
00232 /*           matrices A and B with SLATMS. */
00233 
00234             slatb9_(path, &imat, &m, &p, &n, type__, &kla, &kua, &klb, &kub, &
00235                     anorm, &bnorm, &modea, &modeb, &cndnma, &cndnmb, dista, 
00236                     distb);
00237 
00238 /*           Generate M by N matrix A */
00239 
00240             slatms_(&m, &n, dista, &iseed[1], type__, &rwork[1], &modea, &
00241                     cndnma, &anorm, &kla, &kua, "No packing", &a[1], &lda, &
00242                     work[1], &iinfo);
00243             if (iinfo != 0) {
00244                 io___32.ciunit = *nout;
00245                 s_wsfe(&io___32);
00246                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00247                 e_wsfe();
00248                 *info = abs(iinfo);
00249                 goto L20;
00250             }
00251 
00252             slatms_(&p, &n, distb, &iseed[1], type__, &rwork[1], &modeb, &
00253                     cndnmb, &bnorm, &klb, &kub, "No packing", &b[1], &ldb, &
00254                     work[1], &iinfo);
00255             if (iinfo != 0) {
00256                 io___33.ciunit = *nout;
00257                 s_wsfe(&io___33);
00258                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00259                 e_wsfe();
00260                 *info = abs(iinfo);
00261                 goto L20;
00262             }
00263 
00264             nt = 6;
00265 
00266             sgsvts_(&m, &p, &n, &a[1], &af[1], &lda, &b[1], &bf[1], &ldb, &u[
00267                     1], &ldu, &v[1], &ldv, &q[1], &ldq, &alpha[1], &beta[1], &
00268                     r__[1], &ldr, &iwork[1], &work[1], &lwork, &rwork[1], 
00269                     result);
00270 
00271 /*           Print information about the tests that did not */
00272 /*           pass the threshold. */
00273 
00274             i__2 = nt;
00275             for (i__ = 1; i__ <= i__2; ++i__) {
00276                 if (result[i__ - 1] >= *thresh) {
00277                     if (nfail == 0 && firstt) {
00278                         firstt = FALSE_;
00279                         alahdg_(nout, path);
00280                     }
00281                     io___37.ciunit = *nout;
00282                     s_wsfe(&io___37);
00283                     do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00284                     do_fio(&c__1, (char *)&p, (ftnlen)sizeof(integer));
00285                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00286                     do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00287                     do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
00288                     do_fio(&c__1, (char *)&result[i__ - 1], (ftnlen)sizeof(
00289                             real));
00290                     e_wsfe();
00291                     ++nfail;
00292                 }
00293 /* L10: */
00294             }
00295             nrun += nt;
00296 L20:
00297             ;
00298         }
00299 /* L30: */
00300     }
00301 
00302 /*     Print a summary of the results. */
00303 
00304     alasum_(path, nout, &nfail, &nrun, &c__0);
00305 
00306     return 0;
00307 
00308 /*     End of SCKGSV */
00309 
00310 } /* sckgsv_ */


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