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


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