00001 /* zstegr.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 /* Subroutine */ int zstegr_(char *jobz, char *range, integer *n, doublereal * 00017 d__, doublereal *e, doublereal *vl, doublereal *vu, integer *il, 00018 integer *iu, doublereal *abstol, integer *m, doublereal *w, 00019 doublecomplex *z__, integer *ldz, integer *isuppz, doublereal *work, 00020 integer *lwork, integer *iwork, integer *liwork, integer *info) 00021 { 00022 /* System generated locals */ 00023 integer z_dim1, z_offset; 00024 00025 /* Local variables */ 00026 logical tryrac; 00027 extern /* Subroutine */ int zstemr_(char *, char *, integer *, doublereal 00028 *, doublereal *, doublereal *, doublereal *, integer *, integer *, 00029 integer *, doublereal *, doublecomplex *, integer *, integer *, 00030 integer *, logical *, doublereal *, integer *, integer *, integer 00031 *, integer *); 00032 00033 00034 00035 /* -- LAPACK computational routine (version 3.2) -- */ 00036 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 00037 /* November 2006 */ 00038 00039 /* .. Scalar Arguments .. */ 00040 /* .. */ 00041 /* .. Array Arguments .. */ 00042 /* .. */ 00043 00044 /* Purpose */ 00045 /* ======= */ 00046 00047 /* ZSTEGR computes selected eigenvalues and, optionally, eigenvectors */ 00048 /* of a real symmetric tridiagonal matrix T. Any such unreduced matrix has */ 00049 /* a well defined set of pairwise different real eigenvalues, the corresponding */ 00050 /* real eigenvectors are pairwise orthogonal. */ 00051 00052 /* The spectrum may be computed either completely or partially by specifying */ 00053 /* either an interval (VL,VU] or a range of indices IL:IU for the desired */ 00054 /* eigenvalues. */ 00055 00056 /* ZSTEGR is a compatability wrapper around the improved ZSTEMR routine. */ 00057 /* See DSTEMR for further details. */ 00058 00059 /* One important change is that the ABSTOL parameter no longer provides any */ 00060 /* benefit and hence is no longer used. */ 00061 00062 /* Note : ZSTEGR and ZSTEMR work only on machines which follow */ 00063 /* IEEE-754 floating-point standard in their handling of infinities and */ 00064 /* NaNs. Normal execution may create these exceptiona values and hence */ 00065 /* may abort due to a floating point exception in environments which */ 00066 /* do not conform to the IEEE-754 standard. */ 00067 00068 /* Arguments */ 00069 /* ========= */ 00070 00071 /* JOBZ (input) CHARACTER*1 */ 00072 /* = 'N': Compute eigenvalues only; */ 00073 /* = 'V': Compute eigenvalues and eigenvectors. */ 00074 00075 /* RANGE (input) CHARACTER*1 */ 00076 /* = 'A': all eigenvalues will be found. */ 00077 /* = 'V': all eigenvalues in the half-open interval (VL,VU] */ 00078 /* will be found. */ 00079 /* = 'I': the IL-th through IU-th eigenvalues will be found. */ 00080 00081 /* N (input) INTEGER */ 00082 /* The order of the matrix. N >= 0. */ 00083 00084 /* D (input/output) DOUBLE PRECISION array, dimension (N) */ 00085 /* On entry, the N diagonal elements of the tridiagonal matrix */ 00086 /* T. On exit, D is overwritten. */ 00087 00088 /* E (input/output) DOUBLE PRECISION array, dimension (N) */ 00089 /* On entry, the (N-1) subdiagonal elements of the tridiagonal */ 00090 /* matrix T in elements 1 to N-1 of E. E(N) need not be set on */ 00091 /* input, but is used internally as workspace. */ 00092 /* On exit, E is overwritten. */ 00093 00094 /* VL (input) DOUBLE PRECISION */ 00095 /* VU (input) DOUBLE PRECISION */ 00096 /* If RANGE='V', the lower and upper bounds of the interval to */ 00097 /* be searched for eigenvalues. VL < VU. */ 00098 /* Not referenced if RANGE = 'A' or 'I'. */ 00099 00100 /* IL (input) INTEGER */ 00101 /* IU (input) INTEGER */ 00102 /* If RANGE='I', the indices (in ascending order) of the */ 00103 /* smallest and largest eigenvalues to be returned. */ 00104 /* 1 <= IL <= IU <= N, if N > 0. */ 00105 /* Not referenced if RANGE = 'A' or 'V'. */ 00106 00107 /* ABSTOL (input) DOUBLE PRECISION */ 00108 /* Unused. Was the absolute error tolerance for the */ 00109 /* eigenvalues/eigenvectors in previous versions. */ 00110 00111 /* M (output) INTEGER */ 00112 /* The total number of eigenvalues found. 0 <= M <= N. */ 00113 /* If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1. */ 00114 00115 /* W (output) DOUBLE PRECISION array, dimension (N) */ 00116 /* The first M elements contain the selected eigenvalues in */ 00117 /* ascending order. */ 00118 00119 /* Z (output) COMPLEX*16 array, dimension (LDZ, max(1,M) ) */ 00120 /* If JOBZ = 'V', and if INFO = 0, then the first M columns of Z */ 00121 /* contain the orthonormal eigenvectors of the matrix T */ 00122 /* corresponding to the selected eigenvalues, with the i-th */ 00123 /* column of Z holding the eigenvector associated with W(i). */ 00124 /* If JOBZ = 'N', then Z is not referenced. */ 00125 /* Note: the user must ensure that at least max(1,M) columns are */ 00126 /* supplied in the array Z; if RANGE = 'V', the exact value of M */ 00127 /* is not known in advance and an upper bound must be used. */ 00128 /* Supplying N columns is always safe. */ 00129 00130 /* LDZ (input) INTEGER */ 00131 /* The leading dimension of the array Z. LDZ >= 1, and if */ 00132 /* JOBZ = 'V', then LDZ >= max(1,N). */ 00133 00134 /* ISUPPZ (output) INTEGER ARRAY, dimension ( 2*max(1,M) ) */ 00135 /* The support of the eigenvectors in Z, i.e., the indices */ 00136 /* indicating the nonzero elements in Z. The i-th computed eigenvector */ 00137 /* is nonzero only in elements ISUPPZ( 2*i-1 ) through */ 00138 /* ISUPPZ( 2*i ). This is relevant in the case when the matrix */ 00139 /* is split. ISUPPZ is only accessed when JOBZ is 'V' and N > 0. */ 00140 00141 /* WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) */ 00142 /* On exit, if INFO = 0, WORK(1) returns the optimal */ 00143 /* (and minimal) LWORK. */ 00144 00145 /* LWORK (input) INTEGER */ 00146 /* The dimension of the array WORK. LWORK >= max(1,18*N) */ 00147 /* if JOBZ = 'V', and LWORK >= max(1,12*N) if JOBZ = 'N'. */ 00148 /* If LWORK = -1, then a workspace query is assumed; the routine */ 00149 /* only calculates the optimal size of the WORK array, returns */ 00150 /* this value as the first entry of the WORK array, and no error */ 00151 /* message related to LWORK is issued by XERBLA. */ 00152 00153 /* IWORK (workspace/output) INTEGER array, dimension (LIWORK) */ 00154 /* On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK. */ 00155 00156 /* LIWORK (input) INTEGER */ 00157 /* The dimension of the array IWORK. LIWORK >= max(1,10*N) */ 00158 /* if the eigenvectors are desired, and LIWORK >= max(1,8*N) */ 00159 /* if only the eigenvalues are to be computed. */ 00160 /* If LIWORK = -1, then a workspace query is assumed; the */ 00161 /* routine only calculates the optimal size of the IWORK array, */ 00162 /* returns this value as the first entry of the IWORK array, and */ 00163 /* no error message related to LIWORK is issued by XERBLA. */ 00164 00165 /* INFO (output) INTEGER */ 00166 /* On exit, INFO */ 00167 /* = 0: successful exit */ 00168 /* < 0: if INFO = -i, the i-th argument had an illegal value */ 00169 /* > 0: if INFO = 1X, internal error in DLARRE, */ 00170 /* if INFO = 2X, internal error in ZLARRV. */ 00171 /* Here, the digit X = ABS( IINFO ) < 10, where IINFO is */ 00172 /* the nonzero error code returned by DLARRE or */ 00173 /* ZLARRV, respectively. */ 00174 00175 /* Further Details */ 00176 /* =============== */ 00177 00178 /* Based on contributions by */ 00179 /* Inderjit Dhillon, IBM Almaden, USA */ 00180 /* Osni Marques, LBNL/NERSC, USA */ 00181 /* Christof Voemel, LBNL/NERSC, USA */ 00182 00183 /* ===================================================================== */ 00184 00185 /* .. Local Scalars .. */ 00186 /* .. */ 00187 /* .. External Subroutines .. */ 00188 /* .. */ 00189 /* .. Executable Statements .. */ 00190 /* Parameter adjustments */ 00191 --d__; 00192 --e; 00193 --w; 00194 z_dim1 = *ldz; 00195 z_offset = 1 + z_dim1; 00196 z__ -= z_offset; 00197 --isuppz; 00198 --work; 00199 --iwork; 00200 00201 /* Function Body */ 00202 *info = 0; 00203 tryrac = FALSE_; 00204 zstemr_(jobz, range, n, &d__[1], &e[1], vl, vu, il, iu, m, &w[1], &z__[ 00205 z_offset], ldz, n, &isuppz[1], &tryrac, &work[1], lwork, &iwork[1] 00206 , liwork, info); 00207 00208 /* End of ZSTEGR */ 00209 00210 return 0; 00211 } /* zstegr_ */