1 *> \brief \b CLARZT forms the triangular factor T of a block reflector H = I - vtvH.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CLARZT + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clarzt.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clarzt.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clarzt.f">
21 * SUBROUTINE CLARZT( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
23 * .. Scalar Arguments ..
24 * CHARACTER DIRECT, STOREV
25 * INTEGER K, LDT, LDV, N
27 * .. Array Arguments ..
28 * COMPLEX T( LDT, * ), TAU( * ), V( LDV, * )
37 *> CLARZT forms the triangular factor T of a complex block reflector
38 *> H of order > n, which is defined as a product of k elementary
41 *> If DIRECT = 'F', H = H(1) H(2) . . . H(k) and T is upper triangular;
43 *> If DIRECT = 'B', H = H(k) . . . H(2) H(1) and T is lower triangular.
45 *> If STOREV = 'C', the vector which defines the elementary reflector
46 *> H(i) is stored in the i-th column of the array V, and
48 *> H = I - V * T * V**H
50 *> If STOREV = 'R', the vector which defines the elementary reflector
51 *> H(i) is stored in the i-th row of the array V, and
53 *> H = I - V**H * T * V
55 *> Currently, only STOREV = 'R' and DIRECT = 'B' are supported.
63 *> DIRECT is CHARACTER*1
64 *> Specifies the order in which the elementary reflectors are
65 *> multiplied to form the block reflector:
66 *> = 'F': H = H(1) H(2) . . . H(k) (Forward, not supported yet)
67 *> = 'B': H = H(k) . . . H(2) H(1) (Backward)
72 *> STOREV is CHARACTER*1
73 *> Specifies how the vectors which define the elementary
74 *> reflectors are stored (see also Further Details):
75 *> = 'C': columnwise (not supported yet)
82 *> The order of the block reflector H. N >= 0.
88 *> The order of the triangular factor T (= the number of
89 *> elementary reflectors). K >= 1.
94 *> V is COMPLEX array, dimension
95 *> (LDV,K) if STOREV = 'C'
96 *> (LDV,N) if STOREV = 'R'
97 *> The matrix V. See further details.
103 *> The leading dimension of the array V.
104 *> If STOREV = 'C', LDV >= max(1,N); if STOREV = 'R', LDV >= K.
109 *> TAU is COMPLEX array, dimension (K)
110 *> TAU(i) must contain the scalar factor of the elementary
116 *> T is COMPLEX array, dimension (LDT,K)
117 *> The k by k triangular factor T of the block reflector.
118 *> If DIRECT = 'F', T is upper triangular; if DIRECT = 'B', T is
119 *> lower triangular. The rest of the array is not used.
125 *> The leading dimension of the array T. LDT >= K.
131 *> \author Univ. of Tennessee
132 *> \author Univ. of California Berkeley
133 *> \author Univ. of Colorado Denver
136 *> \date September 2012
138 *> \ingroup complexOTHERcomputational
140 *> \par Contributors:
143 *> A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
145 *> \par Further Details:
146 * =====================
150 *> The shape of the matrix V and the storage of the vectors which define
151 *> the H(i) is best illustrated by the following example with n = 5 and
152 *> k = 3. The elements equal to 1 are not stored; the corresponding
153 *> array elements are modified but restored on exit. The rest of the
154 *> array is not used.
156 *> DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R':
160 *> ( v1 v2 v3 ) ( v1 v1 v1 v1 v1 . . . . 1 )
161 *> V = ( v1 v2 v3 ) ( v2 v2 v2 v2 v2 . . . 1 )
162 *> ( v1 v2 v3 ) ( v3 v3 v3 v3 v3 . . 1 )
170 *> DIRECT = 'B' and STOREV = 'C': DIRECT = 'B' and STOREV = 'R':
174 *> . 1 ( 1 . . . . v1 v1 v1 v1 v1 )
175 *> . . 1 ( . 1 . . . v2 v2 v2 v2 v2 )
176 *> . . . ( . . 1 . . v3 v3 v3 v3 v3 )
185 * =====================================================================
186 SUBROUTINE CLARZT( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
188 * -- LAPACK computational routine (version 3.4.2) --
189 * -- LAPACK is a software package provided by Univ. of Tennessee, --
190 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
193 * .. Scalar Arguments ..
194 CHARACTER DIRECT, STOREV
195 INTEGER K, LDT, LDV, N
197 * .. Array Arguments ..
198 COMPLEX T( LDT, * ), TAU( * ), V( LDV, * )
201 * =====================================================================
205 PARAMETER ( ZERO = ( 0.0E+0, 0.0E+0 ) )
207 * .. Local Scalars ..
210 * .. External Subroutines ..
211 EXTERNAL CGEMV, CLACGV, CTRMV, XERBLA
213 * .. External Functions ..
217 * .. Executable Statements ..
219 * Check for currently supported options
222 IF( .NOT.LSAME( DIRECT, 'B' ) ) THEN
224 ELSE IF( .NOT.LSAME( STOREV, 'R' ) ) THEN
228 CALL XERBLA( 'CLARZT', -INFO )
233 IF( TAU( I ).EQ.ZERO ) THEN
246 * T(i+1:k,i) = - tau(i) * V(i+1:k,1:n) * V(i,1:n)**H
248 CALL CLACGV( N, V( I, 1 ), LDV )
249 CALL CGEMV( 'No transpose', K-I, N, -TAU( I ),
250 $ V( I+1, 1 ), LDV, V( I, 1 ), LDV, ZERO,
252 CALL CLACGV( N, V( I, 1 ), LDV )
254 * T(i+1:k,i) = T(i+1:k,i+1:k) * T(i+1:k,i)
256 CALL CTRMV( 'Lower', 'No transpose', 'Non-unit', K-I,
257 $ T( I+1, I+1 ), LDT, T( I+1, I ), 1 )