ddrvbd.c
Go to the documentation of this file.
00001 /* ddrvbd.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 /* Common Block Declarations */
00017 
00018 struct {
00019     integer infot, nunit;
00020     logical ok, lerr;
00021 } infoc_;
00022 
00023 #define infoc_1 infoc_
00024 
00025 struct {
00026     char srnamt[32];
00027 } srnamc_;
00028 
00029 #define srnamc_1 srnamc_
00030 
00031 /* Table of constant values */
00032 
00033 static doublereal c_b13 = 0.;
00034 static doublereal c_b17 = 1.;
00035 static integer c__4 = 4;
00036 static integer c__1 = 1;
00037 static integer c__0 = 0;
00038 
00039 /* Subroutine */ int ddrvbd_(integer *nsizes, integer *mm, integer *nn, 
00040         integer *ntypes, logical *dotype, integer *iseed, doublereal *thresh, 
00041         doublereal *a, integer *lda, doublereal *u, integer *ldu, doublereal *
00042         vt, integer *ldvt, doublereal *asav, doublereal *usav, doublereal *
00043         vtsav, doublereal *s, doublereal *ssav, doublereal *e, doublereal *
00044         work, integer *lwork, integer *iwork, integer *nout, integer *info)
00045 {
00046     /* Initialized data */
00047 
00048     static char cjob[1*4] = "N" "O" "S" "A";
00049 
00050     /* Format strings */
00051     static char fmt_9996[] = "(\002 DDRVBD: \002,a,\002 returned INFO=\002,i"
00052             "6,\002.\002,/9x,\002M=\002,i6,\002, N=\002,i6,\002, JTYPE=\002,i"
00053             "6,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00054     static char fmt_9995[] = "(\002 DDRVBD: \002,a,\002 returned INFO=\002,i"
00055             "6,\002.\002,/9x,\002M=\002,i6,\002, N=\002,i6,\002, JTYPE=\002,i"
00056             "6,\002, LSWORK=\002,i6,/9x,\002ISEED=(\002,3(i5,\002,\002),i5"
00057             ",\002)\002)";
00058     static char fmt_9999[] = "(\002 SVD -- Real Singular Value Decomposition"
00059             " Driver \002,/\002 Matrix types (see DDRVBD for details):\002,/"
00060             "/\002 1 = Zero matrix\002,/\002 2 = Identity matrix\002,/\002 3 "
00061             "= Evenly spaced singular values near 1\002,/\002 4 = Evenly spac"
00062             "ed singular values near underflow\002,/\002 5 = Evenly spaced si"
00063             "ngular values near overflow\002,//\002 Tests performed: ( A is d"
00064             "ense, U and V are orthogonal,\002,/19x,\002 S is an array, and U"
00065             "partial, VTpartial, and\002,/19x,\002 Spartial are partially com"
00066             "puted U, VT and S),\002,/)";
00067     static char fmt_9998[] = "(\002 1 = | A - U diag(S) VT | / ( |A| max(M,N"
00068             ") ulp ) \002,/\002 2 = | I - U**T U | / ( M ulp ) \002,/\002 3 ="
00069             " | I - VT VT**T | / ( N ulp ) \002,/\002 4 = 0 if S contains min"
00070             "(M,N) nonnegative values in\002,\002 decreasing order, else 1/ulp"
00071             "\002,/\002 5 = | U - Upartial | / ( M ulp )\002,/\002 6 = | VT -"
00072             " VTpartial | / ( N ulp )\002,/\002 7 = | S - Spartial | / ( min("
00073             "M,N) ulp |S| )\002,/\002 8 = | A - U diag(S) VT | / ( |A| max(M,"
00074             "N) ulp ) \002,/\002 9 = | I - U**T U | / ( M ulp ) \002,/\00210 "
00075             "= | I - VT VT**T | / ( N ulp ) \002,/\00211 = 0 if S contains mi"
00076             "n(M,N) nonnegative values in\002,\002 decreasing order, else 1/u"
00077             "lp\002,/\00212 = | U - Upartial | / ( M ulp )\002,/\00213 = | VT"
00078             " - VTpartial | / ( N ulp )\002,/\00214 = | S - Spartial | / ( mi"
00079             "n(M,N) ulp |S| )\002,/\00215 = | A - U diag(S) VT | / ( |A| max("
00080             "M,N) ulp ) \002,/\00216 = | I - U**T U | / ( M ulp ) \002,/\0021"
00081             "7 = | I - VT VT**T | / ( N ulp ) \002,/\00218 = 0 if S contains "
00082             "min(M,N) nonnegative values in\002,\002 decreasing order, else 1"
00083             "/ulp\002,/\00219 = | U - Upartial | / ( M ulp )\002,/\00220 = | "
00084             "VT - VTpartial | / ( N ulp )\002,/\00221 = | S - Spartial | / ( "
00085             "min(M,N) ulp |S| )\002,//)";
00086     static char fmt_9997[] = "(\002 M=\002,i5,\002, N=\002,i5,\002, type "
00087             "\002,i1,\002, IWS=\002,i1,\002, seed=\002,4(i4,\002,\002),\002 t"
00088             "est(\002,i2,\002)=\002,g11.4)";
00089 
00090     /* System generated locals */
00091     integer a_dim1, a_offset, asav_dim1, asav_offset, u_dim1, u_offset, 
00092             usav_dim1, usav_offset, vt_dim1, vt_offset, vtsav_dim1, 
00093             vtsav_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7, i__8, 
00094             i__9, i__10, i__11, i__12, i__13, i__14;
00095     doublereal d__1, d__2, d__3;
00096 
00097     /* Builtin functions */
00098     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00099     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00100 
00101     /* Local variables */
00102     integer i__, j, m, n;
00103     doublereal dif, div;
00104     integer ijq, iju;
00105     doublereal ulp;
00106     integer iws;
00107     char jobq[1], path[3], jobu[1];
00108     integer mmax, nmax;
00109     doublereal unfl, ovfl;
00110     integer ijvt;
00111     extern /* Subroutine */ int dbdt01_(integer *, integer *, integer *, 
00112             doublereal *, integer *, doublereal *, integer *, doublereal *, 
00113             doublereal *, doublereal *, integer *, doublereal *, doublereal *)
00114             ;
00115     logical badmm, badnn;
00116     integer nfail, iinfo;
00117     extern /* Subroutine */ int dort01_(char *, integer *, integer *, 
00118             doublereal *, integer *, doublereal *, integer *, doublereal *), dort03_(char *, integer *, integer *, integer *, integer 
00119             *, doublereal *, integer *, doublereal *, integer *, doublereal *, 
00120              integer *, doublereal *, integer *);
00121     doublereal anorm;
00122     integer mnmin, mnmax;
00123     char jobvt[1];
00124     integer jsize, jtype, ntest, iwtmp;
00125     extern /* Subroutine */ int dlabad_(doublereal *, doublereal *);
00126     extern doublereal dlamch_(char *);
00127     extern /* Subroutine */ int dgesdd_(char *, integer *, integer *, 
00128             doublereal *, integer *, doublereal *, doublereal *, integer *, 
00129             doublereal *, integer *, doublereal *, integer *, integer *, 
00130             integer *), dgesvd_(char *, char *, integer *, integer *, 
00131             doublereal *, integer *, doublereal *, doublereal *, integer *, 
00132             doublereal *, integer *, doublereal *, integer *, integer *), dlacpy_(char *, integer *, integer *, doublereal 
00133             *, integer *, doublereal *, integer *);
00134     integer ioldsd[4];
00135     extern /* Subroutine */ int dlaset_(char *, integer *, integer *, 
00136             doublereal *, doublereal *, doublereal *, integer *), 
00137             xerbla_(char *, integer *), dgesvj_(char *, char *, char *
00138 , integer *, integer *, doublereal *, integer *, doublereal *, 
00139             integer *, doublereal *, integer *, doublereal *, integer *, 
00140             integer *), alasvm_(char *, integer *, 
00141             integer *, integer *, integer *), dlatms_(integer *, 
00142             integer *, char *, integer *, char *, doublereal *, integer *, 
00143             doublereal *, doublereal *, integer *, integer *, char *, 
00144             doublereal *, integer *, doublereal *, integer *), dgejsv_(char *, char *, char *, char *, char *, char *, 
00145             integer *, integer *, doublereal *, integer *, doublereal *, 
00146             doublereal *, integer *, doublereal *, integer *, doublereal *, 
00147             integer *, integer *, integer *);
00148     integer minwrk;
00149     doublereal ulpinv, result[22];
00150     integer lswork, mtypes;
00151 
00152     /* Fortran I/O blocks */
00153     static cilist io___25 = { 0, 0, 0, fmt_9996, 0 };
00154     static cilist io___30 = { 0, 0, 0, fmt_9995, 0 };
00155     static cilist io___38 = { 0, 0, 0, fmt_9995, 0 };
00156     static cilist io___41 = { 0, 0, 0, fmt_9995, 0 };
00157     static cilist io___42 = { 0, 0, 0, fmt_9995, 0 };
00158     static cilist io___43 = { 0, 0, 0, fmt_9999, 0 };
00159     static cilist io___44 = { 0, 0, 0, fmt_9998, 0 };
00160     static cilist io___45 = { 0, 0, 0, fmt_9997, 0 };
00161 
00162 
00163 
00164 /*  -- LAPACK test routine (version 3.1) -- */
00165 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00166 /*     November 2006 */
00167 
00168 /*     .. Scalar Arguments .. */
00169 /*     .. */
00170 /*     .. Array Arguments .. */
00171 /*     .. */
00172 
00173 /*  Purpose */
00174 /*  ======= */
00175 
00176 /*  DDRVBD checks the singular value decomposition (SVD) drivers */
00177 /*  DGESVD, DGESDD, DGESVJ, and DGEJSV. */
00178 
00179 /*  Both DGESVD and DGESDD factor A = U diag(S) VT, where U and VT are */
00180 /*  orthogonal and diag(S) is diagonal with the entries of the array S */
00181 /*  on its diagonal. The entries of S are the singular values, */
00182 /*  nonnegative and stored in decreasing order.  U and VT can be */
00183 /*  optionally not computed, overwritten on A, or computed partially. */
00184 
00185 /*  A is M by N. Let MNMIN = min( M, N ). S has dimension MNMIN. */
00186 /*  U can be M by M or M by MNMIN. VT can be N by N or MNMIN by N. */
00187 
00188 /*  When DDRVBD is called, a number of matrix "sizes" (M's and N's) */
00189 /*  and a number of matrix "types" are specified.  For each size (M,N) */
00190 /*  and each type of matrix, and for the minimal workspace as well as */
00191 /*  workspace adequate to permit blocking, an  M x N  matrix "A" will be */
00192 /*  generated and used to test the SVD routines.  For each matrix, A will */
00193 /*  be factored as A = U diag(S) VT and the following 12 tests computed: */
00194 
00195 /*  Test for DGESVD: */
00196 
00197 /*  (1)    | A - U diag(S) VT | / ( |A| max(M,N) ulp ) */
00198 
00199 /*  (2)    | I - U'U | / ( M ulp ) */
00200 
00201 /*  (3)    | I - VT VT' | / ( N ulp ) */
00202 
00203 /*  (4)    S contains MNMIN nonnegative values in decreasing order. */
00204 /*         (Return 0 if true, 1/ULP if false.) */
00205 
00206 /*  (5)    | U - Upartial | / ( M ulp ) where Upartial is a partially */
00207 /*         computed U. */
00208 
00209 /*  (6)    | VT - VTpartial | / ( N ulp ) where VTpartial is a partially */
00210 /*         computed VT. */
00211 
00212 /*  (7)    | S - Spartial | / ( MNMIN ulp |S| ) where Spartial is the */
00213 /*         vector of singular values from the partial SVD */
00214 
00215 /*  Test for DGESDD: */
00216 
00217 /*  (8)    | A - U diag(S) VT | / ( |A| max(M,N) ulp ) */
00218 
00219 /*  (9)    | I - U'U | / ( M ulp ) */
00220 
00221 /*  (10)   | I - VT VT' | / ( N ulp ) */
00222 
00223 /*  (11)   S contains MNMIN nonnegative values in decreasing order. */
00224 /*         (Return 0 if true, 1/ULP if false.) */
00225 
00226 /*  (12)   | U - Upartial | / ( M ulp ) where Upartial is a partially */
00227 /*         computed U. */
00228 
00229 /*  (13)   | VT - VTpartial | / ( N ulp ) where VTpartial is a partially */
00230 /*         computed VT. */
00231 
00232 /*  (14)   | S - Spartial | / ( MNMIN ulp |S| ) where Spartial is the */
00233 /*         vector of singular values from the partial SVD */
00234 
00235 /*  Test for SGESVJ: */
00236 
00237 /*  (15)    | A - U diag(S) VT | / ( |A| max(M,N) ulp ) */
00238 
00239 /*  (16)    | I - U'U | / ( M ulp ) */
00240 
00241 /*  (17)   | I - VT VT' | / ( N ulp ) */
00242 
00243 /*  (18)   S contains MNMIN nonnegative values in decreasing order. */
00244 /*         (Return 0 if true, 1/ULP if false.) */
00245 
00246 /*  Test for SGEJSV: */
00247 
00248 /*  (19)    | A - U diag(S) VT | / ( |A| max(M,N) ulp ) */
00249 
00250 /*  (20)    | I - U'U | / ( M ulp ) */
00251 
00252 /*  (21)   | I - VT VT' | / ( N ulp ) */
00253 
00254 /*  (22)   S contains MNMIN nonnegative values in decreasing order. */
00255 /*         (Return 0 if true, 1/ULP if false.) */
00256 
00257 /*  The "sizes" are specified by the arrays MM(1:NSIZES) and */
00258 /*  NN(1:NSIZES); the value of each element pair (MM(j),NN(j)) */
00259 /*  specifies one size.  The "types" are specified by a logical array */
00260 /*  DOTYPE( 1:NTYPES ); if DOTYPE(j) is .TRUE., then matrix type "j" */
00261 /*  will be generated. */
00262 /*  Currently, the list of possible types is: */
00263 
00264 /*  (1)  The zero matrix. */
00265 /*  (2)  The identity matrix. */
00266 /*  (3)  A matrix of the form  U D V, where U and V are orthogonal and */
00267 /*       D has evenly spaced entries 1, ..., ULP with random signs */
00268 /*       on the diagonal. */
00269 /*  (4)  Same as (3), but multiplied by the underflow-threshold / ULP. */
00270 /*  (5)  Same as (3), but multiplied by the overflow-threshold * ULP. */
00271 
00272 /*  Arguments */
00273 /*  ========== */
00274 
00275 /*  NSIZES  (input) INTEGER */
00276 /*          The number of matrix sizes (M,N) contained in the vectors */
00277 /*          MM and NN. */
00278 
00279 /*  MM      (input) INTEGER array, dimension (NSIZES) */
00280 /*          The values of the matrix row dimension M. */
00281 
00282 /*  NN      (input) INTEGER array, dimension (NSIZES) */
00283 /*          The values of the matrix column dimension N. */
00284 
00285 /*  NTYPES  (input) INTEGER */
00286 /*          The number of elements in DOTYPE.   If it is zero, DDRVBD */
00287 /*          does nothing.  It must be at least zero.  If it is MAXTYP+1 */
00288 /*          and NSIZES is 1, then an additional type, MAXTYP+1 is */
00289 /*          defined, which is to use whatever matrices are in A and B. */
00290 /*          This is only useful if DOTYPE(1:MAXTYP) is .FALSE. and */
00291 /*          DOTYPE(MAXTYP+1) is .TRUE. . */
00292 
00293 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00294 /*          If DOTYPE(j) is .TRUE., then for each size (m,n), a matrix */
00295 /*          of type j will be generated.  If NTYPES is smaller than the */
00296 /*          maximum number of types defined (PARAMETER MAXTYP), then */
00297 /*          types NTYPES+1 through MAXTYP will not be generated.  If */
00298 /*          NTYPES is larger than MAXTYP, DOTYPE(MAXTYP+1) through */
00299 /*          DOTYPE(NTYPES) will be ignored. */
00300 
00301 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00302 /*          On entry, the seed of the random number generator.  The array */
00303 /*          elements should be between 0 and 4095; if not they will be */
00304 /*          reduced mod 4096.  Also, ISEED(4) must be odd. */
00305 /*          On exit, ISEED is changed and can be used in the next call to */
00306 /*          DDRVBD to continue the same random number sequence. */
00307 
00308 /*  THRESH  (input) DOUBLE PRECISION */
00309 /*          The threshold value for the test ratios.  A result is */
00310 /*          included in the output file if RESULT >= THRESH.  The test */
00311 /*          ratios are scaled to be O(1), so THRESH should be a small */
00312 /*          multiple of 1, e.g., 10 or 100.  To have every test ratio */
00313 /*          printed, use THRESH = 0. */
00314 
00315 /*  A       (workspace) DOUBLE PRECISION array, dimension (LDA,NMAX) */
00316 /*          where NMAX is the maximum value of N in NN. */
00317 
00318 /*  LDA     (input) INTEGER */
00319 /*          The leading dimension of the array A.  LDA >= max(1,MMAX), */
00320 /*          where MMAX is the maximum value of M in MM. */
00321 
00322 /*  U       (workspace) DOUBLE PRECISION array, dimension (LDU,MMAX) */
00323 
00324 /*  LDU     (input) INTEGER */
00325 /*          The leading dimension of the array U.  LDU >= max(1,MMAX). */
00326 
00327 /*  VT      (workspace) DOUBLE PRECISION array, dimension (LDVT,NMAX) */
00328 
00329 /*  LDVT    (input) INTEGER */
00330 /*          The leading dimension of the array VT.  LDVT >= max(1,NMAX). */
00331 
00332 /*  ASAV    (workspace) DOUBLE PRECISION array, dimension (LDA,NMAX) */
00333 
00334 /*  USAV    (workspace) DOUBLE PRECISION array, dimension (LDU,MMAX) */
00335 
00336 /*  VTSAV   (workspace) DOUBLE PRECISION array, dimension (LDVT,NMAX) */
00337 
00338 /*  S       (workspace) DOUBLE PRECISION array, dimension */
00339 /*                      (max(min(MM,NN))) */
00340 
00341 /*  SSAV    (workspace) DOUBLE PRECISION array, dimension */
00342 /*                      (max(min(MM,NN))) */
00343 
00344 /*  E       (workspace) DOUBLE PRECISION array, dimension */
00345 /*                      (max(min(MM,NN))) */
00346 
00347 /*  WORK    (workspace) DOUBLE PRECISION array, dimension (LWORK) */
00348 
00349 /*  LWORK   (input) INTEGER */
00350 /*          The number of entries in WORK.  This must be at least */
00351 /*          max(3*MN+MX,5*MN-4)+2*MN**2 for all pairs */
00352 /*          pairs  (MN,MX)=( min(MM(j),NN(j), max(MM(j),NN(j)) ) */
00353 
00354 /*  IWORK   (workspace) INTEGER array, dimension at least 8*min(M,N) */
00355 
00356 /*  NOUT    (input) INTEGER */
00357 /*          The FORTRAN unit number for printing out error messages */
00358 /*          (e.g., if a routine returns IINFO not equal to 0.) */
00359 
00360 /*  INFO    (output) INTEGER */
00361 /*          If 0, then everything ran OK. */
00362 /*           -1: NSIZES < 0 */
00363 /*           -2: Some MM(j) < 0 */
00364 /*           -3: Some NN(j) < 0 */
00365 /*           -4: NTYPES < 0 */
00366 /*           -7: THRESH < 0 */
00367 /*          -10: LDA < 1 or LDA < MMAX, where MMAX is max( MM(j) ). */
00368 /*          -12: LDU < 1 or LDU < MMAX. */
00369 /*          -14: LDVT < 1 or LDVT < NMAX, where NMAX is max( NN(j) ). */
00370 /*          -21: LWORK too small. */
00371 /*          If  DLATMS, or DGESVD returns an error code, the */
00372 /*              absolute value of it is returned. */
00373 
00374 /*  ===================================================================== */
00375 
00376 /*     .. Parameters .. */
00377 /*     .. */
00378 /*     .. Local Scalars .. */
00379 /*     .. */
00380 /*     .. Local Arrays .. */
00381 /*     .. */
00382 /*     .. External Functions .. */
00383 /*     .. */
00384 /*     .. External Subroutines .. */
00385 /*     .. */
00386 /*     .. Intrinsic Functions .. */
00387 /*     .. */
00388 /*     .. Scalars in Common .. */
00389 /*     .. */
00390 /*     .. Common blocks .. */
00391 /*     .. */
00392 /*     .. Data statements .. */
00393     /* Parameter adjustments */
00394     --mm;
00395     --nn;
00396     --dotype;
00397     --iseed;
00398     asav_dim1 = *lda;
00399     asav_offset = 1 + asav_dim1;
00400     asav -= asav_offset;
00401     a_dim1 = *lda;
00402     a_offset = 1 + a_dim1;
00403     a -= a_offset;
00404     usav_dim1 = *ldu;
00405     usav_offset = 1 + usav_dim1;
00406     usav -= usav_offset;
00407     u_dim1 = *ldu;
00408     u_offset = 1 + u_dim1;
00409     u -= u_offset;
00410     vtsav_dim1 = *ldvt;
00411     vtsav_offset = 1 + vtsav_dim1;
00412     vtsav -= vtsav_offset;
00413     vt_dim1 = *ldvt;
00414     vt_offset = 1 + vt_dim1;
00415     vt -= vt_offset;
00416     --s;
00417     --ssav;
00418     --e;
00419     --work;
00420     --iwork;
00421 
00422     /* Function Body */
00423 /*     .. */
00424 /*     .. Executable Statements .. */
00425 
00426 /*     Check for errors */
00427 
00428     *info = 0;
00429     badmm = FALSE_;
00430     badnn = FALSE_;
00431     mmax = 1;
00432     nmax = 1;
00433     mnmax = 1;
00434     minwrk = 1;
00435     i__1 = *nsizes;
00436     for (j = 1; j <= i__1; ++j) {
00437 /* Computing MAX */
00438         i__2 = mmax, i__3 = mm[j];
00439         mmax = max(i__2,i__3);
00440         if (mm[j] < 0) {
00441             badmm = TRUE_;
00442         }
00443 /* Computing MAX */
00444         i__2 = nmax, i__3 = nn[j];
00445         nmax = max(i__2,i__3);
00446         if (nn[j] < 0) {
00447             badnn = TRUE_;
00448         }
00449 /* Computing MAX */
00450 /* Computing MIN */
00451         i__4 = mm[j], i__5 = nn[j];
00452         i__2 = mnmax, i__3 = min(i__4,i__5);
00453         mnmax = max(i__2,i__3);
00454 /* Computing MAX */
00455 /* Computing MAX */
00456 /* Computing MIN */
00457         i__6 = mm[j], i__7 = nn[j];
00458 /* Computing MAX */
00459         i__8 = mm[j], i__9 = nn[j];
00460 /* Computing MIN */
00461         i__10 = mm[j], i__11 = nn[j] - 4;
00462         i__4 = min(i__6,i__7) * 3 + max(i__8,i__9), i__5 = min(i__10,i__11) * 
00463                 5;
00464 /* Computing MIN */
00465         i__13 = mm[j], i__14 = nn[j];
00466 /* Computing 2nd power */
00467         i__12 = min(i__13,i__14);
00468         i__2 = minwrk, i__3 = max(i__4,i__5) + (i__12 * i__12 << 1);
00469         minwrk = max(i__2,i__3);
00470 /* L10: */
00471     }
00472 
00473 /*     Check for errors */
00474 
00475     if (*nsizes < 0) {
00476         *info = -1;
00477     } else if (badmm) {
00478         *info = -2;
00479     } else if (badnn) {
00480         *info = -3;
00481     } else if (*ntypes < 0) {
00482         *info = -4;
00483     } else if (*lda < max(1,mmax)) {
00484         *info = -10;
00485     } else if (*ldu < max(1,mmax)) {
00486         *info = -12;
00487     } else if (*ldvt < max(1,nmax)) {
00488         *info = -14;
00489     } else if (minwrk > *lwork) {
00490         *info = -21;
00491     }
00492 
00493     if (*info != 0) {
00494         i__1 = -(*info);
00495         xerbla_("DDRVBD", &i__1);
00496         return 0;
00497     }
00498 
00499 /*     Initialize constants */
00500 
00501     s_copy(path, "Double precision", (ftnlen)1, (ftnlen)16);
00502     s_copy(path + 1, "BD", (ftnlen)2, (ftnlen)2);
00503     nfail = 0;
00504     ntest = 0;
00505     unfl = dlamch_("Safe minimum");
00506     ovfl = 1. / unfl;
00507     dlabad_(&unfl, &ovfl);
00508     ulp = dlamch_("Precision");
00509     ulpinv = 1. / ulp;
00510     infoc_1.infot = 0;
00511 
00512 /*     Loop over sizes, types */
00513 
00514     i__1 = *nsizes;
00515     for (jsize = 1; jsize <= i__1; ++jsize) {
00516         m = mm[jsize];
00517         n = nn[jsize];
00518         mnmin = min(m,n);
00519 
00520         if (*nsizes != 1) {
00521             mtypes = min(5,*ntypes);
00522         } else {
00523             mtypes = min(6,*ntypes);
00524         }
00525 
00526         i__2 = mtypes;
00527         for (jtype = 1; jtype <= i__2; ++jtype) {
00528             if (! dotype[jtype]) {
00529                 goto L140;
00530             }
00531 
00532             for (j = 1; j <= 4; ++j) {
00533                 ioldsd[j - 1] = iseed[j];
00534 /* L20: */
00535             }
00536 
00537 /*           Compute "A" */
00538 
00539             if (mtypes > 5) {
00540                 goto L30;
00541             }
00542 
00543             if (jtype == 1) {
00544 
00545 /*              Zero matrix */
00546 
00547                 dlaset_("Full", &m, &n, &c_b13, &c_b13, &a[a_offset], lda);
00548 
00549             } else if (jtype == 2) {
00550 
00551 /*              Identity matrix */
00552 
00553                 dlaset_("Full", &m, &n, &c_b13, &c_b17, &a[a_offset], lda);
00554 
00555             } else {
00556 
00557 /*              (Scaled) random matrix */
00558 
00559                 if (jtype == 3) {
00560                     anorm = 1.;
00561                 }
00562                 if (jtype == 4) {
00563                     anorm = unfl / ulp;
00564                 }
00565                 if (jtype == 5) {
00566                     anorm = ovfl * ulp;
00567                 }
00568                 d__1 = (doublereal) mnmin;
00569                 i__3 = m - 1;
00570                 i__4 = n - 1;
00571                 dlatms_(&m, &n, "U", &iseed[1], "N", &s[1], &c__4, &d__1, &
00572                         anorm, &i__3, &i__4, "N", &a[a_offset], lda, &work[1], 
00573                          &iinfo);
00574                 if (iinfo != 0) {
00575                     io___25.ciunit = *nout;
00576                     s_wsfe(&io___25);
00577                     do_fio(&c__1, "Generator", (ftnlen)9);
00578                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00579                     do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00580                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00581                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00582                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00583                             ;
00584                     e_wsfe();
00585                     *info = abs(iinfo);
00586                     return 0;
00587                 }
00588             }
00589 
00590 L30:
00591             dlacpy_("F", &m, &n, &a[a_offset], lda, &asav[asav_offset], lda);
00592 
00593 /*           Do for minimal and adequate (for blocking) workspace */
00594 
00595             for (iws = 1; iws <= 4; ++iws) {
00596 
00597                 for (j = 1; j <= 14; ++j) {
00598                     result[j - 1] = -1.;
00599 /* L40: */
00600                 }
00601 
00602 /*              Test DGESVD: Factorize A */
00603 
00604 /* Computing MAX */
00605                 i__3 = min(m,n) * 3 + max(m,n), i__4 = min(m,n) * 5;
00606                 iwtmp = max(i__3,i__4);
00607                 lswork = iwtmp + (iws - 1) * (*lwork - iwtmp) / 3;
00608                 lswork = min(lswork,*lwork);
00609                 lswork = max(lswork,1);
00610                 if (iws == 4) {
00611                     lswork = *lwork;
00612                 }
00613 
00614                 if (iws > 1) {
00615                     dlacpy_("F", &m, &n, &asav[asav_offset], lda, &a[a_offset]
00616 , lda);
00617                 }
00618                 s_copy(srnamc_1.srnamt, "DGESVD", (ftnlen)32, (ftnlen)6);
00619                 dgesvd_("A", "A", &m, &n, &a[a_offset], lda, &ssav[1], &usav[
00620                         usav_offset], ldu, &vtsav[vtsav_offset], ldvt, &work[
00621                         1], &lswork, &iinfo);
00622                 if (iinfo != 0) {
00623                     io___30.ciunit = *nout;
00624                     s_wsfe(&io___30);
00625                     do_fio(&c__1, "GESVD", (ftnlen)5);
00626                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00627                     do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00628                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00629                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00630                     do_fio(&c__1, (char *)&lswork, (ftnlen)sizeof(integer));
00631                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00632                             ;
00633                     e_wsfe();
00634                     *info = abs(iinfo);
00635                     return 0;
00636                 }
00637 
00638 /*              Do tests 1--4 */
00639 
00640                 dbdt01_(&m, &n, &c__0, &asav[asav_offset], lda, &usav[
00641                         usav_offset], ldu, &ssav[1], &e[1], &vtsav[
00642                         vtsav_offset], ldvt, &work[1], result);
00643                 if (m != 0 && n != 0) {
00644                     dort01_("Columns", &m, &m, &usav[usav_offset], ldu, &work[
00645                             1], lwork, &result[1]);
00646                     dort01_("Rows", &n, &n, &vtsav[vtsav_offset], ldvt, &work[
00647                             1], lwork, &result[2]);
00648                 }
00649                 result[3] = 0.;
00650                 i__3 = mnmin - 1;
00651                 for (i__ = 1; i__ <= i__3; ++i__) {
00652                     if (ssav[i__] < ssav[i__ + 1]) {
00653                         result[3] = ulpinv;
00654                     }
00655                     if (ssav[i__] < 0.) {
00656                         result[3] = ulpinv;
00657                     }
00658 /* L50: */
00659                 }
00660                 if (mnmin >= 1) {
00661                     if (ssav[mnmin] < 0.) {
00662                         result[3] = ulpinv;
00663                     }
00664                 }
00665 
00666 /*              Do partial SVDs, comparing to SSAV, USAV, and VTSAV */
00667 
00668                 result[4] = 0.;
00669                 result[5] = 0.;
00670                 result[6] = 0.;
00671                 for (iju = 0; iju <= 3; ++iju) {
00672                     for (ijvt = 0; ijvt <= 3; ++ijvt) {
00673                         if (iju == 3 && ijvt == 3 || iju == 1 && ijvt == 1) {
00674                             goto L70;
00675                         }
00676                         *(unsigned char *)jobu = *(unsigned char *)&cjob[iju];
00677                         *(unsigned char *)jobvt = *(unsigned char *)&cjob[
00678                                 ijvt];
00679                         dlacpy_("F", &m, &n, &asav[asav_offset], lda, &a[
00680                                 a_offset], lda);
00681                         s_copy(srnamc_1.srnamt, "DGESVD", (ftnlen)32, (ftnlen)
00682                                 6);
00683                         dgesvd_(jobu, jobvt, &m, &n, &a[a_offset], lda, &s[1], 
00684                                  &u[u_offset], ldu, &vt[vt_offset], ldvt, &
00685                                 work[1], &lswork, &iinfo);
00686 
00687 /*                    Compare U */
00688 
00689                         dif = 0.;
00690                         if (m > 0 && n > 0) {
00691                             if (iju == 1) {
00692                                 dort03_("C", &m, &mnmin, &m, &mnmin, &usav[
00693                                         usav_offset], ldu, &a[a_offset], lda, 
00694                                         &work[1], lwork, &dif, &iinfo);
00695                             } else if (iju == 2) {
00696                                 dort03_("C", &m, &mnmin, &m, &mnmin, &usav[
00697                                         usav_offset], ldu, &u[u_offset], ldu, 
00698                                         &work[1], lwork, &dif, &iinfo);
00699                             } else if (iju == 3) {
00700                                 dort03_("C", &m, &m, &m, &mnmin, &usav[
00701                                         usav_offset], ldu, &u[u_offset], ldu, 
00702                                         &work[1], lwork, &dif, &iinfo);
00703                             }
00704                         }
00705                         result[4] = max(result[4],dif);
00706 
00707 /*                    Compare VT */
00708 
00709                         dif = 0.;
00710                         if (m > 0 && n > 0) {
00711                             if (ijvt == 1) {
00712                                 dort03_("R", &n, &mnmin, &n, &mnmin, &vtsav[
00713                                         vtsav_offset], ldvt, &a[a_offset], 
00714                                         lda, &work[1], lwork, &dif, &iinfo);
00715                             } else if (ijvt == 2) {
00716                                 dort03_("R", &n, &mnmin, &n, &mnmin, &vtsav[
00717                                         vtsav_offset], ldvt, &vt[vt_offset], 
00718                                         ldvt, &work[1], lwork, &dif, &iinfo);
00719                             } else if (ijvt == 3) {
00720                                 dort03_("R", &n, &n, &n, &mnmin, &vtsav[
00721                                         vtsav_offset], ldvt, &vt[vt_offset], 
00722                                         ldvt, &work[1], lwork, &dif, &iinfo);
00723                             }
00724                         }
00725                         result[5] = max(result[5],dif);
00726 
00727 /*                    Compare S */
00728 
00729                         dif = 0.;
00730 /* Computing MAX */
00731                         d__1 = (doublereal) mnmin * ulp * s[1];
00732                         div = max(d__1,unfl);
00733                         i__3 = mnmin - 1;
00734                         for (i__ = 1; i__ <= i__3; ++i__) {
00735                             if (ssav[i__] < ssav[i__ + 1]) {
00736                                 dif = ulpinv;
00737                             }
00738                             if (ssav[i__] < 0.) {
00739                                 dif = ulpinv;
00740                             }
00741 /* Computing MAX */
00742                             d__2 = dif, d__3 = (d__1 = ssav[i__] - s[i__], 
00743                                     abs(d__1)) / div;
00744                             dif = max(d__2,d__3);
00745 /* L60: */
00746                         }
00747                         result[6] = max(result[6],dif);
00748 L70:
00749                         ;
00750                     }
00751 /* L80: */
00752                 }
00753 
00754 /*              Test DGESDD: Factorize A */
00755 
00756                 iwtmp = mnmin * 5 * mnmin + mnmin * 9 + max(m,n);
00757                 lswork = iwtmp + (iws - 1) * (*lwork - iwtmp) / 3;
00758                 lswork = min(lswork,*lwork);
00759                 lswork = max(lswork,1);
00760                 if (iws == 4) {
00761                     lswork = *lwork;
00762                 }
00763 
00764                 dlacpy_("F", &m, &n, &asav[asav_offset], lda, &a[a_offset], 
00765                         lda);
00766                 s_copy(srnamc_1.srnamt, "DGESDD", (ftnlen)32, (ftnlen)6);
00767                 dgesdd_("A", &m, &n, &a[a_offset], lda, &ssav[1], &usav[
00768                         usav_offset], ldu, &vtsav[vtsav_offset], ldvt, &work[
00769                         1], &lswork, &iwork[1], &iinfo);
00770                 if (iinfo != 0) {
00771                     io___38.ciunit = *nout;
00772                     s_wsfe(&io___38);
00773                     do_fio(&c__1, "GESDD", (ftnlen)5);
00774                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00775                     do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00776                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00777                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00778                     do_fio(&c__1, (char *)&lswork, (ftnlen)sizeof(integer));
00779                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00780                             ;
00781                     e_wsfe();
00782                     *info = abs(iinfo);
00783                     return 0;
00784                 }
00785 
00786 /*              Do tests 8--11 */
00787 
00788                 dbdt01_(&m, &n, &c__0, &asav[asav_offset], lda, &usav[
00789                         usav_offset], ldu, &ssav[1], &e[1], &vtsav[
00790                         vtsav_offset], ldvt, &work[1], &result[7]);
00791                 if (m != 0 && n != 0) {
00792                     dort01_("Columns", &m, &m, &usav[usav_offset], ldu, &work[
00793                             1], lwork, &result[8]);
00794                     dort01_("Rows", &n, &n, &vtsav[vtsav_offset], ldvt, &work[
00795                             1], lwork, &result[9]);
00796                 }
00797                 result[10] = 0.;
00798                 i__3 = mnmin - 1;
00799                 for (i__ = 1; i__ <= i__3; ++i__) {
00800                     if (ssav[i__] < ssav[i__ + 1]) {
00801                         result[10] = ulpinv;
00802                     }
00803                     if (ssav[i__] < 0.) {
00804                         result[10] = ulpinv;
00805                     }
00806 /* L90: */
00807                 }
00808                 if (mnmin >= 1) {
00809                     if (ssav[mnmin] < 0.) {
00810                         result[10] = ulpinv;
00811                     }
00812                 }
00813 
00814 /*              Do partial SVDs, comparing to SSAV, USAV, and VTSAV */
00815 
00816                 result[11] = 0.;
00817                 result[12] = 0.;
00818                 result[13] = 0.;
00819                 for (ijq = 0; ijq <= 2; ++ijq) {
00820                     *(unsigned char *)jobq = *(unsigned char *)&cjob[ijq];
00821                     dlacpy_("F", &m, &n, &asav[asav_offset], lda, &a[a_offset]
00822 , lda);
00823                     s_copy(srnamc_1.srnamt, "DGESDD", (ftnlen)32, (ftnlen)6);
00824                     dgesdd_(jobq, &m, &n, &a[a_offset], lda, &s[1], &u[
00825                             u_offset], ldu, &vt[vt_offset], ldvt, &work[1], &
00826                             lswork, &iwork[1], &iinfo);
00827 
00828 /*                 Compare U */
00829 
00830                     dif = 0.;
00831                     if (m > 0 && n > 0) {
00832                         if (ijq == 1) {
00833                             if (m >= n) {
00834                                 dort03_("C", &m, &mnmin, &m, &mnmin, &usav[
00835                                         usav_offset], ldu, &a[a_offset], lda, 
00836                                         &work[1], lwork, &dif, info);
00837                             } else {
00838                                 dort03_("C", &m, &mnmin, &m, &mnmin, &usav[
00839                                         usav_offset], ldu, &u[u_offset], ldu, 
00840                                         &work[1], lwork, &dif, info);
00841                             }
00842                         } else if (ijq == 2) {
00843                             dort03_("C", &m, &mnmin, &m, &mnmin, &usav[
00844                                     usav_offset], ldu, &u[u_offset], ldu, &
00845                                     work[1], lwork, &dif, info);
00846                         }
00847                     }
00848                     result[11] = max(result[11],dif);
00849 
00850 /*                 Compare VT */
00851 
00852                     dif = 0.;
00853                     if (m > 0 && n > 0) {
00854                         if (ijq == 1) {
00855                             if (m >= n) {
00856                                 dort03_("R", &n, &mnmin, &n, &mnmin, &vtsav[
00857                                         vtsav_offset], ldvt, &vt[vt_offset], 
00858                                         ldvt, &work[1], lwork, &dif, info);
00859                             } else {
00860                                 dort03_("R", &n, &mnmin, &n, &mnmin, &vtsav[
00861                                         vtsav_offset], ldvt, &a[a_offset], 
00862                                         lda, &work[1], lwork, &dif, info);
00863                             }
00864                         } else if (ijq == 2) {
00865                             dort03_("R", &n, &mnmin, &n, &mnmin, &vtsav[
00866                                     vtsav_offset], ldvt, &vt[vt_offset], ldvt, 
00867                                      &work[1], lwork, &dif, info);
00868                         }
00869                     }
00870                     result[12] = max(result[12],dif);
00871 
00872 /*                 Compare S */
00873 
00874                     dif = 0.;
00875 /* Computing MAX */
00876                     d__1 = (doublereal) mnmin * ulp * s[1];
00877                     div = max(d__1,unfl);
00878                     i__3 = mnmin - 1;
00879                     for (i__ = 1; i__ <= i__3; ++i__) {
00880                         if (ssav[i__] < ssav[i__ + 1]) {
00881                             dif = ulpinv;
00882                         }
00883                         if (ssav[i__] < 0.) {
00884                             dif = ulpinv;
00885                         }
00886 /* Computing MAX */
00887                         d__2 = dif, d__3 = (d__1 = ssav[i__] - s[i__], abs(
00888                                 d__1)) / div;
00889                         dif = max(d__2,d__3);
00890 /* L100: */
00891                     }
00892                     result[13] = max(result[13],dif);
00893 /* L110: */
00894                 }
00895 
00896 /*              Test DGESVJ: Factorize A */
00897 /*              Note: DGESVJ does not work for M < N */
00898 
00899                 result[14] = 0.;
00900                 result[15] = 0.;
00901                 result[16] = 0.;
00902                 result[17] = 0.;
00903 
00904                 if (m >= n) {
00905                     iwtmp = mnmin * 5 * mnmin + mnmin * 9 + max(m,n);
00906                     lswork = iwtmp + (iws - 1) * (*lwork - iwtmp) / 3;
00907                     lswork = min(lswork,*lwork);
00908                     lswork = max(lswork,1);
00909                     if (iws == 4) {
00910                         lswork = *lwork;
00911                     }
00912 
00913                     dlacpy_("F", &m, &n, &asav[asav_offset], lda, &usav[
00914                             usav_offset], lda);
00915                     s_copy(srnamc_1.srnamt, "DGESVJ", (ftnlen)32, (ftnlen)6);
00916                     dgesvj_("G", "U", "V", &m, &n, &usav[usav_offset], lda, &
00917                             ssav[1], &c__0, &a[a_offset], ldvt, &work[1], 
00918                             lwork, info);
00919 
00920 /*                 DGESVJ retuns V not VT, so we transpose to use the same */
00921 /*                 test suite. */
00922 
00923                     i__3 = n;
00924                     for (j = 1; j <= i__3; ++j) {
00925                         i__4 = n;
00926                         for (i__ = 1; i__ <= i__4; ++i__) {
00927                             vtsav[j + i__ * vtsav_dim1] = a[i__ + j * a_dim1];
00928                         }
00929                     }
00930 
00931                     if (iinfo != 0) {
00932                         io___41.ciunit = *nout;
00933                         s_wsfe(&io___41);
00934                         do_fio(&c__1, "GESVJ", (ftnlen)5);
00935                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00936                                 ;
00937                         do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00938                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00939                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
00940                                 ;
00941                         do_fio(&c__1, (char *)&lswork, (ftnlen)sizeof(integer)
00942                                 );
00943                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
00944                                 integer));
00945                         e_wsfe();
00946                         *info = abs(iinfo);
00947                         return 0;
00948                     }
00949 
00950 /*                 Do tests 15--18 */
00951 
00952                     dbdt01_(&m, &n, &c__0, &asav[asav_offset], lda, &usav[
00953                             usav_offset], ldu, &ssav[1], &e[1], &vtsav[
00954                             vtsav_offset], ldvt, &work[1], &result[14]);
00955                     if (m != 0 && n != 0) {
00956                         dort01_("Columns", &m, &m, &usav[usav_offset], ldu, &
00957                                 work[1], lwork, &result[15]);
00958                         dort01_("Rows", &n, &n, &vtsav[vtsav_offset], ldvt, &
00959                                 work[1], lwork, &result[16]);
00960                     }
00961                     result[17] = 0.;
00962                     i__3 = mnmin - 1;
00963                     for (i__ = 1; i__ <= i__3; ++i__) {
00964                         if (ssav[i__] < ssav[i__ + 1]) {
00965                             result[17] = ulpinv;
00966                         }
00967                         if (ssav[i__] < 0.) {
00968                             result[17] = ulpinv;
00969                         }
00970 /* L200: */
00971                     }
00972                     if (mnmin >= 1) {
00973                         if (ssav[mnmin] < 0.) {
00974                             result[17] = ulpinv;
00975                         }
00976                     }
00977                 }
00978 
00979 /*              Test DGEJSV: Factorize A */
00980 /*              Note: DGEJSV does not work for M < N */
00981 
00982                 result[18] = 0.;
00983                 result[19] = 0.;
00984                 result[20] = 0.;
00985                 result[21] = 0.;
00986                 if (m >= n) {
00987                     iwtmp = mnmin * 5 * mnmin + mnmin * 9 + max(m,n);
00988                     lswork = iwtmp + (iws - 1) * (*lwork - iwtmp) / 3;
00989                     lswork = min(lswork,*lwork);
00990                     lswork = max(lswork,1);
00991                     if (iws == 4) {
00992                         lswork = *lwork;
00993                     }
00994 
00995                     dlacpy_("F", &m, &n, &asav[asav_offset], lda, &vtsav[
00996                             vtsav_offset], lda);
00997                     s_copy(srnamc_1.srnamt, "DGEJSV", (ftnlen)32, (ftnlen)6);
00998                     dgejsv_("G", "U", "V", "R", "N", "N", &m, &n, &vtsav[
00999                             vtsav_offset], lda, &ssav[1], &usav[usav_offset], 
01000                             ldu, &a[a_offset], ldvt, &work[1], lwork, &iwork[
01001                             1], info);
01002 
01003 /*                 DGEJSV retuns V not VT, so we transpose to use the same */
01004 /*                 test suite. */
01005 
01006                     i__3 = n;
01007                     for (j = 1; j <= i__3; ++j) {
01008                         i__4 = n;
01009                         for (i__ = 1; i__ <= i__4; ++i__) {
01010                             vtsav[j + i__ * vtsav_dim1] = a[i__ + j * a_dim1];
01011                         }
01012                     }
01013 
01014                     if (iinfo != 0) {
01015                         io___42.ciunit = *nout;
01016                         s_wsfe(&io___42);
01017                         do_fio(&c__1, "GESVJ", (ftnlen)5);
01018                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01019                                 ;
01020                         do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
01021                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01022                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01023                                 ;
01024                         do_fio(&c__1, (char *)&lswork, (ftnlen)sizeof(integer)
01025                                 );
01026                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01027                                 integer));
01028                         e_wsfe();
01029                         *info = abs(iinfo);
01030                         return 0;
01031                     }
01032 
01033 /*                 Do tests 19--22 */
01034 
01035                     dbdt01_(&m, &n, &c__0, &asav[asav_offset], lda, &usav[
01036                             usav_offset], ldu, &ssav[1], &e[1], &vtsav[
01037                             vtsav_offset], ldvt, &work[1], &result[18]);
01038                     if (m != 0 && n != 0) {
01039                         dort01_("Columns", &m, &m, &usav[usav_offset], ldu, &
01040                                 work[1], lwork, &result[19]);
01041                         dort01_("Rows", &n, &n, &vtsav[vtsav_offset], ldvt, &
01042                                 work[1], lwork, &result[20]);
01043                     }
01044                     result[21] = 0.;
01045                     i__3 = mnmin - 1;
01046                     for (i__ = 1; i__ <= i__3; ++i__) {
01047                         if (ssav[i__] < ssav[i__ + 1]) {
01048                             result[21] = ulpinv;
01049                         }
01050                         if (ssav[i__] < 0.) {
01051                             result[21] = ulpinv;
01052                         }
01053 /* L300: */
01054                     }
01055                     if (mnmin >= 1) {
01056                         if (ssav[mnmin] < 0.) {
01057                             result[21] = ulpinv;
01058                         }
01059                     }
01060                 }
01061 
01062 /*              End of Loop -- Check for RESULT(j) > THRESH */
01063 
01064                 for (j = 1; j <= 22; ++j) {
01065                     if (result[j - 1] >= *thresh) {
01066                         if (nfail == 0) {
01067                             io___43.ciunit = *nout;
01068                             s_wsfe(&io___43);
01069                             e_wsfe();
01070                             io___44.ciunit = *nout;
01071                             s_wsfe(&io___44);
01072                             e_wsfe();
01073                         }
01074                         io___45.ciunit = *nout;
01075                         s_wsfe(&io___45);
01076                         do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
01077                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01078                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01079                                 ;
01080                         do_fio(&c__1, (char *)&iws, (ftnlen)sizeof(integer));
01081                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01082                                 integer));
01083                         do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
01084                         do_fio(&c__1, (char *)&result[j - 1], (ftnlen)sizeof(
01085                                 doublereal));
01086                         e_wsfe();
01087                         ++nfail;
01088                     }
01089 /* L120: */
01090                 }
01091                 ntest += 22;
01092 
01093 /* L130: */
01094             }
01095 L140:
01096             ;
01097         }
01098 /* L150: */
01099     }
01100 
01101 /*     Summary */
01102 
01103     alasvm_(path, nout, &nfail, &ntest, &c__0);
01104 
01105 
01106     return 0;
01107 
01108 /*     End of DDRVBD */
01109 
01110 } /* ddrvbd_ */


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