LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ zhegst()

subroutine zhegst ( integer  ITYPE,
character  UPLO,
integer  N,
complex*16, dimension( lda, * )  A,
integer  LDA,
complex*16, dimension( ldb, * )  B,
integer  LDB,
integer  INFO 
)

ZHEGST

Download ZHEGST + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 ZHEGST reduces a complex Hermitian-definite generalized
 eigenproblem to standard form.

 If ITYPE = 1, the problem is A*x = lambda*B*x,
 and A is overwritten by inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H)

 If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or
 B*A*x = lambda*x, and A is overwritten by U*A*U**H or L**H*A*L.

 B must have been previously factorized as U**H*U or L*L**H by ZPOTRF.
Parameters
[in]ITYPE
          ITYPE is INTEGER
          = 1: compute inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H);
          = 2 or 3: compute U*A*U**H or L**H*A*L.
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  Upper triangle of A is stored and B is factored as
                  U**H*U;
          = 'L':  Lower triangle of A is stored and B is factored as
                  L*L**H.
[in]N
          N is INTEGER
          The order of the matrices A and B.  N >= 0.
[in,out]A
          A is COMPLEX*16 array, dimension (LDA,N)
          On entry, the Hermitian matrix A.  If UPLO = 'U', the leading
          N-by-N upper triangular part of A contains the upper
          triangular part of the matrix A, and the strictly lower
          triangular part of A is not referenced.  If UPLO = 'L', the
          leading N-by-N lower triangular part of A contains the lower
          triangular part of the matrix A, and the strictly upper
          triangular part of A is not referenced.

          On exit, if INFO = 0, the transformed matrix, stored in the
          same format as A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[in,out]B
          B is COMPLEX*16 array, dimension (LDB,N)
          The triangular factor from the Cholesky factorization of B,
          as returned by ZPOTRF.
          B is modified by the routine but restored on exit.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 127 of file zhegst.f.

128 *
129 * -- LAPACK computational routine --
130 * -- LAPACK is a software package provided by Univ. of Tennessee, --
131 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
132 *
133 * .. Scalar Arguments ..
134  CHARACTER UPLO
135  INTEGER INFO, ITYPE, LDA, LDB, N
136 * ..
137 * .. Array Arguments ..
138  COMPLEX*16 A( LDA, * ), B( LDB, * )
139 * ..
140 *
141 * =====================================================================
142 *
143 * .. Parameters ..
144  DOUBLE PRECISION ONE
145  parameter( one = 1.0d+0 )
146  COMPLEX*16 CONE, HALF
147  parameter( cone = ( 1.0d+0, 0.0d+0 ),
148  $ half = ( 0.5d+0, 0.0d+0 ) )
149 * ..
150 * .. Local Scalars ..
151  LOGICAL UPPER
152  INTEGER K, KB, NB
153 * ..
154 * .. External Subroutines ..
155  EXTERNAL xerbla, zhegs2, zhemm, zher2k, ztrmm, ztrsm
156 * ..
157 * .. Intrinsic Functions ..
158  INTRINSIC max, min
159 * ..
160 * .. External Functions ..
161  LOGICAL LSAME
162  INTEGER ILAENV
163  EXTERNAL lsame, ilaenv
164 * ..
165 * .. Executable Statements ..
166 *
167 * Test the input parameters.
168 *
169  info = 0
170  upper = lsame( uplo, 'U' )
171  IF( itype.LT.1 .OR. itype.GT.3 ) THEN
172  info = -1
173  ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
174  info = -2
175  ELSE IF( n.LT.0 ) THEN
176  info = -3
177  ELSE IF( lda.LT.max( 1, n ) ) THEN
178  info = -5
179  ELSE IF( ldb.LT.max( 1, n ) ) THEN
180  info = -7
181  END IF
182  IF( info.NE.0 ) THEN
183  CALL xerbla( 'ZHEGST', -info )
184  RETURN
185  END IF
186 *
187 * Quick return if possible
188 *
189  IF( n.EQ.0 )
190  $ RETURN
191 *
192 * Determine the block size for this environment.
193 *
194  nb = ilaenv( 1, 'ZHEGST', uplo, n, -1, -1, -1 )
195 *
196  IF( nb.LE.1 .OR. nb.GE.n ) THEN
197 *
198 * Use unblocked code
199 *
200  CALL zhegs2( itype, uplo, n, a, lda, b, ldb, info )
201  ELSE
202 *
203 * Use blocked code
204 *
205  IF( itype.EQ.1 ) THEN
206  IF( upper ) THEN
207 *
208 * Compute inv(U**H)*A*inv(U)
209 *
210  DO 10 k = 1, n, nb
211  kb = min( n-k+1, nb )
212 *
213 * Update the upper triangle of A(k:n,k:n)
214 *
215  CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
216  $ b( k, k ), ldb, info )
217  IF( k+kb.LE.n ) THEN
218  CALL ztrsm( 'Left', uplo, 'Conjugate transpose',
219  $ 'Non-unit', kb, n-k-kb+1, cone,
220  $ b( k, k ), ldb, a( k, k+kb ), lda )
221  CALL zhemm( 'Left', uplo, kb, n-k-kb+1, -half,
222  $ a( k, k ), lda, b( k, k+kb ), ldb,
223  $ cone, a( k, k+kb ), lda )
224  CALL zher2k( uplo, 'Conjugate transpose', n-k-kb+1,
225  $ kb, -cone, a( k, k+kb ), lda,
226  $ b( k, k+kb ), ldb, one,
227  $ a( k+kb, k+kb ), lda )
228  CALL zhemm( 'Left', uplo, kb, n-k-kb+1, -half,
229  $ a( k, k ), lda, b( k, k+kb ), ldb,
230  $ cone, a( k, k+kb ), lda )
231  CALL ztrsm( 'Right', uplo, 'No transpose',
232  $ 'Non-unit', kb, n-k-kb+1, cone,
233  $ b( k+kb, k+kb ), ldb, a( k, k+kb ),
234  $ lda )
235  END IF
236  10 CONTINUE
237  ELSE
238 *
239 * Compute inv(L)*A*inv(L**H)
240 *
241  DO 20 k = 1, n, nb
242  kb = min( n-k+1, nb )
243 *
244 * Update the lower triangle of A(k:n,k:n)
245 *
246  CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
247  $ b( k, k ), ldb, info )
248  IF( k+kb.LE.n ) THEN
249  CALL ztrsm( 'Right', uplo, 'Conjugate transpose',
250  $ 'Non-unit', n-k-kb+1, kb, cone,
251  $ b( k, k ), ldb, a( k+kb, k ), lda )
252  CALL zhemm( 'Right', uplo, n-k-kb+1, kb, -half,
253  $ a( k, k ), lda, b( k+kb, k ), ldb,
254  $ cone, a( k+kb, k ), lda )
255  CALL zher2k( uplo, 'No transpose', n-k-kb+1, kb,
256  $ -cone, a( k+kb, k ), lda,
257  $ b( k+kb, k ), ldb, one,
258  $ a( k+kb, k+kb ), lda )
259  CALL zhemm( 'Right', uplo, n-k-kb+1, kb, -half,
260  $ a( k, k ), lda, b( k+kb, k ), ldb,
261  $ cone, a( k+kb, k ), lda )
262  CALL ztrsm( 'Left', uplo, 'No transpose',
263  $ 'Non-unit', n-k-kb+1, kb, cone,
264  $ b( k+kb, k+kb ), ldb, a( k+kb, k ),
265  $ lda )
266  END IF
267  20 CONTINUE
268  END IF
269  ELSE
270  IF( upper ) THEN
271 *
272 * Compute U*A*U**H
273 *
274  DO 30 k = 1, n, nb
275  kb = min( n-k+1, nb )
276 *
277 * Update the upper triangle of A(1:k+kb-1,1:k+kb-1)
278 *
279  CALL ztrmm( 'Left', uplo, 'No transpose', 'Non-unit',
280  $ k-1, kb, cone, b, ldb, a( 1, k ), lda )
281  CALL zhemm( 'Right', uplo, k-1, kb, half, a( k, k ),
282  $ lda, b( 1, k ), ldb, cone, a( 1, k ),
283  $ lda )
284  CALL zher2k( uplo, 'No transpose', k-1, kb, cone,
285  $ a( 1, k ), lda, b( 1, k ), ldb, one, a,
286  $ lda )
287  CALL zhemm( 'Right', uplo, k-1, kb, half, a( k, k ),
288  $ lda, b( 1, k ), ldb, cone, a( 1, k ),
289  $ lda )
290  CALL ztrmm( 'Right', uplo, 'Conjugate transpose',
291  $ 'Non-unit', k-1, kb, cone, b( k, k ), ldb,
292  $ a( 1, k ), lda )
293  CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
294  $ b( k, k ), ldb, info )
295  30 CONTINUE
296  ELSE
297 *
298 * Compute L**H*A*L
299 *
300  DO 40 k = 1, n, nb
301  kb = min( n-k+1, nb )
302 *
303 * Update the lower triangle of A(1:k+kb-1,1:k+kb-1)
304 *
305  CALL ztrmm( 'Right', uplo, 'No transpose', 'Non-unit',
306  $ kb, k-1, cone, b, ldb, a( k, 1 ), lda )
307  CALL zhemm( 'Left', uplo, kb, k-1, half, a( k, k ),
308  $ lda, b( k, 1 ), ldb, cone, a( k, 1 ),
309  $ lda )
310  CALL zher2k( uplo, 'Conjugate transpose', k-1, kb,
311  $ cone, a( k, 1 ), lda, b( k, 1 ), ldb,
312  $ one, a, lda )
313  CALL zhemm( 'Left', uplo, kb, k-1, half, a( k, k ),
314  $ lda, b( k, 1 ), ldb, cone, a( k, 1 ),
315  $ lda )
316  CALL ztrmm( 'Left', uplo, 'Conjugate transpose',
317  $ 'Non-unit', kb, k-1, cone, b( k, k ), ldb,
318  $ a( k, 1 ), lda )
319  CALL zhegs2( itype, uplo, kb, a( k, k ), lda,
320  $ b( k, k ), ldb, info )
321  40 CONTINUE
322  END IF
323  END IF
324  END IF
325  RETURN
326 *
327 * End of ZHEGST
328 *
integer function ilaenv(ISPEC, NAME, OPTS, N1, N2, N3, N4)
ILAENV
Definition: ilaenv.f:162
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine zhemm(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZHEMM
Definition: zhemm.f:191
subroutine zher2k(UPLO, TRANS, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZHER2K
Definition: zher2k.f:198
subroutine ztrsm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
ZTRSM
Definition: ztrsm.f:180
subroutine ztrmm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
ZTRMM
Definition: ztrmm.f:177
subroutine zhegs2(ITYPE, UPLO, N, A, LDA, B, LDB, INFO)
ZHEGS2 reduces a Hermitian definite generalized eigenproblem to standard form, using the factorizatio...
Definition: zhegs2.f:128
Here is the call graph for this function:
Here is the caller graph for this function: