1SLASR(1) LAPACK auxiliary routine (version 3.1) SLASR(1)
2
3
4
6 SLASR - a sequence of plane rotations to a real matrix A,
7
9 SUBROUTINE SLASR( SIDE, PIVOT, DIRECT, M, N, C, S, A, LDA )
10
11 CHARACTER DIRECT, PIVOT, SIDE
12
13 INTEGER LDA, M, N
14
15 REAL A( LDA, * ), C( * ), S( * )
16
18 SLASR applies a sequence of plane rotations to a real matrix A, from
19 either the left or the right.
20
21 When SIDE = 'L', the transformation takes the form
22
23 A := P*A
24
25 and when SIDE = 'R', the transformation takes the form
26
27 A := A*P**T
28
29 where P is an orthogonal matrix consisting of a sequence of z plane
30 rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R', and
31 P**T is the transpose of P.
32
33 When DIRECT = 'F' (Forward sequence), then
34
35 P = P(z-1) * ... * P(2) * P(1)
36
37 and when DIRECT = 'B' (Backward sequence), then
38
39 P = P(1) * P(2) * ... * P(z-1)
40
41 where P(k) is a plane rotation matrix defined by the 2-by-2 rotation
42
43 R(k) = ( c(k) s(k) )
44 = ( -s(k) c(k) ).
45
46 When PIVOT = 'V' (Variable pivot), the rotation is performed for the
47 plane (k,k+1), i.e., P(k) has the form
48
49 P(k) = ( 1 )
50 ( ... )
51 ( 1 )
52 ( c(k) s(k) )
53 ( -s(k) c(k) )
54 ( 1 )
55 ( ... )
56 ( 1 )
57
58 where R(k) appears as a rank-2 modification to the identity matrix in
59 rows and columns k and k+1.
60
61 When PIVOT = 'T' (Top pivot), the rotation is performed for the plane
62 (1,k+1), so P(k) has the form
63
64 P(k) = ( c(k) s(k) )
65 ( 1 )
66 ( ... )
67 ( 1 )
68 ( -s(k) c(k) )
69 ( 1 )
70 ( ... )
71 ( 1 )
72
73 where R(k) appears in rows and columns 1 and k+1.
74
75 Similarly, when PIVOT = 'B' (Bottom pivot), the rotation is performed
76 for the plane (k,z), giving P(k) the form
77
78 P(k) = ( 1 )
79 ( ... )
80 ( 1 )
81 ( c(k) s(k) )
82 ( 1 )
83 ( ... )
84 ( 1 )
85 ( -s(k) c(k) )
86
87 where R(k) appears in rows and columns k and z. The rotations are per‐
88 formed without ever forming P(k) explicitly.
89
90
92 SIDE (input) CHARACTER*1
93 Specifies whether the plane rotation matrix P is applied to A
94 on the left or the right. = 'L': Left, compute A := P*A
95 = 'R': Right, compute A:= A*P**T
96
97 PIVOT (input) CHARACTER*1
98 Specifies the plane for which P(k) is a plane rotation matrix.
99 = 'V': Variable pivot, the plane (k,k+1)
100 = 'T': Top pivot, the plane (1,k+1)
101 = 'B': Bottom pivot, the plane (k,z)
102
103 DIRECT (input) CHARACTER*1
104 Specifies whether P is a forward or backward sequence of plane
105 rotations. = 'F': Forward, P = P(z-1)*...*P(2)*P(1)
106 = 'B': Backward, P = P(1)*P(2)*...*P(z-1)
107
108 M (input) INTEGER
109 The number of rows of the matrix A. If m <= 1, an immediate
110 return is effected.
111
112 N (input) INTEGER
113 The number of columns of the matrix A. If n <= 1, an immediate
114 return is effected.
115
116 C (input) REAL array, dimension
117 (M-1) if SIDE = 'L' (N-1) if SIDE = 'R' The cosines c(k) of the
118 plane rotations.
119
120 S (input) REAL array, dimension
121 (M-1) if SIDE = 'L' (N-1) if SIDE = 'R' The sines s(k) of the
122 plane rotations. The 2-by-2 plane rotation part of the matrix
123 P(k), R(k), has the form R(k) = ( c(k) s(k) ) ( -s(k) c(k)
124 ).
125
126 A (input/output) REAL array, dimension (LDA,N)
127 The M-by-N matrix A. On exit, A is overwritten by P*A if SIDE
128 = 'R' or by A*P**T if SIDE = 'L'.
129
130 LDA (input) INTEGER
131 The leading dimension of the array A. LDA >= max(1,M).
132
133
134
135 LAPACK auxiliary routine (versionNo3v.e1m)ber 2006 SLASR(1)