3
4
5
6
7
8
9 LOGICAL LLEFT, LRIGHT, LROWS
10 INTEGER LDA, NL
11 REAL C, S, XLEFT, XRIGHT
12
13
14 REAL A( * )
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205 INTEGER IINC, INEXT, IX, IY, IYT, NT
206
207
208 REAL XT( 2 ), YT( 2 )
209
210
211 EXTERNAL srot, xerbla
212
213
214
215
216
217 IF( lrows ) THEN
218 iinc = lda
219 inext = 1
220 ELSE
221 iinc = 1
222 inext = lda
223 END IF
224
225 IF( lleft ) THEN
226 nt = 1
227 ix = 1 + iinc
228 iy = 2 + lda
229 xt( 1 ) = a( 1 )
230 yt( 1 ) = xleft
231 ELSE
232 nt = 0
233 ix = 1
234 iy = 1 + inext
235 END IF
236
237 IF( lright ) THEN
238 iyt = 1 + inext + ( nl-1 )*iinc
239 nt = nt + 1
240 xt( nt ) = xright
241 yt( nt ) = a( iyt )
242 ELSE
243 iyt = 1
244 END IF
245
246
247
248 IF( nl.LT.nt ) THEN
249 CALL xerbla( 'SLAROT', 4 )
250 RETURN
251 END IF
252 IF( lda.LE.0 .OR. ( .NOT.lrows .AND. lda.LT.nl-nt ) ) THEN
253 CALL xerbla( 'SLAROT', 8 )
254 RETURN
255 END IF
256
257
258
259 CALL srot( nl-nt, a( ix ), iinc, a( iy ), iinc, c, s )
260 CALL srot( nt, xt, 1, yt, 1, c, s )
261
262
263
264 IF( lleft ) THEN
265 a( 1 ) = xt( 1 )
266 xleft = yt( 1 )
267 END IF
268
269 IF( lright ) THEN
270 xright = xt( nt )
271 a( iyt ) = yt( nt )
272 END IF
273
274 RETURN
275
276
277