1ZLAHR2 ‐ the first NB columns of A complex general n‐BY‐(n‐k+1)
2matrix A so that elements below the k‐th subdiagonal are zero
3SUBROUTINE ZLAHR2( N, K, NB, A, LDA, TAU, T, LDT, Y, LDY )
4 INTEGER K, LDA, LDT, LDY, N, NB
5 COMPLEX*16 A( LDA, * ), T( LDT, NB ), TAU( NB ), Y( LDY, NB )
6ZLAHR2 reduces the first NB columns of A complex general n‐BY‐(n‐
7k+1) matrix A so that elements below the k‐th subdiagonal are ze‐
8ro. The reduction is performed by an unitary similarity transfor‐
9mation Q' * A * Q. The routine returns the matrices V and T which
10determine Q as a block reflector I ‐ V*T*V', and also the matrix
11Y = A * V * T.
12
13This is an auxiliary routine called by ZGEHRD.
14
15N (input) INTEGER The order of the matrix A. K (in‐
16put) INTEGER The offset for the reduction. Elements below the k‐
17th subdiagonal in the first NB columns are reduced to zero. K <
18N. NB (input) INTEGER The number of columns to be reduced.
19A (input/output) COMPLEX*16 array, dimension (LDA,N‐K+1) On
20entry, the n‐by‐(n‐k+1) general matrix A. On exit, the elements
21on and above the k‐th subdiagonal in the first NB columns are
22overwritten with the corresponding elements of the reduced ma‐
23trix; the elements below the k‐th subdiagonal, with the array
24TAU, represent the matrix Q as a product of elementary reflec‐
25tors. The other columns of A are unchanged. See Further Details.
26LDA (input) INTEGER The leading dimension of the array A.
27LDA >= max(1,N). TAU (output) COMPLEX*16 array, dimension
28(NB) The scalar factors of the elementary reflectors. See Further
29Details. T (output) COMPLEX*16 array, dimension (LDT,NB)
30The upper triangular matrix T. LDT (input) INTEGER The lead‐
31ing dimension of the array T. LDT >= NB. Y (output) COM‐
32PLEX*16 array, dimension (LDY,NB) The n‐by‐nb matrix Y. LDY
33(input) INTEGER The leading dimension of the array Y. LDY >= N.
34The matrix Q is represented as a product of nb elementary reflec‐
35tors
36
37 Q = H(1) H(2) . . . H(nb).
38
39Each H(i) has the form
40
41 H(i) = I ‐ tau * v * v'
42
43where tau is a complex scalar, and v is a complex vector with
44v(1:i+k‐1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in
45A(i+k+1:n,i), and tau in TAU(i).
46
47The elements of the vectors v together form the (n‐k+1)‐by‐nb ma‐
48trix V which is needed, with T and Y, to apply the transformation
49to the unreduced part of the matrix, using an update of the form:
50A := (I ‐ V*T*V') * (A ‐ Y*V').
51
52The contents of A on exit are illustrated by the following exam‐
53ple with n = 7, k = 3 and nb = 2:
54
55 ( a a a a a )
56 ( a a a a a )
57 ( a a a a a )
58 ( h h a a a )
59 ( v1 h a a a )
60 ( v1 v2 a a a )
61 ( v1 v2 a a a )
62
63where a denotes an element of the original matrix A, h denotes a
64modified element of the upper Hessenberg matrix H, and vi denotes
65an element of the vector defining H(i).
66
67This file is a slight modification of LAPACK‐3.0's ZLAHRD incor‐
68porating improvements proposed by Quintana‐Orti and Van de Gejin.
69Note that the entries of A(1:K,2:NB) differ from those returned
70by the original LAPACK routine. This function is not backward
71compatible with LAPACK3.0.
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132