dlatb9.c
Go to the documentation of this file.
00001 /* dlatb9.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__3 = 3;
00019 
00020 /* Subroutine */ int dlatb9_(char *path, integer *imat, integer *m, integer *
00021         p, integer *n, char *type__, integer *kla, integer *kua, integer *klb, 
00022          integer *kub, doublereal *anorm, doublereal *bnorm, integer *modea, 
00023         integer *modeb, doublereal *cndnma, doublereal *cndnmb, char *dista, 
00024         char *distb)
00025 {
00026     /* Initialized data */
00027 
00028     static logical first = TRUE_;
00029 
00030     /* System generated locals */
00031     integer i__1;
00032 
00033     /* Builtin functions */
00034     double sqrt(doublereal);
00035 
00036     /* Local variables */
00037     static doublereal eps, badc1, badc2, large, small;
00038     extern /* Subroutine */ int dlabad_(doublereal *, doublereal *);
00039     extern doublereal dlamch_(char *);
00040     extern logical lsamen_(integer *, char *, char *);
00041 
00042 
00043 /*  -- LAPACK test routine (version 3.1) -- */
00044 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00045 /*     November 2006 */
00046 
00047 /*     .. Scalar Arguments .. */
00048 /*     .. */
00049 
00050 /*  Purpose */
00051 /*  ======= */
00052 
00053 /*  DLATB9 sets parameters for the matrix generator based on the type of */
00054 /*  matrix to be generated. */
00055 
00056 /*  Arguments */
00057 /*  ========= */
00058 
00059 /*  PATH    (input) CHARACTER*3 */
00060 /*          The LAPACK path name. */
00061 
00062 /*  IMAT    (input) INTEGER */
00063 /*          An integer key describing which matrix to generate for this */
00064 /*          path. */
00065 
00066 /*  M       (input) INTEGER */
00067 /*          The number of rows in the matrix to be generated. */
00068 
00069 /*  N       (input) INTEGER */
00070 /*          The number of columns in the matrix to be generated. */
00071 
00072 /*  TYPE    (output) CHARACTER*1 */
00073 /*          The type of the matrix to be generated: */
00074 /*          = 'S':  symmetric matrix; */
00075 /*          = 'P':  symmetric positive (semi)definite matrix; */
00076 /*          = 'N':  nonsymmetric matrix. */
00077 
00078 /*  KL      (output) INTEGER */
00079 /*          The lower band width of the matrix to be generated. */
00080 
00081 /*  KU      (output) INTEGER */
00082 /*          The upper band width of the matrix to be generated. */
00083 
00084 /*  ANORM   (output) DOUBLE PRECISION */
00085 /*          The desired norm of the matrix to be generated.  The diagonal */
00086 /*          matrix of singular values or eigenvalues is scaled by this */
00087 /*          value. */
00088 
00089 /*  MODE    (output) INTEGER */
00090 /*          A key indicating how to choose the vector of eigenvalues. */
00091 
00092 /*  CNDNUM  (output) DOUBLE PRECISION */
00093 /*          The desired condition number. */
00094 
00095 /*  DIST    (output) CHARACTER*1 */
00096 /*          The type of distribution to be used by the random number */
00097 /*          generator. */
00098 
00099 /*  ===================================================================== */
00100 
00101 /*     .. Parameters .. */
00102 /*     .. */
00103 /*     .. Local Scalars .. */
00104 /*     .. */
00105 /*     .. External Functions .. */
00106 /*     .. */
00107 /*     .. Intrinsic Functions .. */
00108 /*     .. */
00109 /*     .. External Subroutines .. */
00110 /*     .. */
00111 /*     .. Save statement .. */
00112 /*     .. */
00113 /*     .. Data statements .. */
00114 /*     .. */
00115 /*     .. Executable Statements .. */
00116 
00117 /*     Set some constants for use in the subroutine. */
00118 
00119     if (first) {
00120         first = FALSE_;
00121         eps = dlamch_("Precision");
00122         badc2 = .1 / eps;
00123         badc1 = sqrt(badc2);
00124         small = dlamch_("Safe minimum");
00125         large = 1. / small;
00126 
00127 /*        If it looks like we're on a Cray, take the square root of */
00128 /*        SMALL and LARGE to avoid overflow and underflow problems. */
00129 
00130         dlabad_(&small, &large);
00131         small = small / eps * .25;
00132         large = 1. / small;
00133     }
00134 
00135 /*     Set some parameters we don't plan to change. */
00136 
00137     *(unsigned char *)type__ = 'N';
00138     *(unsigned char *)dista = 'S';
00139     *(unsigned char *)distb = 'S';
00140     *modea = 3;
00141     *modeb = 4;
00142 
00143 /*     Set the lower and upper bandwidths. */
00144 
00145     if (lsamen_(&c__3, path, "GRQ") || lsamen_(&c__3, 
00146             path, "LSE") || lsamen_(&c__3, path, "GSV")) {
00147 
00148 /*        A: M by N, B: P by N */
00149 
00150         if (*imat == 1) {
00151 
00152 /*           A: diagonal, B: upper triangular */
00153 
00154             *kla = 0;
00155             *kua = 0;
00156             *klb = 0;
00157 /* Computing MAX */
00158             i__1 = *n - 1;
00159             *kub = max(i__1,0);
00160 
00161         } else if (*imat == 2) {
00162 
00163 /*           A: upper triangular, B: upper triangular */
00164 
00165             *kla = 0;
00166 /* Computing MAX */
00167             i__1 = *n - 1;
00168             *kua = max(i__1,0);
00169             *klb = 0;
00170 /* Computing MAX */
00171             i__1 = *n - 1;
00172             *kub = max(i__1,0);
00173 
00174         } else if (*imat == 3) {
00175 
00176 /*           A: lower triangular, B: upper triangular */
00177 
00178 /* Computing MAX */
00179             i__1 = *m - 1;
00180             *kla = max(i__1,0);
00181             *kua = 0;
00182             *klb = 0;
00183 /* Computing MAX */
00184             i__1 = *n - 1;
00185             *kub = max(i__1,0);
00186 
00187         } else {
00188 
00189 /*           A: general dense, B: general dense */
00190 
00191 /* Computing MAX */
00192             i__1 = *m - 1;
00193             *kla = max(i__1,0);
00194 /* Computing MAX */
00195             i__1 = *n - 1;
00196             *kua = max(i__1,0);
00197 /* Computing MAX */
00198             i__1 = *p - 1;
00199             *klb = max(i__1,0);
00200 /* Computing MAX */
00201             i__1 = *n - 1;
00202             *kub = max(i__1,0);
00203 
00204         }
00205 
00206     } else if (lsamen_(&c__3, path, "GQR") || lsamen_(&
00207             c__3, path, "GLM")) {
00208 
00209 /*        A: N by M, B: N by P */
00210 
00211         if (*imat == 1) {
00212 
00213 /*           A: diagonal, B: lower triangular */
00214 
00215             *kla = 0;
00216             *kua = 0;
00217 /* Computing MAX */
00218             i__1 = *n - 1;
00219             *klb = max(i__1,0);
00220             *kub = 0;
00221         } else if (*imat == 2) {
00222 
00223 /*           A: lower triangular, B: diagonal */
00224 
00225 /* Computing MAX */
00226             i__1 = *n - 1;
00227             *kla = max(i__1,0);
00228             *kua = 0;
00229             *klb = 0;
00230             *kub = 0;
00231 
00232         } else if (*imat == 3) {
00233 
00234 /*           A: lower triangular, B: upper triangular */
00235 
00236 /* Computing MAX */
00237             i__1 = *n - 1;
00238             *kla = max(i__1,0);
00239             *kua = 0;
00240             *klb = 0;
00241 /* Computing MAX */
00242             i__1 = *p - 1;
00243             *kub = max(i__1,0);
00244 
00245         } else {
00246 
00247 /*           A: general dense, B: general dense */
00248 
00249 /* Computing MAX */
00250             i__1 = *n - 1;
00251             *kla = max(i__1,0);
00252 /* Computing MAX */
00253             i__1 = *m - 1;
00254             *kua = max(i__1,0);
00255 /* Computing MAX */
00256             i__1 = *n - 1;
00257             *klb = max(i__1,0);
00258 /* Computing MAX */
00259             i__1 = *p - 1;
00260             *kub = max(i__1,0);
00261         }
00262 
00263     }
00264 
00265 /*     Set the condition number and norm. */
00266 
00267     *cndnma = 100.;
00268     *cndnmb = 10.;
00269     if (lsamen_(&c__3, path, "GQR") || lsamen_(&c__3, 
00270             path, "GRQ") || lsamen_(&c__3, path, "GSV")) {
00271         if (*imat == 5) {
00272             *cndnma = badc1;
00273             *cndnmb = badc1;
00274         } else if (*imat == 6) {
00275             *cndnma = badc2;
00276             *cndnmb = badc2;
00277         } else if (*imat == 7) {
00278             *cndnma = badc1;
00279             *cndnmb = badc2;
00280         } else if (*imat == 8) {
00281             *cndnma = badc2;
00282             *cndnmb = badc1;
00283         }
00284     }
00285 
00286     *anorm = 10.;
00287     *bnorm = 1e3;
00288     if (lsamen_(&c__3, path, "GQR") || lsamen_(&c__3, 
00289             path, "GRQ")) {
00290         if (*imat == 7) {
00291             *anorm = small;
00292             *bnorm = large;
00293         } else if (*imat == 8) {
00294             *anorm = large;
00295             *bnorm = small;
00296         }
00297     }
00298 
00299     if (*n <= 1) {
00300         *cndnma = 1.;
00301         *cndnmb = 1.;
00302     }
00303 
00304     return 0;
00305 
00306 /*     End of DLATB9 */
00307 
00308 } /* dlatb9_ */


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