1CLAHR2 ‐ 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 CLAHR2( N, K, NB, A, LDA, TAU, T, LDT, Y, LDY )
4 INTEGER K, LDA, LDT, LDY, N, NB
5 COMPLEX A( LDA, * ), T( LDT, NB ), TAU( NB ), Y( LDY, NB )
6CLAHR2 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 CGEHRD.
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 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 array, dimension (NB)
28The scalar factors of the elementary reflectors. See Further De‐
29tails. T (output) COMPLEX array, dimension (LDT,NB) The
30upper triangular matrix T. LDT (input) INTEGER The leading
31dimension of the array T. LDT >= NB. Y (output) COMPLEX
32array, dimension (LDY,NB) The n‐by‐nb matrix Y. LDY (input)
33INTEGER The leading dimension of the array Y. LDY >= N. The ma‐
34trix Q is represented as a product of nb elementary reflectors
35
36 Q = H(1) H(2) . . . H(nb).
37
38Each H(i) has the form
39
40 H(i) = I ‐ tau * v * v'
41
42where tau is a complex scalar, and v is a complex vector with
43v(1:i+k‐1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in
44A(i+k+1:n,i), and tau in TAU(i).
45
46The elements of the vectors v together form the (n‐k+1)‐by‐nb ma‐
47trix V which is needed, with T and Y, to apply the transformation
48to the unreduced part of the matrix, using an update of the form:
49A := (I ‐ V*T*V') * (A ‐ Y*V').
50
51The contents of A on exit are illustrated by the following exam‐
52ple with n = 7, k = 3 and nb = 2:
53
54 ( a a a a a )
55 ( a a a a a )
56 ( a a a a a )
57 ( h h a a a )
58 ( v1 h a a a )
59 ( v1 v2 a a a )
60 ( v1 v2 a a a )
61
62where a denotes an element of the original matrix A, h denotes a
63modified element of the upper Hessenberg matrix H, and vi denotes
64an element of the vector defining H(i).
65
66This file is a slight modification of LAPACK‐3.0's CLAHRD incor‐
67porating improvements proposed by Quintana‐Orti and Van de Gejin.
68Note that the entries of A(1:K,2:NB) differ from those returned
69by the original LAPACK routine. This function is not backward
70compatible with LAPACK3.0.
71
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