ilaenv.c
Go to the documentation of this file.
00001 /* ilaenv.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 iparms[100];
00020 } claenv_;
00021 
00022 #define claenv_1 claenv_
00023 
00024 /* Table of constant values */
00025 
00026 static integer c__1 = 1;
00027 static real c_b3 = 0.f;
00028 static real c_b4 = 1.f;
00029 static integer c__0 = 0;
00030 
00031 integer ilaenv_(integer *ispec, char *name__, char *opts, integer *n1, 
00032         integer *n2, integer *n3, integer *n4)
00033 {
00034     /* System generated locals */
00035     integer ret_val;
00036 
00037     /* Local variables */
00038     extern integer ieeeck_(integer *, real *, real *);
00039 
00040 
00041 /*  -- LAPACK auxiliary routine (version 3.1) -- */
00042 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00043 /*     November 2006 */
00044 
00045 /*     .. Scalar Arguments .. */
00046 /*     .. */
00047 
00048 /*  Purpose */
00049 /*  ======= */
00050 
00051 /*  ILAENV returns problem-dependent parameters for the local */
00052 /*  environment.  See ISPEC for a description of the parameters. */
00053 
00054 /*  In this version, the problem-dependent parameters are contained in */
00055 /*  the integer array IPARMS in the common block CLAENV and the value */
00056 /*  with index ISPEC is copied to ILAENV.  This version of ILAENV is */
00057 /*  to be used in conjunction with XLAENV in TESTING and TIMING. */
00058 
00059 /*  Arguments */
00060 /*  ========= */
00061 
00062 /*  ISPEC   (input) INTEGER */
00063 /*          Specifies the parameter to be returned as the value of */
00064 /*          ILAENV. */
00065 /*          = 1: the optimal blocksize; if this value is 1, an unblocked */
00066 /*               algorithm will give the best performance. */
00067 /*          = 2: the minimum block size for which the block routine */
00068 /*               should be used; if the usable block size is less than */
00069 /*               this value, an unblocked routine should be used. */
00070 /*          = 3: the crossover point (in a block routine, for N less */
00071 /*               than this value, an unblocked routine should be used) */
00072 /*          = 4: the number of shifts, used in the nonsymmetric */
00073 /*               eigenvalue routines */
00074 /*          = 5: the minimum column dimension for blocking to be used; */
00075 /*               rectangular blocks must have dimension at least k by m, */
00076 /*               where k is given by ILAENV(2,...) and m by ILAENV(5,...) */
00077 /*          = 6: the crossover point for the SVD (when reducing an m by n */
00078 /*               matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds */
00079 /*               this value, a QR factorization is used first to reduce */
00080 /*               the matrix to a triangular form.) */
00081 /*          = 7: the number of processors */
00082 /*          = 8: the crossover point for the multishift QR and QZ methods */
00083 /*               for nonsymmetric eigenvalue problems. */
00084 /*          = 9: maximum size of the subproblems at the bottom of the */
00085 /*               computation tree in the divide-and-conquer algorithm */
00086 /*          =10: ieee NaN arithmetic can be trusted not to trap */
00087 /*          =11: infinity arithmetic can be trusted not to trap */
00088 
00089 /*          Other specifications (up to 100) can be added later. */
00090 
00091 /*  NAME    (input) CHARACTER*(*) */
00092 /*          The name of the calling subroutine. */
00093 
00094 /*  OPTS    (input) CHARACTER*(*) */
00095 /*          The character options to the subroutine NAME, concatenated */
00096 /*          into a single character string.  For example, UPLO = 'U', */
00097 /*          TRANS = 'T', and DIAG = 'N' for a triangular routine would */
00098 /*          be specified as OPTS = 'UTN'. */
00099 
00100 /*  N1      (input) INTEGER */
00101 /*  N2      (input) INTEGER */
00102 /*  N3      (input) INTEGER */
00103 /*  N4      (input) INTEGER */
00104 /*          Problem dimensions for the subroutine NAME; these may not all */
00105 /*          be required. */
00106 
00107 /* (ILAENV) (output) INTEGER */
00108 /*          >= 0: the value of the parameter specified by ISPEC */
00109 /*          < 0:  if ILAENV = -k, the k-th argument had an illegal value. */
00110 
00111 /*  Further Details */
00112 /*  =============== */
00113 
00114 /*  The following conventions have been used when calling ILAENV from the */
00115 /*  LAPACK routines: */
00116 /*  1)  OPTS is a concatenation of all of the character options to */
00117 /*      subroutine NAME, in the same order that they appear in the */
00118 /*      argument list for NAME, even if they are not used in determining */
00119 /*      the value of the parameter specified by ISPEC. */
00120 /*  2)  The problem dimensions N1, N2, N3, N4 are specified in the order */
00121 /*      that they appear in the argument list for NAME.  N1 is used */
00122 /*      first, N2 second, and so on, and unused problem dimensions are */
00123 /*      passed a value of -1. */
00124 /*  3)  The parameter value returned by ILAENV is checked for validity in */
00125 /*      the calling subroutine.  For example, ILAENV is used to retrieve */
00126 /*      the optimal blocksize for STRTRI as follows: */
00127 
00128 /*      NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 ) */
00129 /*      IF( NB.LE.1 ) NB = MAX( 1, N ) */
00130 
00131 /*  ===================================================================== */
00132 
00133 /*     .. Intrinsic Functions .. */
00134 /*     .. */
00135 /*     .. External Functions .. */
00136 /*     .. */
00137 /*     .. Arrays in Common .. */
00138 /*     .. */
00139 /*     .. Common blocks .. */
00140 /*     .. */
00141 /*     .. Save statement .. */
00142 /*     .. */
00143 /*     .. Executable Statements .. */
00144 
00145     if (*ispec >= 1 && *ispec <= 5) {
00146 
00147 /*        Return a value from the common block. */
00148 
00149         ret_val = claenv_1.iparms[*ispec - 1];
00150 
00151     } else if (*ispec == 6) {
00152 
00153 /*        Compute SVD crossover point. */
00154 
00155         ret_val = (integer) ((real) min(*n1,*n2) * 1.6f);
00156 
00157     } else if (*ispec >= 7 && *ispec <= 9) {
00158 
00159 /*        Return a value from the common block. */
00160 
00161         ret_val = claenv_1.iparms[*ispec - 1];
00162 
00163     } else if (*ispec == 10) {
00164 
00165 /*        IEEE NaN arithmetic can be trusted not to trap */
00166 
00167 /*        ILAENV = 0 */
00168         ret_val = 1;
00169         if (ret_val == 1) {
00170             ret_val = ieeeck_(&c__1, &c_b3, &c_b4);
00171         }
00172 
00173     } else if (*ispec == 11) {
00174 
00175 /*        Infinity arithmetic can be trusted not to trap */
00176 
00177 /*        ILAENV = 0 */
00178         ret_val = 1;
00179         if (ret_val == 1) {
00180             ret_val = ieeeck_(&c__0, &c_b3, &c_b4);
00181         }
00182 
00183     } else {
00184 
00185 /*        Invalid value for ISPEC */
00186 
00187         ret_val = -1;
00188     }
00189 
00190     return ret_val;
00191 
00192 /*     End of ILAENV */
00193 
00194 } /* ilaenv_ */


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