dstegr.c 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /* dstegr.f -- translated by f2c (version 20061008).
  2. You must link the resulting object file with libf2c:
  3. on Microsoft Windows system, link with libf2c.lib;
  4. on Linux or Unix systems, link with .../path/to/libf2c.a -lm
  5. or, if you install libf2c.a in a standard place, with -lf2c -lm
  6. -- in that order, at the end of the command line, as in
  7. cc *.o -lf2c -lm
  8. Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
  9. http://www.netlib.org/f2c/libf2c.zip
  10. */
  11. #include "f2c.h"
  12. #include "blaswrap.h"
  13. /* Subroutine */ int _starpu_dstegr_(char *jobz, char *range, integer *n, doublereal *
  14. d__, doublereal *e, doublereal *vl, doublereal *vu, integer *il,
  15. integer *iu, doublereal *abstol, integer *m, doublereal *w,
  16. doublereal *z__, integer *ldz, integer *isuppz, doublereal *work,
  17. integer *lwork, integer *iwork, integer *liwork, integer *info)
  18. {
  19. /* System generated locals */
  20. integer z_dim1, z_offset;
  21. /* Local variables */
  22. extern /* Subroutine */ int _starpu_dstemr_(char *, char *, integer *, doublereal
  23. *, doublereal *, doublereal *, doublereal *, integer *, integer *,
  24. integer *, doublereal *, doublereal *, integer *, integer *,
  25. integer *, logical *, doublereal *, integer *, integer *, integer
  26. *, integer *);
  27. logical tryrac;
  28. /* -- LAPACK computational routine (version 3.2) -- */
  29. /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
  30. /* November 2006 */
  31. /* .. Scalar Arguments .. */
  32. /* .. */
  33. /* .. Array Arguments .. */
  34. /* .. */
  35. /* Purpose */
  36. /* ======= */
  37. /* DSTEGR computes selected eigenvalues and, optionally, eigenvectors */
  38. /* of a real symmetric tridiagonal matrix T. Any such unreduced matrix has */
  39. /* a well defined set of pairwise different real eigenvalues, the corresponding */
  40. /* real eigenvectors are pairwise orthogonal. */
  41. /* The spectrum may be computed either completely or partially by specifying */
  42. /* either an interval (VL,VU] or a range of indices IL:IU for the desired */
  43. /* eigenvalues. */
  44. /* DSTEGR is a compatability wrapper around the improved DSTEMR routine. */
  45. /* See DSTEMR for further details. */
  46. /* One important change is that the ABSTOL parameter no longer provides any */
  47. /* benefit and hence is no longer used. */
  48. /* Note : DSTEGR and DSTEMR work only on machines which follow */
  49. /* IEEE-754 floating-point standard in their handling of infinities and */
  50. /* NaNs. Normal execution may create these exceptiona values and hence */
  51. /* may abort due to a floating point exception in environments which */
  52. /* do not conform to the IEEE-754 standard. */
  53. /* Arguments */
  54. /* ========= */
  55. /* JOBZ (input) CHARACTER*1 */
  56. /* = 'N': Compute eigenvalues only; */
  57. /* = 'V': Compute eigenvalues and eigenvectors. */
  58. /* RANGE (input) CHARACTER*1 */
  59. /* = 'A': all eigenvalues will be found. */
  60. /* = 'V': all eigenvalues in the half-open interval (VL,VU] */
  61. /* will be found. */
  62. /* = 'I': the IL-th through IU-th eigenvalues will be found. */
  63. /* N (input) INTEGER */
  64. /* The order of the matrix. N >= 0. */
  65. /* D (input/output) DOUBLE PRECISION array, dimension (N) */
  66. /* On entry, the N diagonal elements of the tridiagonal matrix */
  67. /* T. On exit, D is overwritten. */
  68. /* E (input/output) DOUBLE PRECISION array, dimension (N) */
  69. /* On entry, the (N-1) subdiagonal elements of the tridiagonal */
  70. /* matrix T in elements 1 to N-1 of E. E(N) need not be set on */
  71. /* input, but is used internally as workspace. */
  72. /* On exit, E is overwritten. */
  73. /* VL (input) DOUBLE PRECISION */
  74. /* VU (input) DOUBLE PRECISION */
  75. /* If RANGE='V', the lower and upper bounds of the interval to */
  76. /* be searched for eigenvalues. VL < VU. */
  77. /* Not referenced if RANGE = 'A' or 'I'. */
  78. /* IL (input) INTEGER */
  79. /* IU (input) INTEGER */
  80. /* If RANGE='I', the indices (in ascending order) of the */
  81. /* smallest and largest eigenvalues to be returned. */
  82. /* 1 <= IL <= IU <= N, if N > 0. */
  83. /* Not referenced if RANGE = 'A' or 'V'. */
  84. /* ABSTOL (input) DOUBLE PRECISION */
  85. /* Unused. Was the absolute error tolerance for the */
  86. /* eigenvalues/eigenvectors in previous versions. */
  87. /* M (output) INTEGER */
  88. /* The total number of eigenvalues found. 0 <= M <= N. */
  89. /* If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1. */
  90. /* W (output) DOUBLE PRECISION array, dimension (N) */
  91. /* The first M elements contain the selected eigenvalues in */
  92. /* ascending order. */
  93. /* Z (output) DOUBLE PRECISION array, dimension (LDZ, max(1,M) ) */
  94. /* If JOBZ = 'V', and if INFO = 0, then the first M columns of Z */
  95. /* contain the orthonormal eigenvectors of the matrix T */
  96. /* corresponding to the selected eigenvalues, with the i-th */
  97. /* column of Z holding the eigenvector associated with W(i). */
  98. /* If JOBZ = 'N', then Z is not referenced. */
  99. /* Note: the user must ensure that at least max(1,M) columns are */
  100. /* supplied in the array Z; if RANGE = 'V', the exact value of M */
  101. /* is not known in advance and an upper bound must be used. */
  102. /* Supplying N columns is always safe. */
  103. /* LDZ (input) INTEGER */
  104. /* The leading dimension of the array Z. LDZ >= 1, and if */
  105. /* JOBZ = 'V', then LDZ >= max(1,N). */
  106. /* ISUPPZ (output) INTEGER ARRAY, dimension ( 2*max(1,M) ) */
  107. /* The support of the eigenvectors in Z, i.e., the indices */
  108. /* indicating the nonzero elements in Z. The i-th computed eigenvector */
  109. /* is nonzero only in elements ISUPPZ( 2*i-1 ) through */
  110. /* ISUPPZ( 2*i ). This is relevant in the case when the matrix */
  111. /* is split. ISUPPZ is only accessed when JOBZ is 'V' and N > 0. */
  112. /* WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) */
  113. /* On exit, if INFO = 0, WORK(1) returns the optimal */
  114. /* (and minimal) LWORK. */
  115. /* LWORK (input) INTEGER */
  116. /* The dimension of the array WORK. LWORK >= max(1,18*N) */
  117. /* if JOBZ = 'V', and LWORK >= max(1,12*N) if JOBZ = 'N'. */
  118. /* If LWORK = -1, then a workspace query is assumed; the routine */
  119. /* only calculates the optimal size of the WORK array, returns */
  120. /* this value as the first entry of the WORK array, and no error */
  121. /* message related to LWORK is issued by XERBLA. */
  122. /* IWORK (workspace/output) INTEGER array, dimension (LIWORK) */
  123. /* On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK. */
  124. /* LIWORK (input) INTEGER */
  125. /* The dimension of the array IWORK. LIWORK >= max(1,10*N) */
  126. /* if the eigenvectors are desired, and LIWORK >= max(1,8*N) */
  127. /* if only the eigenvalues are to be computed. */
  128. /* If LIWORK = -1, then a workspace query is assumed; the */
  129. /* routine only calculates the optimal size of the IWORK array, */
  130. /* returns this value as the first entry of the IWORK array, and */
  131. /* no error message related to LIWORK is issued by XERBLA. */
  132. /* INFO (output) INTEGER */
  133. /* On exit, INFO */
  134. /* = 0: successful exit */
  135. /* < 0: if INFO = -i, the i-th argument had an illegal value */
  136. /* > 0: if INFO = 1X, internal error in DLARRE, */
  137. /* if INFO = 2X, internal error in DLARRV. */
  138. /* Here, the digit X = ABS( IINFO ) < 10, where IINFO is */
  139. /* the nonzero error code returned by DLARRE or */
  140. /* DLARRV, respectively. */
  141. /* Further Details */
  142. /* =============== */
  143. /* Based on contributions by */
  144. /* Inderjit Dhillon, IBM Almaden, USA */
  145. /* Osni Marques, LBNL/NERSC, USA */
  146. /* Christof Voemel, LBNL/NERSC, USA */
  147. /* ===================================================================== */
  148. /* .. Local Scalars .. */
  149. /* .. */
  150. /* .. External Subroutines .. */
  151. /* .. */
  152. /* .. Executable Statements .. */
  153. /* Parameter adjustments */
  154. --d__;
  155. --e;
  156. --w;
  157. z_dim1 = *ldz;
  158. z_offset = 1 + z_dim1;
  159. z__ -= z_offset;
  160. --isuppz;
  161. --work;
  162. --iwork;
  163. /* Function Body */
  164. *info = 0;
  165. tryrac = FALSE_;
  166. _starpu_dstemr_(jobz, range, n, &d__[1], &e[1], vl, vu, il, iu, m, &w[1], &z__[
  167. z_offset], ldz, n, &isuppz[1], &tryrac, &work[1], lwork, &iwork[1]
  168. , liwork, info);
  169. /* End of DSTEGR */
  170. return 0;
  171. } /* _starpu_dstegr_ */