3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CUPGTR + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cupgtr.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cupgtr.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cupgtr.f">
21 * SUBROUTINE CUPGTR( UPLO, N, AP, TAU, Q, LDQ, WORK, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, LDQ, N
27 * .. Array Arguments ..
28 * COMPLEX AP( * ), Q( LDQ, * ), TAU( * ), WORK( * )
37 *> CUPGTR generates a complex unitary matrix Q which is defined as the
38 *> product of n-1 elementary reflectors H(i) of order n, as returned by
39 *> CHPTRD using packed storage:
41 *> if UPLO = 'U', Q = H(n-1) . . . H(2) H(1),
43 *> if UPLO = 'L', Q = H(1) H(2) . . . H(n-1).
51 *> UPLO is CHARACTER*1
52 *> = 'U': Upper triangular packed storage used in previous
54 *> = 'L': Lower triangular packed storage used in previous
61 *> The order of the matrix Q. N >= 0.
66 *> AP is COMPLEX array, dimension (N*(N+1)/2)
67 *> The vectors which define the elementary reflectors, as
68 *> returned by CHPTRD.
73 *> TAU is COMPLEX array, dimension (N-1)
74 *> TAU(i) must contain the scalar factor of the elementary
75 *> reflector H(i), as returned by CHPTRD.
80 *> Q is COMPLEX array, dimension (LDQ,N)
81 *> The N-by-N unitary matrix Q.
87 *> The leading dimension of the array Q. LDQ >= max(1,N).
92 *> WORK is COMPLEX array, dimension (N-1)
98 *> = 0: successful exit
99 *> < 0: if INFO = -i, the i-th argument had an illegal value
105 *> \author Univ. of Tennessee
106 *> \author Univ. of California Berkeley
107 *> \author Univ. of Colorado Denver
110 *> \date November 2011
112 *> \ingroup complexOTHERcomputational
114 * =====================================================================
115 SUBROUTINE CUPGTR( UPLO, N, AP, TAU, Q, LDQ, WORK, INFO )
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..--
122 * .. Scalar Arguments ..
126 * .. Array Arguments ..
127 COMPLEX AP( * ), Q( LDQ, * ), TAU( * ), WORK( * )
130 * =====================================================================
134 PARAMETER ( CZERO = ( 0.0E+0, 0.0E+0 ),
135 $ CONE = ( 1.0E+0, 0.0E+0 ) )
137 * .. Local Scalars ..
139 INTEGER I, IINFO, IJ, J
141 * .. External Functions ..
145 * .. External Subroutines ..
146 EXTERNAL CUNG2L, CUNG2R, XERBLA
148 * .. Intrinsic Functions ..
151 * .. Executable Statements ..
153 * Test the input arguments
156 UPPER = LSAME( UPLO, 'U' )
157 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
159 ELSE IF( N.LT.0 ) THEN
161 ELSE IF( LDQ.LT.MAX( 1, N ) ) THEN
165 CALL XERBLA( 'CUPGTR', -INFO )
169 * Quick return if possible
176 * Q was determined by a call to CHPTRD with UPLO = 'U'
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
196 * Generate Q(1:n-1,1:n-1)
198 CALL CUNG2L( N-1, N-1, N-1, Q, LDQ, TAU, WORK, IINFO )
202 * Q was determined by a call to CHPTRD with UPLO = 'L'.
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
223 * Generate Q(2:n,2:n)
225 CALL CUNG2R( N-1, N-1, N-1, Q( 2, 2 ), LDQ, TAU, WORK,