3
* =========== DOCUMENTATION ===========
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
9
*> Download CHETRD + dependencies
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/chetrd.f">
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/chetrd.f">
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chetrd.f">
21
* SUBROUTINE CHETRD( UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO )
23
* .. Scalar Arguments ..
25
* INTEGER INFO, LDA, LWORK, N
27
* .. Array Arguments ..
29
* COMPLEX A( LDA, * ), TAU( * ), WORK( * )
38
*> CHETRD reduces a complex Hermitian matrix A to real symmetric
39
*> tridiagonal form T by a unitary similarity transformation:
48
*> UPLO is CHARACTER*1
49
*> = 'U': Upper triangle of A is stored;
50
*> = 'L': Lower triangle of A is stored.
56
*> The order of the matrix A. N >= 0.
61
*> A is COMPLEX array, dimension (LDA,N)
62
*> On entry, the Hermitian matrix A. If UPLO = 'U', the leading
63
*> N-by-N upper triangular part of A contains the upper
64
*> triangular part of the matrix A, and the strictly lower
65
*> triangular part of A is not referenced. If UPLO = 'L', the
66
*> leading N-by-N lower triangular part of A contains the lower
67
*> triangular part of the matrix A, and the strictly upper
68
*> triangular part of A is not referenced.
69
*> On exit, if UPLO = 'U', the diagonal and first superdiagonal
70
*> of A are overwritten by the corresponding elements of the
71
*> tridiagonal matrix T, and the elements above the first
72
*> superdiagonal, with the array TAU, represent the unitary
73
*> matrix Q as a product of elementary reflectors; if UPLO
74
*> = 'L', the diagonal and first subdiagonal of A are over-
75
*> written by the corresponding elements of the tridiagonal
76
*> matrix T, and the elements below the first subdiagonal, with
77
*> the array TAU, represent the unitary matrix Q as a product
78
*> of elementary reflectors. See Further Details.
84
*> The leading dimension of the array A. LDA >= max(1,N).
89
*> D is REAL array, dimension (N)
90
*> The diagonal elements of the tridiagonal matrix T:
96
*> E is REAL array, dimension (N-1)
97
*> The off-diagonal elements of the tridiagonal matrix T:
98
*> E(i) = A(i,i+1) if UPLO = 'U', E(i) = A(i+1,i) if UPLO = 'L'.
103
*> TAU is COMPLEX array, dimension (N-1)
104
*> The scalar factors of the elementary reflectors (see Further
110
*> WORK is COMPLEX array, dimension (MAX(1,LWORK))
111
*> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
117
*> The dimension of the array WORK. LWORK >= 1.
118
*> For optimum performance LWORK >= N*NB, where NB is the
119
*> optimal blocksize.
121
*> If LWORK = -1, then a workspace query is assumed; the routine
122
*> only calculates the optimal size of the WORK array, returns
123
*> this value as the first entry of the WORK array, and no error
124
*> message related to LWORK is issued by XERBLA.
130
*> = 0: successful exit
131
*> < 0: if INFO = -i, the i-th argument had an illegal value
137
*> \author Univ. of Tennessee
138
*> \author Univ. of California Berkeley
139
*> \author Univ. of Colorado Denver
142
*> \date November 2011
144
*> \ingroup complexHEcomputational
146
*> \par Further Details:
147
* =====================
151
*> If UPLO = 'U', the matrix Q is represented as a product of elementary
154
*> Q = H(n-1) . . . H(2) H(1).
156
*> Each H(i) has the form
158
*> H(i) = I - tau * v * v**H
160
*> where tau is a complex scalar, and v is a complex vector with
161
*> v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in
162
*> A(1:i-1,i+1), and tau in TAU(i).
164
*> If UPLO = 'L', the matrix Q is represented as a product of elementary
167
*> Q = H(1) H(2) . . . H(n-1).
169
*> Each H(i) has the form
171
*> H(i) = I - tau * v * v**H
173
*> where tau is a complex scalar, and v is a complex vector with
174
*> v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i),
175
*> and tau in TAU(i).
177
*> The contents of A on exit are illustrated by the following examples
180
*> if UPLO = 'U': if UPLO = 'L':
182
*> ( d e v2 v3 v4 ) ( d )
183
*> ( d e v3 v4 ) ( e d )
184
*> ( d e v4 ) ( v1 e d )
185
*> ( d e ) ( v1 v2 e d )
186
*> ( d ) ( v1 v2 v3 e d )
188
*> where d and e denote diagonal and off-diagonal elements of T, and vi
189
*> denotes an element of the vector defining H(i).
192
* =====================================================================
1
193
SUBROUTINE CHETRD( UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO )
3
* -- LAPACK routine (version 2.0) --
4
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5
* Courant Institute, Argonne National Lab, and Rice University
195
* -- LAPACK computational routine (version 3.4.0) --
196
* -- LAPACK is a software package provided by Univ. of Tennessee, --
197
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
8
200
* .. Scalar Arguments ..
14
206
COMPLEX A( LDA, * ), TAU( * ), WORK( * )
18
* $Id: chetrd.f 19697 2010-10-29 16:57:34Z d3y133 $
23
* CHETRD reduces a complex Hermitian matrix A to real symmetric
24
* tridiagonal form T by a unitary similarity transformation:
30
* UPLO (input) CHARACTER*1
31
* = 'U': Upper triangle of A is stored;
32
* = 'L': Lower triangle of A is stored.
35
* The order of the matrix A. N >= 0.
37
* A (input/output) COMPLEX array, dimension (LDA,N)
38
* On entry, the Hermitian matrix A. If UPLO = 'U', the leading
39
* N-by-N upper triangular part of A contains the upper
40
* triangular part of the matrix A, and the strictly lower
41
* triangular part of A is not referenced. If UPLO = 'L', the
42
* leading N-by-N lower triangular part of A contains the lower
43
* triangular part of the matrix A, and the strictly upper
44
* triangular part of A is not referenced.
45
* On exit, if UPLO = 'U', the diagonal and first superdiagonal
46
* of A are overwritten by the corresponding elements of the
47
* tridiagonal matrix T, and the elements above the first
48
* superdiagonal, with the array TAU, represent the unitary
49
* matrix Q as a product of elementary reflectors; if UPLO
50
* = 'L', the diagonal and first subdiagonal of A are over-
51
* written by the corresponding elements of the tridiagonal
52
* matrix T, and the elements below the first subdiagonal, with
53
* the array TAU, represent the unitary matrix Q as a product
54
* of elementary reflectors. See Further Details.
57
* The leading dimension of the array A. LDA >= max(1,N).
59
* D (output) REAL array, dimension (N)
60
* The diagonal elements of the tridiagonal matrix T:
63
* E (output) REAL array, dimension (N-1)
64
* The off-diagonal elements of the tridiagonal matrix T:
65
* E(i) = A(i,i+1) if UPLO = 'U', E(i) = A(i+1,i) if UPLO = 'L'.
67
* TAU (output) COMPLEX array, dimension (N-1)
68
* The scalar factors of the elementary reflectors (see Further
71
* WORK (workspace/output) COMPLEX array, dimension (LWORK)
72
* On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
74
* LWORK (input) INTEGER
75
* The dimension of the array WORK. LWORK >= 1.
76
* For optimum performance LWORK >= N*NB, where NB is the
79
* INFO (output) INTEGER
80
* = 0: successful exit
81
* < 0: if INFO = -i, the i-th argument had an illegal value
86
* If UPLO = 'U', the matrix Q is represented as a product of elementary
89
* Q = H(n-1) . . . H(2) H(1).
91
* Each H(i) has the form
93
* H(i) = I - tau * v * v'
95
* where tau is a complex scalar, and v is a complex vector with
96
* v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in
97
* A(1:i-1,i+1), and tau in TAU(i).
99
* If UPLO = 'L', the matrix Q is represented as a product of elementary
102
* Q = H(1) H(2) . . . H(n-1).
104
* Each H(i) has the form
106
* H(i) = I - tau * v * v'
108
* where tau is a complex scalar, and v is a complex vector with
109
* v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i),
112
* The contents of A on exit are illustrated by the following examples
115
* if UPLO = 'U': if UPLO = 'L':
117
* ( d e v2 v3 v4 ) ( d )
118
* ( d e v3 v4 ) ( e d )
119
* ( d e v4 ) ( v1 e d )
120
* ( d e ) ( v1 v2 e d )
121
* ( d ) ( v1 v2 v3 e d )
123
* where d and e denote diagonal and off-diagonal elements of T, and vi
124
* denotes an element of the vector defining H(i).
126
209
* =====================================================================
128
211
* .. Parameters ..