1SLAHR2 ‐ the first NB columns of A real general n‐BY‐(n‐k+1) ma‐
2trix A so that elements below the k‐th subdiagonal are zero SUB‐
3ROUTINE SLAHR2( N, K, NB, A, LDA, TAU, T, LDT, Y, LDY )
4 INTEGER K, LDA, LDT, LDY, N, NB
5 REAL A( LDA, * ), T( LDT, NB ), TAU( NB ), Y( LDY, NB )
6SLAHR2 reduces the first NB columns of A real 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 orthogonal similarity trans‐
9formation Q' * A * Q. The routine returns the matrices V and T
10which determine Q as a block reflector I ‐ V*T*V', and also the
11matrix Y = A * V * T.
12
13This is an auxiliary routine called by SGEHRD.
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) REAL array, dimension (LDA,N‐K+1) On en‐
20try, the n‐by‐(n‐k+1) general matrix A. On exit, the elements on
21and above the k‐th subdiagonal in the first NB columns are over‐
22written with the corresponding elements of the reduced matrix;
23the elements below the k‐th subdiagonal, with the array TAU, rep‐
24resent the matrix Q as a product of elementary reflectors. The
25other columns of A are unchanged. See Further Details. LDA
26(input) INTEGER The leading dimension of the array A. LDA >=
27max(1,N). TAU (output) REAL array, dimension (NB) The scalar
28factors of the elementary reflectors. See Further Details. T
29(output) REAL array, dimension (LDT,NB) The upper triangular ma‐
30trix T. LDT (input) INTEGER The leading dimension of the ar‐
31ray T. LDT >= NB. Y (output) REAL array, dimension
32(LDY,NB) The n‐by‐nb matrix Y. LDY (input) INTEGER The lead‐
33ing dimension of the array Y. LDY >= N. The matrix Q is repre‐
34sented 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 real scalar, and v is a real 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 SLAHRD 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