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


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