LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine cupgtr ( character  UPLO,
integer  N,
complex, dimension( * )  AP,
complex, dimension( * )  TAU,
complex, dimension( ldq, * )  Q,
integer  LDQ,
complex, dimension( * )  WORK,
integer  INFO 
)

CUPGTR

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

Purpose:
 CUPGTR generates a complex unitary matrix Q which is defined as the
 product of n-1 elementary reflectors H(i) of order n, as returned by
 CHPTRD using packed storage:

 if UPLO = 'U', Q = H(n-1) . . . H(2) H(1),

 if UPLO = 'L', Q = H(1) H(2) . . . H(n-1).
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          = 'U': Upper triangular packed storage used in previous
                 call to CHPTRD;
          = 'L': Lower triangular packed storage used in previous
                 call to CHPTRD.
[in]N
          N is INTEGER
          The order of the matrix Q. N >= 0.
[in]AP
          AP is COMPLEX array, dimension (N*(N+1)/2)
          The vectors which define the elementary reflectors, as
          returned by CHPTRD.
[in]TAU
          TAU is COMPLEX array, dimension (N-1)
          TAU(i) must contain the scalar factor of the elementary
          reflector H(i), as returned by CHPTRD.
[out]Q
          Q is COMPLEX array, dimension (LDQ,N)
          The N-by-N unitary matrix Q.
[in]LDQ
          LDQ is INTEGER
          The leading dimension of the array Q. LDQ >= max(1,N).
[out]WORK
          WORK is COMPLEX array, dimension (N-1)
[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.
Date
November 2011

Definition at line 116 of file cupgtr.f.

116 *
117 * -- LAPACK computational routine (version 3.4.0) --
118 * -- LAPACK is a software package provided by Univ. of Tennessee, --
119 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
120 * November 2011
121 *
122 * .. Scalar Arguments ..
123  CHARACTER uplo
124  INTEGER info, ldq, n
125 * ..
126 * .. Array Arguments ..
127  COMPLEX ap( * ), q( ldq, * ), tau( * ), work( * )
128 * ..
129 *
130 * =====================================================================
131 *
132 * .. Parameters ..
133  COMPLEX czero, cone
134  parameter ( czero = ( 0.0e+0, 0.0e+0 ),
135  $ cone = ( 1.0e+0, 0.0e+0 ) )
136 * ..
137 * .. Local Scalars ..
138  LOGICAL upper
139  INTEGER i, iinfo, ij, j
140 * ..
141 * .. External Functions ..
142  LOGICAL lsame
143  EXTERNAL lsame
144 * ..
145 * .. External Subroutines ..
146  EXTERNAL cung2l, cung2r, xerbla
147 * ..
148 * .. Intrinsic Functions ..
149  INTRINSIC max
150 * ..
151 * .. Executable Statements ..
152 *
153 * Test the input arguments
154 *
155  info = 0
156  upper = lsame( uplo, 'U' )
157  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
158  info = -1
159  ELSE IF( n.LT.0 ) THEN
160  info = -2
161  ELSE IF( ldq.LT.max( 1, n ) ) THEN
162  info = -6
163  END IF
164  IF( info.NE.0 ) THEN
165  CALL xerbla( 'CUPGTR', -info )
166  RETURN
167  END IF
168 *
169 * Quick return if possible
170 *
171  IF( n.EQ.0 )
172  $ RETURN
173 *
174  IF( upper ) THEN
175 *
176 * Q was determined by a call to CHPTRD with UPLO = 'U'
177 *
178 * Unpack the vectors which define the elementary reflectors and
179 * set the last row and column of Q equal to those of the unit
180 * matrix
181 *
182  ij = 2
183  DO 20 j = 1, n - 1
184  DO 10 i = 1, j - 1
185  q( i, j ) = ap( ij )
186  ij = ij + 1
187  10 CONTINUE
188  ij = ij + 2
189  q( n, j ) = czero
190  20 CONTINUE
191  DO 30 i = 1, n - 1
192  q( i, n ) = czero
193  30 CONTINUE
194  q( n, n ) = cone
195 *
196 * Generate Q(1:n-1,1:n-1)
197 *
198  CALL cung2l( n-1, n-1, n-1, q, ldq, tau, work, iinfo )
199 *
200  ELSE
201 *
202 * Q was determined by a call to CHPTRD with UPLO = 'L'.
203 *
204 * Unpack the vectors which define the elementary reflectors and
205 * set the first row and column of Q equal to those of the unit
206 * matrix
207 *
208  q( 1, 1 ) = cone
209  DO 40 i = 2, n
210  q( i, 1 ) = czero
211  40 CONTINUE
212  ij = 3
213  DO 60 j = 2, n
214  q( 1, j ) = czero
215  DO 50 i = j + 1, n
216  q( i, j ) = ap( ij )
217  ij = ij + 1
218  50 CONTINUE
219  ij = ij + 2
220  60 CONTINUE
221  IF( n.GT.1 ) THEN
222 *
223 * Generate Q(2:n,2:n)
224 *
225  CALL cung2r( n-1, n-1, n-1, q( 2, 2 ), ldq, tau, work,
226  $ iinfo )
227  END IF
228  END IF
229  RETURN
230 *
231 * End of CUPGTR
232 *
subroutine cung2r(M, N, K, A, LDA, TAU, WORK, INFO)
CUNG2R
Definition: cung2r.f:116
subroutine cung2l(M, N, K, A, LDA, TAU, WORK, INFO)
CUNG2L generates all or part of the unitary matrix Q from a QL factorization determined by cgeqlf (un...
Definition: cung2l.f:116
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: