PageRenderTime 56ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 1ms

/specs/lapack/lapack-20010525.patch

https://github.com/dfateyev/rpms
Patch | 12261 lines | 12261 code | 0 blank | 0 comment | 0 complexity | cd0e9eb45b508c610a2f84b421ec52a7 MD5 | raw file
Possible License(s): AGPL-3.0, GPL-2.0, CC0-1.0

Large files files are truncated, but you can click here to view the full file

  1. diff -uNr LAPACK.orig/BLAS/TESTING/cblat2.f LAPACK/BLAS/TESTING/cblat2.f
  2. --- LAPACK.orig/BLAS/TESTING/cblat2.f Thu Nov 4 14:23:26 1999
  3. +++ LAPACK/BLAS/TESTING/cblat2.f Fri May 25 15:57:46 2001
  4. @@ -64,6 +64,10 @@
  5. * Richard Hanson, Sandia National Labs.
  6. * Jeremy Du Croz, NAG Central Office.
  7. *
  8. +* 10-9-00: Change STATUS='NEW' to 'UNKNOWN' so that the testers
  9. +* can be run multiple times without deleting generated
  10. +* output files (susan)
  11. +*
  12. * .. Parameters ..
  13. INTEGER NIN
  14. PARAMETER ( NIN = 5 )
  15. @@ -126,7 +130,7 @@
  16. *
  17. READ( NIN, FMT = * )SUMMRY
  18. READ( NIN, FMT = * )NOUT
  19. - OPEN( NOUT, FILE = SUMMRY, STATUS = 'NEW' )
  20. + OPEN( NOUT, FILE = SUMMRY, STATUS = 'UNKNOWN' )
  21. NOUTC = NOUT
  22. *
  23. * Read name and unit number for snapshot output file and open file.
  24. @@ -135,7 +139,7 @@
  25. READ( NIN, FMT = * )NTRA
  26. TRACE = NTRA.GE.0
  27. IF( TRACE )THEN
  28. - OPEN( NTRA, FILE = SNAPS, STATUS = 'NEW' )
  29. + OPEN( NTRA, FILE = SNAPS, STATUS = 'UNKNOWN' )
  30. END IF
  31. * Read the flag that directs rewinding of the snapshot file.
  32. READ( NIN, FMT = * )REWI
  33. diff -uNr LAPACK.orig/BLAS/TESTING/cblat3.f LAPACK/BLAS/TESTING/cblat3.f
  34. --- LAPACK.orig/BLAS/TESTING/cblat3.f Thu Nov 4 14:23:26 1999
  35. +++ LAPACK/BLAS/TESTING/cblat3.f Fri May 25 15:58:08 2001
  36. @@ -46,6 +46,10 @@
  37. * Jeremy Du Croz, Numerical Algorithms Group Ltd.
  38. * Sven Hammarling, Numerical Algorithms Group Ltd.
  39. *
  40. +* 10-9-00: Change STATUS='NEW' to 'UNKNOWN' so that the testers
  41. +* can be run multiple times without deleting generated
  42. +* output files (susan)
  43. +*
  44. * .. Parameters ..
  45. INTEGER NIN
  46. PARAMETER ( NIN = 5 )
  47. diff -uNr LAPACK.orig/BLAS/TESTING/dblat2.f LAPACK/BLAS/TESTING/dblat2.f
  48. --- LAPACK.orig/BLAS/TESTING/dblat2.f Thu Nov 4 14:23:27 1999
  49. +++ LAPACK/BLAS/TESTING/dblat2.f Fri May 25 15:57:41 2001
  50. @@ -63,6 +63,10 @@
  51. * Richard Hanson, Sandia National Labs.
  52. * Jeremy Du Croz, NAG Central Office.
  53. *
  54. +* 10-9-00: Change STATUS='NEW' to 'UNKNOWN' so that the testers
  55. +* can be run multiple times without deleting generated
  56. +* output files (susan)
  57. +*
  58. * .. Parameters ..
  59. INTEGER NIN
  60. PARAMETER ( NIN = 5 )
  61. @@ -121,7 +125,7 @@
  62. *
  63. READ( NIN, FMT = * )SUMMRY
  64. READ( NIN, FMT = * )NOUT
  65. - OPEN( NOUT, FILE = SUMMRY, STATUS = 'NEW' )
  66. + OPEN( NOUT, FILE = SUMMRY, STATUS = 'UNKNOWN' )
  67. NOUTC = NOUT
  68. *
  69. * Read name and unit number for snapshot output file and open file.
  70. @@ -130,7 +134,7 @@
  71. READ( NIN, FMT = * )NTRA
  72. TRACE = NTRA.GE.0
  73. IF( TRACE )THEN
  74. - OPEN( NTRA, FILE = SNAPS, STATUS = 'NEW' )
  75. + OPEN( NTRA, FILE = SNAPS, STATUS = 'UNKNOWN' )
  76. END IF
  77. * Read the flag that directs rewinding of the snapshot file.
  78. READ( NIN, FMT = * )REWI
  79. diff -uNr LAPACK.orig/BLAS/TESTING/dblat3.f LAPACK/BLAS/TESTING/dblat3.f
  80. --- LAPACK.orig/BLAS/TESTING/dblat3.f Thu Nov 4 14:23:27 1999
  81. +++ LAPACK/BLAS/TESTING/dblat3.f Fri May 25 15:58:04 2001
  82. @@ -43,6 +43,10 @@
  83. * Jeremy Du Croz, Numerical Algorithms Group Ltd.
  84. * Sven Hammarling, Numerical Algorithms Group Ltd.
  85. *
  86. +* 10-9-00: Change STATUS='NEW' to 'UNKNOWN' so that the testers
  87. +* can be run multiple times without deleting generated
  88. +* output files (susan)
  89. +*
  90. * .. Parameters ..
  91. INTEGER NIN
  92. PARAMETER ( NIN = 5 )
  93. @@ -96,7 +100,7 @@
  94. *
  95. READ( NIN, FMT = * )SUMMRY
  96. READ( NIN, FMT = * )NOUT
  97. - OPEN( NOUT, FILE = SUMMRY, STATUS = 'NEW' )
  98. + OPEN( NOUT, FILE = SUMMRY, STATUS = 'UNKNOWN' )
  99. NOUTC = NOUT
  100. *
  101. * Read name and unit number for snapshot output file and open file.
  102. @@ -105,7 +109,7 @@
  103. READ( NIN, FMT = * )NTRA
  104. TRACE = NTRA.GE.0
  105. IF( TRACE )THEN
  106. - OPEN( NTRA, FILE = SNAPS, STATUS = 'NEW' )
  107. + OPEN( NTRA, FILE = SNAPS, STATUS = 'UNKNOWN' )
  108. END IF
  109. * Read the flag that directs rewinding of the snapshot file.
  110. READ( NIN, FMT = * )REWI
  111. diff -uNr LAPACK.orig/BLAS/TESTING/sblat2.f LAPACK/BLAS/TESTING/sblat2.f
  112. --- LAPACK.orig/BLAS/TESTING/sblat2.f Thu Nov 4 14:23:26 1999
  113. +++ LAPACK/BLAS/TESTING/sblat2.f Fri May 25 15:57:34 2001
  114. @@ -63,6 +63,10 @@
  115. * Richard Hanson, Sandia National Labs.
  116. * Jeremy Du Croz, NAG Central Office.
  117. *
  118. +* 10-9-00: Change STATUS='NEW' to 'UNKNOWN' so that the testers
  119. +* can be run multiple times without deleting generated
  120. +* output files (susan)
  121. +*
  122. * .. Parameters ..
  123. INTEGER NIN
  124. PARAMETER ( NIN = 5 )
  125. @@ -121,7 +125,7 @@
  126. *
  127. READ( NIN, FMT = * )SUMMRY
  128. READ( NIN, FMT = * )NOUT
  129. - OPEN( NOUT, FILE = SUMMRY, STATUS = 'NEW' )
  130. + OPEN( NOUT, FILE = SUMMRY, STATUS = 'UNKNOWN' )
  131. NOUTC = NOUT
  132. *
  133. * Read name and unit number for snapshot output file and open file.
  134. @@ -130,7 +134,7 @@
  135. READ( NIN, FMT = * )NTRA
  136. TRACE = NTRA.GE.0
  137. IF( TRACE )THEN
  138. - OPEN( NTRA, FILE = SNAPS, STATUS = 'NEW' )
  139. + OPEN( NTRA, FILE = SNAPS, STATUS = 'UNKNOWN' )
  140. END IF
  141. * Read the flag that directs rewinding of the snapshot file.
  142. READ( NIN, FMT = * )REWI
  143. diff -uNr LAPACK.orig/BLAS/TESTING/sblat3.f LAPACK/BLAS/TESTING/sblat3.f
  144. --- LAPACK.orig/BLAS/TESTING/sblat3.f Thu Nov 4 14:23:26 1999
  145. +++ LAPACK/BLAS/TESTING/sblat3.f Fri May 25 15:58:00 2001
  146. @@ -43,6 +43,10 @@
  147. * Jeremy Du Croz, Numerical Algorithms Group Ltd.
  148. * Sven Hammarling, Numerical Algorithms Group Ltd.
  149. *
  150. +* 10-9-00: Change STATUS='NEW' to 'UNKNOWN' so that the testers
  151. +* can be run multiple times without deleting generated
  152. +* output files (susan)
  153. +*
  154. * .. Parameters ..
  155. INTEGER NIN
  156. PARAMETER ( NIN = 5 )
  157. diff -uNr LAPACK.orig/BLAS/TESTING/zblat2.f LAPACK/BLAS/TESTING/zblat2.f
  158. --- LAPACK.orig/BLAS/TESTING/zblat2.f Thu Nov 4 14:23:27 1999
  159. +++ LAPACK/BLAS/TESTING/zblat2.f Fri May 25 15:57:52 2001
  160. @@ -64,6 +64,10 @@
  161. * Richard Hanson, Sandia National Labs.
  162. * Jeremy Du Croz, NAG Central Office.
  163. *
  164. +* 10-9-00: Change STATUS='NEW' to 'UNKNOWN' so that the testers
  165. +* can be run multiple times without deleting generated
  166. +* output files (susan)
  167. +*
  168. * .. Parameters ..
  169. INTEGER NIN
  170. PARAMETER ( NIN = 5 )
  171. @@ -127,7 +131,7 @@
  172. *
  173. READ( NIN, FMT = * )SUMMRY
  174. READ( NIN, FMT = * )NOUT
  175. - OPEN( NOUT, FILE = SUMMRY, STATUS = 'NEW' )
  176. + OPEN( NOUT, FILE = SUMMRY, STATUS = 'UNKNOWN' )
  177. NOUTC = NOUT
  178. *
  179. * Read name and unit number for snapshot output file and open file.
  180. @@ -136,7 +140,7 @@
  181. READ( NIN, FMT = * )NTRA
  182. TRACE = NTRA.GE.0
  183. IF( TRACE )THEN
  184. - OPEN( NTRA, FILE = SNAPS, STATUS = 'NEW' )
  185. + OPEN( NTRA, FILE = SNAPS, STATUS = 'UNKNOWN' )
  186. END IF
  187. * Read the flag that directs rewinding of the snapshot file.
  188. READ( NIN, FMT = * )REWI
  189. diff -uNr LAPACK.orig/BLAS/TESTING/zblat3.f LAPACK/BLAS/TESTING/zblat3.f
  190. --- LAPACK.orig/BLAS/TESTING/zblat3.f Thu Nov 4 14:23:27 1999
  191. +++ LAPACK/BLAS/TESTING/zblat3.f Fri May 25 15:58:16 2001
  192. @@ -46,6 +46,10 @@
  193. * Jeremy Du Croz, Numerical Algorithms Group Ltd.
  194. * Sven Hammarling, Numerical Algorithms Group Ltd.
  195. *
  196. +* 10-9-00: Change STATUS='NEW' to 'UNKNOWN' so that the testers
  197. +* can be run multiple times without deleting generated
  198. +* output files (susan)
  199. +*
  200. * .. Parameters ..
  201. INTEGER NIN
  202. PARAMETER ( NIN = 5 )
  203. @@ -104,7 +108,7 @@
  204. *
  205. READ( NIN, FMT = * )SUMMRY
  206. READ( NIN, FMT = * )NOUT
  207. - OPEN( NOUT, FILE = SUMMRY, STATUS = 'NEW' )
  208. + OPEN( NOUT, FILE = SUMMRY, STATUS = 'UNKNOWN' )
  209. NOUTC = NOUT
  210. *
  211. * Read name and unit number for snapshot output file and open file.
  212. @@ -113,7 +117,7 @@
  213. READ( NIN, FMT = * )NTRA
  214. TRACE = NTRA.GE.0
  215. IF( TRACE )THEN
  216. - OPEN( NTRA, FILE = SNAPS, STATUS = 'NEW' )
  217. + OPEN( NTRA, FILE = SNAPS, STATUS = 'UNKNOWN' )
  218. END IF
  219. * Read the flag that directs rewinding of the snapshot file.
  220. READ( NIN, FMT = * )REWI
  221. @@ -1962,6 +1966,7 @@
  222. * 3-19-92: Initialize ALPHA, BETA, RALPHA, and RBETA (eca)
  223. * 3-19-92: Fix argument 12 in calls to ZSYMM and ZHEMM
  224. * with INFOT = 9 (eca)
  225. +* 10-9-00: Declared INTRINSIC DCMPLX (susan)
  226. *
  227. * .. Scalar Arguments ..
  228. INTEGER ISNUM, NOUT
  229. @@ -1980,6 +1985,8 @@
  230. * .. External Subroutines ..
  231. EXTERNAL ZGEMM, ZHEMM, ZHER2K, ZHERK, CHKXER, ZSYMM,
  232. $ ZSYR2K, ZSYRK, ZTRMM, ZTRSM
  233. +* .. Intrinsic Functions ..
  234. + INTRINSIC DCMPLX
  235. * .. Common blocks ..
  236. COMMON /INFOC/INFOT, NOUTC, OK, LERR
  237. * .. Executable Statements ..
  238. diff -uNr LAPACK.orig/INSTALL/make.inc.LINUX LAPACK/INSTALL/make.inc.LINUX
  239. --- LAPACK.orig/INSTALL/make.inc.LINUX Thu Nov 4 14:23:30 1999
  240. +++ LAPACK/INSTALL/make.inc.LINUX Fri May 25 15:58:36 2001
  241. @@ -17,7 +17,7 @@
  242. # desired load options for your machine.
  243. #
  244. FORTRAN = g77
  245. -OPTS = -funroll-all-loops -fno-f2c -O3
  246. +OPTS = -funroll-all-loops -O3
  247. DRVOPTS = $(OPTS)
  248. NOOPT =
  249. LOADER = g77
  250. diff -uNr LAPACK.orig/SRC/cbdsqr.f LAPACK/SRC/cbdsqr.f
  251. --- LAPACK.orig/SRC/cbdsqr.f Thu Nov 4 14:23:31 1999
  252. +++ LAPACK/SRC/cbdsqr.f Fri May 25 15:59:05 2001
  253. @@ -4,7 +4,7 @@
  254. * -- LAPACK routine (version 3.0) --
  255. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  256. * Courant Institute, Argonne National Lab, and Rice University
  257. -* October 31, 1999
  258. +* April 25, 2001
  259. *
  260. * .. Scalar Arguments ..
  261. CHARACTER UPLO
  262. @@ -18,14 +18,26 @@
  263. * Purpose
  264. * =======
  265. *
  266. -* CBDSQR computes the singular value decomposition (SVD) of a real
  267. -* N-by-N (upper or lower) bidiagonal matrix B: B = Q * S * P' (P'
  268. -* denotes the transpose of P), where S is a diagonal matrix with
  269. -* non-negative diagonal elements (the singular values of B), and Q
  270. -* and P are orthogonal matrices.
  271. -*
  272. -* The routine computes S, and optionally computes U * Q, P' * VT,
  273. -* or Q' * C, for given complex input matrices U, VT, and C.
  274. +* CBDSQR computes the singular values and, optionally, the right and/or
  275. +* left singular vectors from the singular value decomposition (SVD) of
  276. +* a real N-by-N (upper or lower) bidiagonal matrix B using the implicit
  277. +* zero-shift QR algorithm. The SVD of B has the form
  278. +*
  279. +* B = Q * S * P**H
  280. +*
  281. +* where S is the diagonal matrix of singular values, Q is an orthogonal
  282. +* matrix of left singular vectors, and P is an orthogonal matrix of
  283. +* right singular vectors. If left singular vectors are requested, this
  284. +* subroutine actually returns U*Q instead of Q, and, if right singular
  285. +* vectors are requested, this subroutine returns P**H*VT instead of
  286. +* P**H, for given complex input matrices U and VT. When U and VT are
  287. +* the unitary matrices that reduce a general matrix A to bidiagonal
  288. +* form: A = U*B*VT, as computed by CGEBRD, then
  289. +*
  290. +* A = (U*Q) * S * (P**H*VT)
  291. +*
  292. +* is the SVD of A. Optionally, the subroutine may also compute Q**H*C
  293. +* for a given complex input matrix C.
  294. *
  295. * See "Computing Small Singular Values of Bidiagonal Matrices With
  296. * Guaranteed High Relative Accuracy," by J. Demmel and W. Kahan,
  297. @@ -61,18 +73,17 @@
  298. * order.
  299. *
  300. * E (input/output) REAL array, dimension (N)
  301. -* On entry, the elements of E contain the
  302. -* offdiagonal elements of of the bidiagonal matrix whose SVD
  303. -* is desired. On normal exit (INFO = 0), E is destroyed.
  304. -* If the algorithm does not converge (INFO > 0), D and E
  305. +* On entry, the N-1 offdiagonal elements of the bidiagonal
  306. +* matrix B.
  307. +* On exit, if INFO = 0, E is destroyed; if INFO > 0, D and E
  308. * will contain the diagonal and superdiagonal elements of a
  309. * bidiagonal matrix orthogonally equivalent to the one given
  310. * as input. E(N) is used for workspace.
  311. *
  312. * VT (input/output) COMPLEX array, dimension (LDVT, NCVT)
  313. * On entry, an N-by-NCVT matrix VT.
  314. -* On exit, VT is overwritten by P' * VT.
  315. -* VT is not referenced if NCVT = 0.
  316. +* On exit, VT is overwritten by P**H * VT.
  317. +* Not referenced if NCVT = 0.
  318. *
  319. * LDVT (input) INTEGER
  320. * The leading dimension of the array VT.
  321. @@ -81,21 +92,22 @@
  322. * U (input/output) COMPLEX array, dimension (LDU, N)
  323. * On entry, an NRU-by-N matrix U.
  324. * On exit, U is overwritten by U * Q.
  325. -* U is not referenced if NRU = 0.
  326. +* Not referenced if NRU = 0.
  327. *
  328. * LDU (input) INTEGER
  329. * The leading dimension of the array U. LDU >= max(1,NRU).
  330. *
  331. * C (input/output) COMPLEX array, dimension (LDC, NCC)
  332. * On entry, an N-by-NCC matrix C.
  333. -* On exit, C is overwritten by Q' * C.
  334. -* C is not referenced if NCC = 0.
  335. +* On exit, C is overwritten by Q**H * C.
  336. +* Not referenced if NCC = 0.
  337. *
  338. * LDC (input) INTEGER
  339. * The leading dimension of the array C.
  340. * LDC >= max(1,N) if NCC > 0; LDC >=1 if NCC = 0.
  341. *
  342. -* RWORK (workspace) REAL array, dimension (4*N)
  343. +* RWORK (workspace) REAL array, dimension (2*N)
  344. +* if NCVT = NRU = NCC = 0, (max(1, 4*N-4)) otherwise
  345. *
  346. * INFO (output) INTEGER
  347. * = 0: successful exit
  348. diff -uNr LAPACK.orig/SRC/cgebd2.f LAPACK/SRC/cgebd2.f
  349. --- LAPACK.orig/SRC/cgebd2.f Thu Nov 4 14:24:07 1999
  350. +++ LAPACK/SRC/cgebd2.f Fri May 25 15:59:27 2001
  351. @@ -3,7 +3,7 @@
  352. * -- LAPACK routine (version 3.0) --
  353. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  354. * Courant Institute, Argonne National Lab, and Rice University
  355. -* September 30, 1994
  356. +* May 7, 2001
  357. *
  358. * .. Scalar Arguments ..
  359. INTEGER INFO, LDA, M, N
  360. @@ -172,8 +172,9 @@
  361. *
  362. * Apply H(i)' to A(i:m,i+1:n) from the left
  363. *
  364. - CALL CLARF( 'Left', M-I+1, N-I, A( I, I ), 1,
  365. - $ CONJG( TAUQ( I ) ), A( I, I+1 ), LDA, WORK )
  366. + IF( I.LT.N )
  367. + $ CALL CLARF( 'Left', M-I+1, N-I, A( I, I ), 1,
  368. + $ CONJG( TAUQ( I ) ), A( I, I+1 ), LDA, WORK )
  369. A( I, I ) = D( I )
  370. *
  371. IF( I.LT.N ) THEN
  372. @@ -215,8 +216,9 @@
  373. *
  374. * Apply G(i) to A(i+1:m,i:n) from the right
  375. *
  376. - CALL CLARF( 'Right', M-I, N-I+1, A( I, I ), LDA, TAUP( I ),
  377. - $ A( MIN( I+1, M ), I ), LDA, WORK )
  378. + IF( I.LT.M )
  379. + $ CALL CLARF( 'Right', M-I, N-I+1, A( I, I ), LDA,
  380. + $ TAUP( I ), A( MIN( I+1, M ), I ), LDA, WORK )
  381. CALL CLACGV( N-I+1, A( I, I ), LDA )
  382. A( I, I ) = D( I )
  383. *
  384. diff -uNr LAPACK.orig/SRC/cgees.f LAPACK/SRC/cgees.f
  385. --- LAPACK.orig/SRC/cgees.f Thu Nov 4 14:24:08 1999
  386. +++ LAPACK/SRC/cgees.f Fri May 25 15:59:55 2001
  387. @@ -5,6 +5,7 @@
  388. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  389. * Courant Institute, Argonne National Lab, and Rice University
  390. * June 30, 1999
  391. +* 8-15-00: Improve consistency of WS calculations (eca)
  392. *
  393. * .. Scalar Arguments ..
  394. CHARACTER JOBVS, SORT
  395. @@ -89,10 +90,9 @@
  396. * The dimension of the array WORK. LWORK >= max(1,2*N).
  397. * For good performance, LWORK must generally be larger.
  398. *
  399. -* If LWORK = -1, then a workspace query is assumed; the routine
  400. -* only calculates the optimal size of the WORK array, returns
  401. -* this value as the first entry of the WORK array, and no error
  402. -* message related to LWORK is issued by XERBLA.
  403. +* If LWORK = -1, a workspace query is assumed. The optimal
  404. +* size for the WORK array is calculated and stored in WORK(1),
  405. +* and no other work except argument checking is performed.
  406. *
  407. * RWORK (workspace) REAL array, dimension (N)
  408. *
  409. @@ -120,11 +120,13 @@
  410. * =====================================================================
  411. *
  412. * .. Parameters ..
  413. + INTEGER LQUERV
  414. + PARAMETER ( LQUERV = -1 )
  415. REAL ZERO, ONE
  416. PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0 )
  417. * ..
  418. * .. Local Scalars ..
  419. - LOGICAL LQUERY, SCALEA, WANTST, WANTVS
  420. + LOGICAL SCALEA, WANTST, WANTVS
  421. INTEGER HSWORK, I, IBAL, ICOND, IERR, IEVAL, IHI, ILO,
  422. $ ITAU, IWRK, K, MAXB, MAXWRK, MINWRK
  423. REAL ANRM, BIGNUM, CSCALE, EPS, S, SEP, SMLNUM
  424. @@ -150,7 +152,6 @@
  425. * Test the input arguments
  426. *
  427. INFO = 0
  428. - LQUERY = ( LWORK.EQ.-1 )
  429. WANTVS = LSAME( JOBVS, 'V' )
  430. WANTST = LSAME( SORT, 'S' )
  431. IF( ( .NOT.WANTVS ) .AND. ( .NOT.LSAME( JOBVS, 'N' ) ) ) THEN
  432. @@ -177,7 +178,7 @@
  433. * the worst case.)
  434. *
  435. MINWRK = 1
  436. - IF( INFO.EQ.0 .AND. ( LWORK.GE.1 .OR. LQUERY ) ) THEN
  437. + IF( INFO.EQ.0 ) THEN
  438. MAXWRK = N + N*ILAENV( 1, 'CGEHRD', ' ', N, 1, N, 0 )
  439. MINWRK = MAX( 1, 2*N )
  440. IF( .NOT.WANTVS ) THEN
  441. @@ -196,19 +197,17 @@
  442. MAXWRK = MAX( MAXWRK, HSWORK, 1 )
  443. END IF
  444. WORK( 1 ) = MAXWRK
  445. + IF( LWORK.LT.MINWRK .AND. LWORK.NE.LQUERV )
  446. + $ INFO = -12
  447. END IF
  448. - IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
  449. - INFO = -12
  450. - END IF
  451. +*
  452. +* Quick returns
  453. +*
  454. IF( INFO.NE.0 ) THEN
  455. CALL XERBLA( 'CGEES ', -INFO )
  456. RETURN
  457. - ELSE IF( LQUERY ) THEN
  458. - RETURN
  459. END IF
  460. -*
  461. -* Quick return if possible
  462. -*
  463. + IF( LWORK.EQ.LQUERV ) RETURN
  464. IF( N.EQ.0 ) THEN
  465. SDIM = 0
  466. RETURN
  467. diff -uNr LAPACK.orig/SRC/cgeesx.f LAPACK/SRC/cgeesx.f
  468. --- LAPACK.orig/SRC/cgeesx.f Thu Nov 4 14:24:08 1999
  469. +++ LAPACK/SRC/cgeesx.f Fri May 25 16:00:18 2001
  470. @@ -6,6 +6,7 @@
  471. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  472. * Courant Institute, Argonne National Lab, and Rice University
  473. * June 30, 1999
  474. +* 8-15-00: Do WS calculations if LWORK = -1 (eca)
  475. *
  476. * .. Scalar Arguments ..
  477. CHARACTER JOBVS, SENSE, SORT
  478. @@ -119,6 +120,10 @@
  479. * this routine. Note that 2*SDIM*(N-SDIM) <= N*N/2.
  480. * For good performance, LWORK must generally be larger.
  481. *
  482. +* If LWORK = -1, a workspace query is assumed. The optimal
  483. +* size for the WORK array is calculated and stored in WORK(1),
  484. +* and no other work except argument checking is performed.
  485. +*
  486. * RWORK (workspace) REAL array, dimension (N)
  487. *
  488. * BWORK (workspace) LOGICAL array, dimension (N)
  489. @@ -144,6 +149,8 @@
  490. * =====================================================================
  491. *
  492. * .. Parameters ..
  493. + INTEGER LQUERV
  494. + PARAMETER ( LQUERV = -1 )
  495. REAL ZERO, ONE
  496. PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0 )
  497. * ..
  498. @@ -211,7 +218,7 @@
  499. * in the code.)
  500. *
  501. MINWRK = 1
  502. - IF( INFO.EQ.0 .AND. ( LWORK.GE.1 ) ) THEN
  503. + IF( INFO.EQ.0 ) THEN
  504. MAXWRK = N + N*ILAENV( 1, 'CGEHRD', ' ', N, 1, N, 0 )
  505. MINWRK = MAX( 1, 2*N )
  506. IF( .NOT.WANTVS ) THEN
  507. @@ -229,18 +236,24 @@
  508. HSWORK = MAX( K*( K+2 ), 2*N )
  509. MAXWRK = MAX( MAXWRK, HSWORK, 1 )
  510. END IF
  511. +*
  512. +* Estimate the workspace needed by CTRSEN.
  513. +*
  514. + IF( WANTST ) THEN
  515. + MAXWRK = MAX( MAXWRK, (N*N+1)/2 )
  516. + END IF
  517. WORK( 1 ) = MAXWRK
  518. + IF( LWORK.LT.MINWRK .AND. LWORK.NE.LQUERV )
  519. + & INFO = -15
  520. END IF
  521. - IF( LWORK.LT.MINWRK ) THEN
  522. - INFO = -15
  523. - END IF
  524. +*
  525. +* Quick returns
  526. +*
  527. IF( INFO.NE.0 ) THEN
  528. CALL XERBLA( 'CGEESX', -INFO )
  529. RETURN
  530. END IF
  531. -*
  532. -* Quick return if possible
  533. -*
  534. + IF( LWORK.EQ.LQUERV ) RETURN
  535. IF( N.EQ.0 ) THEN
  536. SDIM = 0
  537. RETURN
  538. diff -uNr LAPACK.orig/SRC/cgeev.f LAPACK/SRC/cgeev.f
  539. --- LAPACK.orig/SRC/cgeev.f Thu Nov 4 14:24:08 1999
  540. +++ LAPACK/SRC/cgeev.f Fri May 25 16:00:48 2001
  541. @@ -5,6 +5,7 @@
  542. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  543. * Courant Institute, Argonne National Lab, and Rice University
  544. * June 30, 1999
  545. +* 8-15-00: Improve consistency of WS calculations (eca)
  546. *
  547. * .. Scalar Arguments ..
  548. CHARACTER JOBVL, JOBVR
  549. @@ -85,10 +86,9 @@
  550. * The dimension of the array WORK. LWORK >= max(1,2*N).
  551. * For good performance, LWORK must generally be larger.
  552. *
  553. -* If LWORK = -1, then a workspace query is assumed; the routine
  554. -* only calculates the optimal size of the WORK array, returns
  555. -* this value as the first entry of the WORK array, and no error
  556. -* message related to LWORK is issued by XERBLA.
  557. +* If LWORK = -1, a workspace query is assumed. The optimal
  558. +* size for the WORK array is calculated and stored in WORK(1),
  559. +* and no other work except argument checking is performed.
  560. *
  561. * RWORK (workspace) REAL array, dimension (2*N)
  562. *
  563. @@ -103,11 +103,13 @@
  564. * =====================================================================
  565. *
  566. * .. Parameters ..
  567. + INTEGER LQUERV
  568. + PARAMETER ( LQUERV = -1 )
  569. REAL ZERO, ONE
  570. PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0 )
  571. * ..
  572. * .. Local Scalars ..
  573. - LOGICAL LQUERY, SCALEA, WANTVL, WANTVR
  574. + LOGICAL SCALEA, WANTVL, WANTVR
  575. CHARACTER SIDE
  576. INTEGER HSWORK, I, IBAL, IERR, IHI, ILO, IRWORK, ITAU,
  577. $ IWRK, K, MAXB, MAXWRK, MINWRK, NOUT
  578. @@ -136,7 +138,6 @@
  579. * Test the input arguments
  580. *
  581. INFO = 0
  582. - LQUERY = ( LWORK.EQ.-1 )
  583. WANTVL = LSAME( JOBVL, 'V' )
  584. WANTVR = LSAME( JOBVR, 'V' )
  585. IF( ( .NOT.WANTVL ) .AND. ( .NOT.LSAME( JOBVL, 'N' ) ) ) THEN
  586. @@ -165,7 +166,7 @@
  587. * the worst case.)
  588. *
  589. MINWRK = 1
  590. - IF( INFO.EQ.0 .AND. ( LWORK.GE.1 .OR. LQUERY ) ) THEN
  591. + IF( INFO.EQ.0 ) THEN
  592. MAXWRK = N + N*ILAENV( 1, 'CGEHRD', ' ', N, 1, N, 0 )
  593. IF( ( .NOT.WANTVL ) .AND. ( .NOT.WANTVR ) ) THEN
  594. MINWRK = MAX( 1, 2*N )
  595. @@ -185,19 +186,17 @@
  596. MAXWRK = MAX( MAXWRK, HSWORK, 2*N )
  597. END IF
  598. WORK( 1 ) = MAXWRK
  599. + IF( LWORK.LT.MINWRK .AND. LWORK.NE.LQUERV )
  600. + $ INFO = -12
  601. END IF
  602. - IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
  603. - INFO = -12
  604. - END IF
  605. +*
  606. +* Quick returns
  607. +*
  608. IF( INFO.NE.0 ) THEN
  609. CALL XERBLA( 'CGEEV ', -INFO )
  610. RETURN
  611. - ELSE IF( LQUERY ) THEN
  612. - RETURN
  613. END IF
  614. -*
  615. -* Quick return if possible
  616. -*
  617. + IF( LWORK.EQ.LQUERV ) RETURN
  618. IF( N.EQ.0 )
  619. $ RETURN
  620. *
  621. diff -uNr LAPACK.orig/SRC/cgeevx.f LAPACK/SRC/cgeevx.f
  622. --- LAPACK.orig/SRC/cgeevx.f Thu Nov 4 14:24:08 1999
  623. +++ LAPACK/SRC/cgeevx.f Fri May 25 16:01:10 2001
  624. @@ -6,6 +6,7 @@
  625. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  626. * Courant Institute, Argonne National Lab, and Rice University
  627. * June 30, 1999
  628. +* 8-15-00: Improve consistency of WS calculations (eca)
  629. *
  630. * .. Scalar Arguments ..
  631. CHARACTER BALANC, JOBVL, JOBVR, SENSE
  632. @@ -166,10 +167,9 @@
  633. * LWORK >= N*N+2*N.
  634. * For good performance, LWORK must generally be larger.
  635. *
  636. -* If LWORK = -1, then a workspace query is assumed; the routine
  637. -* only calculates the optimal size of the WORK array, returns
  638. -* this value as the first entry of the WORK array, and no error
  639. -* message related to LWORK is issued by XERBLA.
  640. +* If LWORK = -1, a workspace query is assumed. The optimal
  641. +* size for the WORK array is calculated and stored in WORK(1),
  642. +* and no other work except argument checking is performed.
  643. *
  644. * RWORK (workspace) REAL array, dimension (2*N)
  645. *
  646. @@ -184,12 +184,14 @@
  647. * =====================================================================
  648. *
  649. * .. Parameters ..
  650. + INTEGER LQUERV
  651. + PARAMETER ( LQUERV = -1 )
  652. REAL ZERO, ONE
  653. PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0 )
  654. * ..
  655. * .. Local Scalars ..
  656. - LOGICAL LQUERY, SCALEA, WANTVL, WANTVR, WNTSNB, WNTSNE,
  657. - $ WNTSNN, WNTSNV
  658. + LOGICAL SCALEA, WANTVL, WANTVR, WNTSNB, WNTSNE, WNTSNN,
  659. + $ WNTSNV
  660. CHARACTER JOB, SIDE
  661. INTEGER HSWORK, I, ICOND, IERR, ITAU, IWRK, K, MAXB,
  662. $ MAXWRK, MINWRK, NOUT
  663. @@ -219,7 +221,6 @@
  664. * Test the input arguments
  665. *
  666. INFO = 0
  667. - LQUERY = ( LWORK.EQ.-1 )
  668. WANTVL = LSAME( JOBVL, 'V' )
  669. WANTVR = LSAME( JOBVR, 'V' )
  670. WNTSNN = LSAME( SENSE, 'N' )
  671. @@ -259,7 +260,7 @@
  672. * the worst case.)
  673. *
  674. MINWRK = 1
  675. - IF( INFO.EQ.0 .AND. ( LWORK.GE.1 .OR. LQUERY ) ) THEN
  676. + IF( INFO.EQ.0 ) THEN
  677. MAXWRK = N + N*ILAENV( 1, 'CGEHRD', ' ', N, 1, N, 0 )
  678. IF( ( .NOT.WANTVL ) .AND. ( .NOT.WANTVR ) ) THEN
  679. MINWRK = MAX( 1, 2*N )
  680. @@ -293,19 +294,17 @@
  681. MAXWRK = MAX( MAXWRK, 2*N, 1 )
  682. END IF
  683. WORK( 1 ) = MAXWRK
  684. + IF( LWORK.LT.MINWRK .AND. LWORK.NE.LQUERV )
  685. + $ INFO = -20
  686. END IF
  687. - IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
  688. - INFO = -20
  689. - END IF
  690. +*
  691. +* Quick returns
  692. +*
  693. IF( INFO.NE.0 ) THEN
  694. CALL XERBLA( 'CGEEVX', -INFO )
  695. RETURN
  696. - ELSE IF( LQUERY ) THEN
  697. - RETURN
  698. END IF
  699. -*
  700. -* Quick return if possible
  701. -*
  702. + IF( LWORK.EQ.LQUERV ) RETURN
  703. IF( N.EQ.0 )
  704. $ RETURN
  705. *
  706. diff -uNr LAPACK.orig/SRC/cgegs.f LAPACK/SRC/cgegs.f
  707. --- LAPACK.orig/SRC/cgegs.f Thu Nov 4 14:24:08 1999
  708. +++ LAPACK/SRC/cgegs.f Fri May 25 16:01:59 2001
  709. @@ -5,7 +5,7 @@
  710. * -- LAPACK driver routine (version 3.0) --
  711. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  712. * Courant Institute, Argonne National Lab, and Rice University
  713. -* June 30, 1999
  714. +* April 26, 2001
  715. *
  716. * .. Scalar Arguments ..
  717. CHARACTER JOBVSL, JOBVSR
  718. @@ -23,83 +23,70 @@
  719. *
  720. * This routine is deprecated and has been replaced by routine CGGES.
  721. *
  722. -* CGEGS computes for a pair of N-by-N complex nonsymmetric matrices A,
  723. -* B: the generalized eigenvalues (alpha, beta), the complex Schur
  724. -* form (A, B), and optionally left and/or right Schur vectors
  725. -* (VSL and VSR).
  726. -*
  727. -* (If only the generalized eigenvalues are needed, use the driver CGEGV
  728. -* instead.)
  729. -*
  730. -* A generalized eigenvalue for a pair of matrices (A,B) is, roughly
  731. -* speaking, a scalar w or a ratio alpha/beta = w, such that A - w*B
  732. -* is singular. It is usually represented as the pair (alpha,beta),
  733. -* as there is a reasonable interpretation for beta=0, and even for
  734. -* both being zero. A good beginning reference is the book, "Matrix
  735. -* Computations", by G. Golub & C. van Loan (Johns Hopkins U. Press)
  736. -*
  737. -* The (generalized) Schur form of a pair of matrices is the result of
  738. -* multiplying both matrices on the left by one unitary matrix and
  739. -* both on the right by another unitary matrix, these two unitary
  740. -* matrices being chosen so as to bring the pair of matrices into
  741. -* upper triangular form with the diagonal elements of B being
  742. -* non-negative real numbers (this is also called complex Schur form.)
  743. -*
  744. -* The left and right Schur vectors are the columns of VSL and VSR,
  745. -* respectively, where VSL and VSR are the unitary matrices
  746. -* which reduce A and B to Schur form:
  747. -*
  748. -* Schur form of (A,B) = ( (VSL)**H A (VSR), (VSL)**H B (VSR) )
  749. +* CGEGS computes the eigenvalues, Schur form, and, optionally, the
  750. +* left and or/right Schur vectors of a complex matrix pair (A,B).
  751. +* Given two square matrices A and B, the generalized Schur
  752. +* factorization has the form
  753. +*
  754. +* A = Q*S*Z**H, B = Q*T*Z**H
  755. +*
  756. +* where Q and Z are unitary matrices and S and T are upper triangular.
  757. +* The columns of Q are the left Schur vectors
  758. +* and the columns of Z are the right Schur vectors.
  759. +*
  760. +* If only the eigenvalues of (A,B) are needed, the driver routine
  761. +* CGEGV should be used instead. See CGEGV for a description of the
  762. +* eigenvalues of the generalized nonsymmetric eigenvalue problem
  763. +* (GNEP).
  764. *
  765. * Arguments
  766. * =========
  767. *
  768. * JOBVSL (input) CHARACTER*1
  769. * = 'N': do not compute the left Schur vectors;
  770. -* = 'V': compute the left Schur vectors.
  771. +* = 'V': compute the left Schur vectors (returned in VSL).
  772. *
  773. * JOBVSR (input) CHARACTER*1
  774. * = 'N': do not compute the right Schur vectors;
  775. -* = 'V': compute the right Schur vectors.
  776. +* = 'V': compute the right Schur vectors (returned in VSR).
  777. *
  778. * N (input) INTEGER
  779. * The order of the matrices A, B, VSL, and VSR. N >= 0.
  780. *
  781. * A (input/output) COMPLEX array, dimension (LDA, N)
  782. -* On entry, the first of the pair of matrices whose generalized
  783. -* eigenvalues and (optionally) Schur vectors are to be
  784. -* computed.
  785. -* On exit, the generalized Schur form of A.
  786. +* On entry, the matrix A.
  787. +* On exit, the upper triangular matrix S from the generalized
  788. +* Schur factorization.
  789. *
  790. * LDA (input) INTEGER
  791. * The leading dimension of A. LDA >= max(1,N).
  792. *
  793. * B (input/output) COMPLEX array, dimension (LDB, N)
  794. -* On entry, the second of the pair of matrices whose
  795. -* generalized eigenvalues and (optionally) Schur vectors are
  796. -* to be computed.
  797. -* On exit, the generalized Schur form of B.
  798. +* On entry, the matrix B.
  799. +* On exit, the upper triangular matrix T from the generalized
  800. +* Schur factorization.
  801. *
  802. * LDB (input) INTEGER
  803. * The leading dimension of B. LDB >= max(1,N).
  804. *
  805. * ALPHA (output) COMPLEX array, dimension (N)
  806. +* The complex scalars alpha that define the eigenvalues of
  807. +* GNEP. ALPHA(j) = S(j,j), the diagonal element of the Schur
  808. +* form of A.
  809. +*
  810. * BETA (output) COMPLEX array, dimension (N)
  811. -* On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
  812. -* generalized eigenvalues. ALPHA(j), j=1,...,N and BETA(j),
  813. -* j=1,...,N are the diagonals of the complex Schur form (A,B)
  814. -* output by CGEGS. The BETA(j) will be non-negative real.
  815. -*
  816. -* Note: the quotients ALPHA(j)/BETA(j) may easily over- or
  817. -* underflow, and BETA(j) may even be zero. Thus, the user
  818. -* should avoid naively computing the ratio alpha/beta.
  819. -* However, ALPHA will be always less than and usually
  820. -* comparable with norm(A) in magnitude, and BETA always less
  821. -* than and usually comparable with norm(B).
  822. +* The non-negative real scalars beta that define the
  823. +* eigenvalues of GNEP. BETA(j) = T(j,j), the diagonal element
  824. +* of the triangular factor T.
  825. +*
  826. +* Together, the quantities alpha = ALPHA(j) and beta = BETA(j)
  827. +* represent the j-th eigenvalue of the matrix pair (A,B), in
  828. +* one of the forms lambda = alpha/beta or mu = beta/alpha.
  829. +* Since either lambda or mu may overflow, they should not,
  830. +* in general, be computed.
  831. *
  832. * VSL (output) COMPLEX array, dimension (LDVSL,N)
  833. -* If JOBVSL = 'V', VSL will contain the left Schur vectors.
  834. -* (See "Purpose", above.)
  835. +* If JOBVSL = 'V', the matrix of left Schur vectors Q.
  836. * Not referenced if JOBVSL = 'N'.
  837. *
  838. * LDVSL (input) INTEGER
  839. @@ -107,8 +94,7 @@
  840. * if JOBVSL = 'V', LDVSL >= N.
  841. *
  842. * VSR (output) COMPLEX array, dimension (LDVSR,N)
  843. -* If JOBVSR = 'V', VSR will contain the right Schur vectors.
  844. -* (See "Purpose", above.)
  845. +* If JOBVSR = 'V', the matrix of right Schur vectors Z.
  846. * Not referenced if JOBVSR = 'N'.
  847. *
  848. * LDVSR (input) INTEGER
  849. diff -uNr LAPACK.orig/SRC/cgegv.f LAPACK/SRC/cgegv.f
  850. --- LAPACK.orig/SRC/cgegv.f Thu Nov 4 14:24:08 1999
  851. +++ LAPACK/SRC/cgegv.f Fri May 25 16:02:21 2001
  852. @@ -4,7 +4,7 @@
  853. * -- LAPACK driver routine (version 3.0) --
  854. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  855. * Courant Institute, Argonne National Lab, and Rice University
  856. -* June 30, 1999
  857. +* April 26, 2001
  858. *
  859. * .. Scalar Arguments ..
  860. CHARACTER JOBVL, JOBVR
  861. @@ -22,22 +22,28 @@
  862. *
  863. * This routine is deprecated and has been replaced by routine CGGEV.
  864. *
  865. -* CGEGV computes for a pair of N-by-N complex nonsymmetric matrices A
  866. -* and B, the generalized eigenvalues (alpha, beta), and optionally,
  867. -* the left and/or right generalized eigenvectors (VL and VR).
  868. -*
  869. -* A generalized eigenvalue for a pair of matrices (A,B) is, roughly
  870. -* speaking, a scalar w or a ratio alpha/beta = w, such that A - w*B
  871. -* is singular. It is usually represented as the pair (alpha,beta),
  872. -* as there is a reasonable interpretation for beta=0, and even for
  873. -* both being zero. A good beginning reference is the book, "Matrix
  874. -* Computations", by G. Golub & C. van Loan (Johns Hopkins U. Press)
  875. -*
  876. -* A right generalized eigenvector corresponding to a generalized
  877. -* eigenvalue w for a pair of matrices (A,B) is a vector r such
  878. -* that (A - w B) r = 0 . A left generalized eigenvector is a vector
  879. -* l such that l**H * (A - w B) = 0, where l**H is the
  880. -* conjugate-transpose of l.
  881. +* CGEGV computes the eigenvalues and, optionally, the left and/or right
  882. +* eigenvectors of a complex matrix pair (A,B).
  883. +* Given two square matrices A and B,
  884. +* the generalized nonsymmetric eigenvalue problem (GNEP) is to find the
  885. +* eigenvalues lambda and corresponding (non-zero) eigenvectors x such
  886. +* that
  887. +* A*x = lambda*B*x.
  888. +*
  889. +* An alternate form is to find the eigenvalues mu and corresponding
  890. +* eigenvectors y such that
  891. +* mu*A*y = B*y.
  892. +*
  893. +* These two forms are equivalent with mu = 1/lambda and x = y if
  894. +* neither lambda nor mu is zero. In order to deal with the case that
  895. +* lambda or mu is zero or small, two values alpha and beta are returned
  896. +* for each eigenvalue, such that lambda = alpha/beta and
  897. +* mu = beta/alpha.
  898. +*
  899. +* The vectors x and y in the above equations are right eigenvectors of
  900. +* the matrix pair (A,B). Vectors u and v satisfying
  901. +* u**H*A = lambda*u**H*B or mu*v**H*A = v**H*B
  902. +* are left eigenvectors of (A,B).
  903. *
  904. * Note: this routine performs "full balancing" on A and B -- see
  905. * "Further Details", below.
  906. @@ -47,56 +53,62 @@
  907. *
  908. * JOBVL (input) CHARACTER*1
  909. * = 'N': do not compute the left generalized eigenvectors;
  910. -* = 'V': compute the left generalized eigenvectors.
  911. +* = 'V': compute the left generalized eigenvectors (returned
  912. +* in VL).
  913. *
  914. * JOBVR (input) CHARACTER*1
  915. * = 'N': do not compute the right generalized eigenvectors;
  916. -* = 'V': compute the right generalized eigenvectors.
  917. +* = 'V': compute the right generalized eigenvectors (returned
  918. +* in VR).
  919. *
  920. * N (input) INTEGER
  921. * The order of the matrices A, B, VL, and VR. N >= 0.
  922. *
  923. * A (input/output) COMPLEX array, dimension (LDA, N)
  924. -* On entry, the first of the pair of matrices whose
  925. -* generalized eigenvalues and (optionally) generalized
  926. -* eigenvectors are to be computed.
  927. -* On exit, the contents will have been destroyed. (For a
  928. -* description of the contents of A on exit, see "Further
  929. -* Details", below.)
  930. +* On entry, the matrix A.
  931. +* If JOBVL = 'V' or JOBVR = 'V', then on exit A
  932. +* contains the Schur form of A from the generalized Schur
  933. +* factorization of the pair (A,B) after balancing. If no
  934. +* eigenvectors were computed, then only the diagonal elements
  935. +* of the Schur form will be correct. See CGGHRD and CHGEQZ
  936. +* for details.
  937. *
  938. * LDA (input) INTEGER
  939. * The leading dimension of A. LDA >= max(1,N).
  940. *
  941. * B (input/output) COMPLEX array, dimension (LDB, N)
  942. -* On entry, the second of the pair of matrices whose
  943. -* generalized eigenvalues and (optionally) generalized
  944. -* eigenvectors are to be computed.
  945. -* On exit, the contents will have been destroyed. (For a
  946. -* description of the contents of B on exit, see "Further
  947. -* Details", below.)
  948. +* On entry, the matrix B.
  949. +* If JOBVL = 'V' or JOBVR = 'V', then on exit B contains the
  950. +* upper triangular matrix obtained from B in the generalized
  951. +* Schur factorization of the pair (A,B) after balancing.
  952. +* If no eigenvectors were computed, then only the diagonal
  953. +* elements of B will be correct. See CGGHRD and CHGEQZ for
  954. +* details.
  955. *
  956. * LDB (input) INTEGER
  957. * The leading dimension of B. LDB >= max(1,N).
  958. *
  959. * ALPHA (output) COMPLEX array, dimension (N)
  960. -* BETA (output) COMPLEX array, dimension (N)
  961. -* On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the
  962. -* generalized eigenvalues.
  963. +* The complex scalars alpha that define the eigenvalues of
  964. +* GNEP.
  965. *
  966. -* Note: the quotients ALPHA(j)/BETA(j) may easily over- or
  967. -* underflow, and BETA(j) may even be zero. Thus, the user
  968. -* should avoid naively computing the ratio alpha/beta.
  969. -* However, ALPHA will be always less than and usually
  970. -* comparable with norm(A) in magnitude, and BETA always less
  971. -* than and usually comparable with norm(B).
  972. +* BETA (output) COMPLEX array, dimension (N)
  973. +* The complex scalars beta that define the eigenvalues of GNEP.
  974. +*
  975. +* Together, the quantities alpha = ALPHA(j) and beta = BETA(j)
  976. +* represent the j-th eigenvalue of the matrix pair (A,B), in
  977. +* one of the forms lambda = alpha/beta or mu = beta/alpha.
  978. +* Since either lambda or mu may overflow, they should not,
  979. +* in general, be computed.
  980. +
  981. *
  982. * VL (output) COMPLEX array, dimension (LDVL,N)
  983. -* If JOBVL = 'V', the left generalized eigenvectors. (See
  984. -* "Purpose", above.)
  985. -* Each eigenvector will be scaled so the largest component
  986. -* will have abs(real part) + abs(imag. part) = 1, *except*
  987. -* that for eigenvalues with alpha=beta=0, a zero vector will
  988. -* be returned as the corresponding eigenvector.
  989. +* If JOBVL = 'V', the left eigenvectors u(j) are stored
  990. +* in the columns of VL, in the same order as their eigenvalues.
  991. +* Each eigenvector is scaled so that its largest component has
  992. +* abs(real part) + abs(imag. part) = 1, except for eigenvectors
  993. +* corresponding to an eigenvalue with alpha = beta = 0, which
  994. +* are set to zero.
  995. * Not referenced if JOBVL = 'N'.
  996. *
  997. * LDVL (input) INTEGER
  998. @@ -104,12 +116,12 @@
  999. * if JOBVL = 'V', LDVL >= N.
  1000. *
  1001. * VR (output) COMPLEX array, dimension (LDVR,N)
  1002. -* If JOBVR = 'V', the right generalized eigenvectors. (See
  1003. -* "Purpose", above.)
  1004. -* Each eigenvector will be scaled so the largest component
  1005. -* will have abs(real part) + abs(imag. part) = 1, *except*
  1006. -* that for eigenvalues with alpha=beta=0, a zero vector will
  1007. -* be returned as the corresponding eigenvector.
  1008. +* If JOBVR = 'V', the right eigenvectors x(j) are stored
  1009. +* in the columns of VR, in the same order as their eigenvalues.
  1010. +* Each eigenvector is scaled so that its largest component has
  1011. +* abs(real part) + abs(imag. part) = 1, except for eigenvectors
  1012. +* corresponding to an eigenvalue with alpha = beta = 0, which
  1013. +* are set to zero.
  1014. * Not referenced if JOBVR = 'N'.
  1015. *
  1016. * LDVR (input) INTEGER
  1017. diff -uNr LAPACK.orig/SRC/cgelsd.f LAPACK/SRC/cgelsd.f
  1018. --- LAPACK.orig/SRC/cgelsd.f Thu Nov 4 14:26:25 1999
  1019. +++ LAPACK/SRC/cgelsd.f Fri May 25 16:03:27 2001
  1020. @@ -4,7 +4,8 @@
  1021. * -- LAPACK driver routine (version 3.0) --
  1022. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  1023. * Courant Institute, Argonne National Lab, and Rice University
  1024. -* October 31, 1999
  1025. +* June 30, 1999
  1026. +* 8-15-00: Improve consistency of WS calculations (eca)
  1027. *
  1028. * .. Scalar Arguments ..
  1029. INTEGER INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
  1030. @@ -64,7 +65,8 @@
  1031. *
  1032. * A (input/output) COMPLEX array, dimension (LDA,N)
  1033. * On entry, the M-by-N matrix A.
  1034. -* On exit, A has been destroyed.
  1035. +* On exit, the first min(m,n) rows of A are overwritten with
  1036. +* its right singular vectors, stored rowwise.
  1037. *
  1038. * LDA (input) INTEGER
  1039. * The leading dimension of the array A. LDA >= max(1,M).
  1040. @@ -96,32 +98,24 @@
  1041. * On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  1042. *
  1043. * LWORK (input) INTEGER
  1044. -* The dimension of the array WORK. LWORK must be at least 1.
  1045. +* The dimension of the array WORK. LWORK >= 1.
  1046. * The exact minimum amount of workspace needed depends on M,
  1047. -* N and NRHS. As long as LWORK is at least
  1048. -* 2 * N + N * NRHS
  1049. -* if M is greater than or equal to N or
  1050. -* 2 * M + M * NRHS
  1051. -* if M is less than N, the code will execute correctly.
  1052. +* N and NRHS.
  1053. +* If M >= N, LWORK >= 2*N + N*NRHS.
  1054. +* If M < N, LWORK >= 2*M + M*NRHS.
  1055. * For good performance, LWORK should generally be larger.
  1056. *
  1057. -* If LWORK = -1, then a workspace query is assumed; the routine
  1058. -* only calculates the optimal size of the WORK array, returns
  1059. -* this value as the first entry of the WORK array, and no error
  1060. -* message related to LWORK is issued by XERBLA.
  1061. -*
  1062. -*
  1063. -* RWORK (workspace) REAL array, dimension at least
  1064. -* 10*N + 2*N*SMLSIZ + 8*N*NLVL + 3*SMLSIZ*NRHS +
  1065. -* (SMLSIZ+1)**2
  1066. -* if M is greater than or equal to N or
  1067. -* 10*M + 2*M*SMLSIZ + 8*M*NLVL + 3*SMLSIZ*NRHS +
  1068. -* (SMLSIZ+1)**2
  1069. -* if M is less than N, the code will execute correctly.
  1070. +* If LWORK = -1, a workspace query is assumed. The optimal
  1071. +* size for the WORK array is calculated and stored in WORK(1),
  1072. +* and no other work except argument checking is performed.
  1073. +*
  1074. +* RWORK (workspace) REAL array, dimension (LRWORK)
  1075. +* If M >= N, LRWORK >= 8*N + 2*N*SMLSIZ + 8*N*NLVL + N*NRHS.
  1076. +* If M < N, LRWORK >= 8*M + 2*M*SMLSIZ + 8*M*NLVL + M*NRHS.
  1077. * SMLSIZ is returned by ILAENV and is equal to the maximum
  1078. * size of the subproblems at the bottom of the computation
  1079. * tree (usually about 25), and
  1080. -* NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 )
  1081. +* NLVL = INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1
  1082. *
  1083. * IWORK (workspace) INTEGER array, dimension (LIWORK)
  1084. * LIWORK >= 3 * MINMN * NLVL + 11 * MINMN,
  1085. @@ -145,13 +139,14 @@
  1086. * =====================================================================
  1087. *
  1088. * .. Parameters ..
  1089. + INTEGER LQUERV
  1090. + PARAMETER ( LQUERV = -1 )
  1091. REAL ZERO, ONE
  1092. PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
  1093. COMPLEX CZERO
  1094. PARAMETER ( CZERO = ( 0.0E+0, 0.0E+0 ) )
  1095. * ..
  1096. * .. Local Scalars ..
  1097. - LOGICAL LQUERY
  1098. INTEGER IASCL, IBSCL, IE, IL, ITAU, ITAUP, ITAUQ,
  1099. $ LDWORK, MAXMN, MAXWRK, MINMN, MINWRK, MM,
  1100. $ MNTHR, NRWORK, NWORK, SMLSIZ
  1101. @@ -179,7 +174,6 @@
  1102. MINMN = MIN( M, N )
  1103. MAXMN = MAX( M, N )
  1104. MNTHR = ILAENV( 6, 'CGELSD', ' ', M, N, NRHS, -1 )
  1105. - LQUERY = ( LWORK.EQ.-1 )
  1106. IF( M.LT.0 ) THEN
  1107. INFO = -1
  1108. ELSE IF( N.LT.0 ) THEN
  1109. @@ -263,20 +257,17 @@
  1110. END IF
  1111. MINWRK = MIN( MINWRK, MAXWRK )
  1112. WORK( 1 ) = CMPLX( MAXWRK, 0 )
  1113. - IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
  1114. - INFO = -12
  1115. - END IF
  1116. + IF( LWORK.LT.MINWRK .AND. LWORK.NE.LQUERV )
  1117. + $ INFO = -12
  1118. END IF
  1119. *
  1120. +* Quick returns
  1121. +*
  1122. IF( INFO.NE.0 ) THEN
  1123. CALL XERBLA( 'CGELSD', -INFO )
  1124. RETURN
  1125. - ELSE IF( LQUERY ) THEN
  1126. - GO TO 10
  1127. END IF
  1128. -*
  1129. -* Quick return if possible.
  1130. -*
  1131. + IF( LWORK.EQ.LQUERV ) RETURN
  1132. IF( M.EQ.0 .OR. N.EQ.0 ) THEN
  1133. RANK = 0
  1134. RETURN
  1135. diff -uNr LAPACK.orig/SRC/cgelss.f LAPACK/SRC/cgelss.f
  1136. --- LAPACK.orig/SRC/cgelss.f Thu Nov 4 14:24:09 1999
  1137. +++ LAPACK/SRC/cgelss.f Fri May 25 16:03:50 2001
  1138. @@ -4,7 +4,7 @@
  1139. * -- LAPACK driver routine (version 3.0) --
  1140. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  1141. * Courant Institute, Argonne National Lab, and Rice University
  1142. -* October 31, 1999
  1143. +* April 25, 2001
  1144. *
  1145. * .. Scalar Arguments ..
  1146. INTEGER INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
  1147. @@ -87,10 +87,9 @@
  1148. * LWORK >= 2*min(M,N) + max(M,N,NRHS)
  1149. * For good performance, LWORK should generally be larger.
  1150. *
  1151. -* If LWORK = -1, then a workspace query is assumed; the routine
  1152. -* only calculates the optimal size of the WORK array, returns
  1153. -* this value as the first entry of the WORK array, and no error
  1154. -* message related to LWORK is issued by XERBLA.
  1155. +* If LWORK = -1, a workspace query is assumed. The optimal
  1156. +* size for the WORK array is calculated and stored in WORK(1),
  1157. +* and no other work except argument checking is performed.
  1158. *
  1159. * RWORK (workspace) REAL array, dimension (5*min(M,N))
  1160. *
  1161. @@ -164,7 +163,7 @@
  1162. * immediately following subroutine, as returned by ILAENV.)
  1163. *
  1164. MINWRK = 1
  1165. - IF( INFO.EQ.0 .AND. ( LWORK.GE.1 .OR. LQUERY ) ) THEN
  1166. + IF( INFO.EQ.0 ) THEN
  1167. MAXWRK = 0
  1168. MM = M
  1169. IF( M.GE.N .AND. M.GE.MNTHR ) THEN
  1170. @@ -235,19 +234,18 @@
  1171. MINWRK = MAX( MINWRK, 1 )
  1172. MAXWRK = MAX( MINWRK, MAXWRK )
  1173. WORK( 1 ) = MAXWRK
  1174. + IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY )
  1175. + $ INFO = -12
  1176. END IF
  1177. *
  1178. - IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY )
  1179. - $ INFO = -12
  1180. +* Quick returns
  1181. +*
  1182. IF( INFO.NE.0 ) THEN
  1183. CALL XERBLA( 'CGELSS', -INFO )
  1184. RETURN
  1185. ELSE IF( LQUERY ) THEN
  1186. RETURN
  1187. END IF
  1188. -*
  1189. -* Quick return if possible
  1190. -*
  1191. IF( M.EQ.0 .OR. N.EQ.0 ) THEN
  1192. RANK = 0
  1193. RETURN
  1194. @@ -512,8 +510,8 @@
  1195. DO 40 I = 1, NRHS, CHUNK
  1196. BL = MIN( NRHS-I+1, CHUNK )
  1197. CALL CGEMM( 'C', 'N', M, BL, M, CONE, WORK( IL ), LDWORK,
  1198. - $ B( 1, I ), LDB, CZERO, WORK( IWORK ), N )
  1199. - CALL CLACPY( 'G', M, BL, WORK( IWORK ), N, B( 1, I ),
  1200. + $ B( 1, I ), LDB, CZERO, WORK( IWORK ), M )
  1201. + CALL CLACPY( 'G', M, BL, WORK( IWORK ), M, B( 1, I ),
  1202. $ LDB )
  1203. 40 CONTINUE
  1204. ELSE
  1205. diff -uNr LAPACK.orig/SRC/cgesdd.f LAPACK/SRC/cgesdd.f
  1206. --- LAPACK.orig/SRC/cgesdd.f Thu Nov 11 20:32:54 1999
  1207. +++ LAPACK/SRC/cgesdd.f Fri May 25 16:08:03 2001
  1208. @@ -1,10 +1,11 @@
  1209. - SUBROUTINE CGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK,
  1210. - $ LWORK, RWORK, IWORK, INFO )
  1211. + SUBROUTINE CGESDD( JOBZ, M, N, A, LDA, S, U, LDU, VT, LDVT,
  1212. + $ WORK, LWORK, RWORK, IWORK, INFO )
  1213. *
  1214. * -- LAPACK driver routine (version 3.0) --
  1215. * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  1216. * Courant Institute, Argonne National Lab, and Rice University
  1217. -* October 31, 1999
  1218. +* June 30, 1999
  1219. +* 8-15-00: Improve consistency of WS calculations (eca)
  1220. *
  1221. * .. Scalar Arguments ..
  1222. CHARACTER JOBZ
  1223. @@ -119,12 +120,14 @@
  1224. * if JOBZ = 'S' or 'A',
  1225. * LWORK >= min(M,N)*min(M,N)+2*min(M,N)+max(M,N).
  1226. * For good performance, LWORK should generally be larger.
  1227. -* If LWORK < 0 but other input arguments are legal, WORK(1)
  1228. -* returns the optimal LWORK.
  1229. +*
  1230. +* If LWORK = -1, a workspace query is assumed. The optimal
  1231. +* size for the WORK array is calculated and stored in WORK(1),
  1232. +* and no other work except argument checking is performed.
  1233. *
  1234. * RWORK (workspace) REAL array, dimension (LRWORK)
  1235. -* If JOBZ = 'N', LRWORK >= 7*min(M,N).
  1236. -* Otherwise, LRWORK >= 5*min(M,N)*min(M,N) + 5*min(M,N)
  1237. +* If JOBZ = 'N', LRWORK >= 5*min(M,N).
  1238. +* Otherwise, LRWORK >= 5*min(M,N)*min(M,N) + 7*min(M,N)
  1239. *
  1240. * IWORK (workspace) INTEGER array, dimension (8*min(M,N))
  1241. *
  1242. @@ -143,14 +146,16 @@
  1243. * =====================================================================
  1244. *
  1245. * .. Parameters ..
  1246. + INTEGER LQUERV
  1247. + PARAMETER ( LQUERV = -1 )
  1248. COMPLEX CZERO, CONE
  1249. - PARAMETER ( CZERO = ( 0.0E0, 0.0E0 ),
  1250. - $ CONE = ( 1.0E0, 0.0E0 ) )
  1251. + PARAMETER ( CZERO = ( 0.0E+0, 0.0E+0 ),
  1252. + $ CONE = ( 1.0E+0, 0.0E+0 ) )
  1253. REAL ZERO, ONE
  1254. - PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0 )
  1255. + PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
  1256. * ..
  1257. * .. Local Scalars ..
  1258. - LOGICAL LQUERY, WNTQA, WNTQAS, WNTQ

Large files files are truncated, but you can click here to view the full file