1CHEGVD(1) LAPACK driver routine (version 3.1) CHEGVD(1)
2
3
4
6 CHEGVD - all the eigenvalues, and optionally, the eigenvectors of a
7 complex generalized Hermitian-definite eigenproblem, of the form
8 A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x
9
11 SUBROUTINE CHEGVD( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,
12 LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO )
13
14 CHARACTER JOBZ, UPLO
15
16 INTEGER INFO, ITYPE, LDA, LDB, LIWORK, LRWORK, LWORK, N
17
18 INTEGER IWORK( * )
19
20 REAL RWORK( * ), W( * )
21
22 COMPLEX A( LDA, * ), B( LDB, * ), WORK( * )
23
25 CHEGVD computes all the eigenvalues, and optionally, the eigenvectors
26 of a complex generalized Hermitian-definite eigenproblem, of the form
27 A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and B
28 are assumed to be Hermitian and B is also positive definite. If eigen‐
29 vectors are desired, it uses a divide and conquer algorithm.
30
31 The divide and conquer algorithm makes very mild assumptions about
32 floating point arithmetic. It will work on machines with a guard digit
33 in add/subtract, or on those binary machines without guard digits which
34 subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could
35 conceivably fail on hexadecimal or decimal machines without guard dig‐
36 its, but we know of none.
37
38
40 ITYPE (input) INTEGER
41 Specifies the problem type to be solved:
42 = 1: A*x = (lambda)*B*x
43 = 2: A*B*x = (lambda)*x
44 = 3: B*A*x = (lambda)*x
45
46 JOBZ (input) CHARACTER*1
47 = 'N': Compute eigenvalues only;
48 = 'V': Compute eigenvalues and eigenvectors.
49
50 UPLO (input) CHARACTER*1
51 = 'U': Upper triangles of A and B are stored;
52 = 'L': Lower triangles of A and B are stored.
53
54 N (input) INTEGER
55 The order of the matrices A and B. N >= 0.
56
57 A (input/output) COMPLEX array, dimension (LDA, N)
58 On entry, the Hermitian matrix A. If UPLO = 'U', the leading
59 N-by-N upper triangular part of A contains the upper triangular
60 part of the matrix A. If UPLO = 'L', the leading N-by-N lower
61 triangular part of A contains the lower triangular part of the
62 matrix A.
63
64 On exit, if JOBZ = 'V', then if INFO = 0, A contains the matrix
65 Z of eigenvectors. The eigenvectors are normalized as follows:
66 if ITYPE = 1 or 2, Z**H*B*Z = I; if ITYPE = 3, Z**H*inv(B)*Z =
67 I. If JOBZ = 'N', then on exit the upper triangle (if
68 UPLO='U') or the lower triangle (if UPLO='L') of A, including
69 the diagonal, is destroyed.
70
71 LDA (input) INTEGER
72 The leading dimension of the array A. LDA >= max(1,N).
73
74 B (input/output) COMPLEX array, dimension (LDB, N)
75 On entry, the Hermitian matrix B. If UPLO = 'U', the leading
76 N-by-N upper triangular part of B contains the upper triangular
77 part of the matrix B. If UPLO = 'L', the leading N-by-N lower
78 triangular part of B contains the lower triangular part of the
79 matrix B.
80
81 On exit, if INFO <= N, the part of B containing the matrix is
82 overwritten by the triangular factor U or L from the Cholesky
83 factorization B = U**H*U or B = L*L**H.
84
85 LDB (input) INTEGER
86 The leading dimension of the array B. LDB >= max(1,N).
87
88 W (output) REAL array, dimension (N)
89 If INFO = 0, the eigenvalues in ascending order.
90
91 WORK (workspace/output) COMPLEX array, dimension (MAX(1,LWORK))
92 On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
93
94 LWORK (input) INTEGER
95 The length of the array WORK. If N <= 1, LWORK
96 >= 1. If JOBZ = 'N' and N > 1, LWORK >= N + 1. If JOBZ =
97 'V' and N > 1, LWORK >= 2*N + N**2.
98
99 If LWORK = -1, then a workspace query is assumed; the routine
100 only calculates the optimal sizes of the WORK, RWORK and IWORK
101 arrays, returns these values as the first entries of the WORK,
102 RWORK and IWORK arrays, and no error message related to LWORK
103 or LRWORK or LIWORK is issued by XERBLA.
104
105 RWORK (workspace/output) REAL array, dimension (MAX(1,LRWORK))
106 On exit, if INFO = 0, RWORK(1) returns the optimal LRWORK.
107
108 LRWORK (input) INTEGER
109 The dimension of the array RWORK. If N <= 1,
110 LRWORK >= 1. If JOBZ = 'N' and N > 1, LRWORK >= N. If JOBZ
111 = 'V' and N > 1, LRWORK >= 1 + 5*N + 2*N**2.
112
113 If LRWORK = -1, then a workspace query is assumed; the routine
114 only calculates the optimal sizes of the WORK, RWORK and IWORK
115 arrays, returns these values as the first entries of the WORK,
116 RWORK and IWORK arrays, and no error message related to LWORK
117 or LRWORK or LIWORK is issued by XERBLA.
118
119 IWORK (workspace/output) INTEGER array, dimension (MAX(1,LIWORK))
120 On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
121
122 LIWORK (input) INTEGER
123 The dimension of the array IWORK. If N <= 1,
124 LIWORK >= 1. If JOBZ = 'N' and N > 1, LIWORK >= 1. If JOBZ
125 = 'V' and N > 1, LIWORK >= 3 + 5*N.
126
127 If LIWORK = -1, then a workspace query is assumed; the routine
128 only calculates the optimal sizes of the WORK, RWORK and IWORK
129 arrays, returns these values as the first entries of the WORK,
130 RWORK and IWORK arrays, and no error message related to LWORK
131 or LRWORK or LIWORK is issued by XERBLA.
132
133 INFO (output) INTEGER
134 = 0: successful exit
135 < 0: if INFO = -i, the i-th argument had an illegal value
136 > 0: CPOTRF or CHEEVD returned an error code:
137 <= N: if INFO = i and JOBZ = 'N', then the algorithm failed to
138 converge; i off-diagonal elements of an intermediate tridiago‐
139 nal form did not converge to zero; if INFO = i and JOBZ = 'V',
140 then the algorithm failed to compute an eigenvalue while work‐
141 ing on the submatrix lying in rows and columns INFO/(N+1)
142 through mod(INFO,N+1); > N: if INFO = N + i, for 1 <= i <= N,
143 then the leading minor of order i of B is not positive defi‐
144 nite. The factorization of B could not be completed and no ei‐
145 genvalues or eigenvectors were computed.
146
148 Based on contributions by
149 Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
150
151 Modified so that no backsubstitution is performed if CHEEVD fails to
152 converge (NEIG in old code could be greater than N causing out of
153 bounds reference to A - reported by Ralf Meyer). Also corrected the
154 description of INFO and the test on ITYPE. Sven, 16 Feb 05.
155
156
157
158 LAPACK driver routine (version 3.N1o)vember 2006 CHEGVD(1)