1
SUBROUTINE ZLARFT( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
4
* -- LAPACK auxiliary routine (version 3.2) --
5
* -- LAPACK is a software package provided by Univ. of Tennessee, --
6
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
9
* .. Scalar Arguments ..
10
CHARACTER DIRECT, STOREV
11
INTEGER K, LDT, LDV, N
13
* .. Array Arguments ..
14
COMPLEX*16 T( LDT, * ), TAU( * ), V( LDV, * )
20
* ZLARFT forms the triangular factor T of a COMPLEX*16 block reflector H
21
* of order n, which is defined as a product of k elementary reflectors.
23
* If DIRECT = 'F', H = H(1) H(2) . . . H(k) and T is upper triangular;
25
* If DIRECT = 'B', H = H(k) . . . H(2) H(1) and T is lower triangular.
27
* If STOREV = 'C', the vector which defines the elementary reflector
28
* H(i) is stored in the i-th column of the array V, and
30
* H = I - V * T * V**H
32
* If STOREV = 'R', the vector which defines the elementary reflector
33
* H(i) is stored in the i-th row of the array V, and
35
* H = I - V**H * T * V
40
* DIRECT (input) CHARACTER*1
41
* Specifies the order in which the elementary reflectors are
42
* multiplied to form the block reflector:
43
* = 'F': H = H(1) H(2) . . . H(k) (Forward)
44
* = 'B': H = H(k) . . . H(2) H(1) (Backward)
46
* STOREV (input) CHARACTER*1
47
* Specifies how the vectors which define the elementary
48
* reflectors are stored (see also Further Details):
53
* The order of the block reflector H. N >= 0.
56
* The order of the triangular factor T (= the number of
57
* elementary reflectors). K >= 1.
59
* V (input/output) COMPLEX*16 array, dimension
60
* (LDV,K) if STOREV = 'C'
61
* (LDV,N) if STOREV = 'R'
62
* The matrix V. See further details.
65
* The leading dimension of the array V.
66
* If STOREV = 'C', LDV >= max(1,N); if STOREV = 'R', LDV >= K.
68
* TAU (input) COMPLEX*16 array, dimension (K)
69
* TAU(i) must contain the scalar factor of the elementary
72
* T (output) COMPLEX*16 array, dimension (LDT,K)
73
* The k by k triangular factor T of the block reflector.
74
* If DIRECT = 'F', T is upper triangular; if DIRECT = 'B', T is
75
* lower triangular. The rest of the array is not used.
78
* The leading dimension of the array T. LDT >= K.
83
* The shape of the matrix V and the storage of the vectors which define
84
* the H(i) is best illustrated by the following example with n = 5 and
85
* k = 3. The elements equal to 1 are not stored; the corresponding
86
* array elements are modified but restored on exit. The rest of the
89
* DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R':
91
* V = ( 1 ) V = ( 1 v1 v1 v1 v1 )
92
* ( v1 1 ) ( 1 v2 v2 v2 )
93
* ( v1 v2 1 ) ( 1 v3 v3 )
97
* DIRECT = 'B' and STOREV = 'C': DIRECT = 'B' and STOREV = 'R':
99
* V = ( v1 v2 v3 ) V = ( v1 v1 1 )
100
* ( v1 v2 v3 ) ( v2 v2 v2 1 )
101
* ( 1 v2 v3 ) ( v3 v3 v3 v3 1 )
105
* =====================================================================
108
INTEGER ATLASROWMAJOR, ATLASCOLMAJOR
109
PARAMETER (ATLASROWMAJOR=101, ATLASCOLMAJOR=102)
110
INTEGER ATLASNOTRANS, ATLASTRANS, ATLASCONJTRANS
111
PARAMETER (ATLASNOTRANS=111, ATLASTRANS=112, ATLASCONJTRANS=113)
112
INTEGER ATLASUPPER, ATLASLOWER
113
PARAMETER (ATLASUPPER=121, ATLASLOWER=122)
114
INTEGER ATLASNONUNIT, ATLASUNIT
115
PARAMETER (ATLASNONUNIT=131, ATLASUNIT=132)
116
INTEGER ATLASLEFT, ATLASRIGHT
117
PARAMETER (ATLASLEFT=141, ATLASRIGHT=142)
118
* .. Local variables ..
119
INTEGER ISIDE, ITRANS, IDIRECT, ISTORE
121
* .. Executable Statements ..
123
* Quick return if possible
126
IF (DIRECT.EQ.'F' .OR. DIRECT.EQ.'f') THEN
131
IF (STOREV.EQ.'R' .OR. STOREV.EQ.'r') THEN
137
CALL ATL_F77WRAP_ZLARFT(IDIRECT, ISTORE, N, K, V, LDV,