|
35 | 35 | *>
|
36 | 36 | *> \verbatim
|
37 | 37 | *>
|
38 |
| -*> DLARF1F applies a real elementary reflector H to a real m by n matrix |
| 38 | +*> DLARF applies a real elementary reflector H to a real m by n matrix |
39 | 39 | *> C, from either the left or the right. H is represented in the form
|
40 | 40 | *>
|
41 | 41 | *> H = I - tau * v * v**T
|
42 | 42 | *>
|
43 | 43 | *> where tau is a real scalar and v is a real vector.
|
44 |
| -*> It is assumed that v(1) = 1. v(1) is not referenced. |
45 | 44 | *>
|
46 | 45 | *> If tau = 0, then H is taken to be the unit matrix.
|
47 | 46 | *> \endverbatim
|
|
118 | 117 | *> \author Univ. of Colorado Denver
|
119 | 118 | *> \author NAG Ltd.
|
120 | 119 | *
|
121 |
| -*> \ingroup larf1f |
122 |
| -* |
123 |
| -*> \par Further Details: |
124 |
| -* ===================== |
125 |
| -*> |
126 |
| -*> \verbatim |
127 |
| -*> |
128 |
| -*> The algorithm update matrix C by blocks. |
129 |
| -*> C is presected in the form of 4 blocks: |
130 |
| -*> C11 - 1-by-1, C12 - 1-by-n, C21 - m-by-1 and C22 - (m-1)-by-(n-1) |
131 |
| -*> |
132 |
| -*> C = ( C11 | C12 ) |
133 |
| -*> (_____|___________________) |
134 |
| -*> ( | ) |
135 |
| -*> ( | ) |
136 |
| -*> ( C21 | C22 ) |
137 |
| -*> ( | ) |
138 |
| -*> ( | ) |
139 |
| -*> |
140 |
| -*> \endverbatim |
| 120 | +*> \ingroup larf |
141 | 121 | *
|
142 | 122 | * =====================================================================
|
143 | 123 | SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
|
@@ -167,7 +147,7 @@ SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
|
167 | 147 | DOUBLE PRECISION C11, DOT1, DDOT
|
168 | 148 | * ..
|
169 | 149 | * .. External Subroutines ..
|
170 |
| - EXTERNAL DGEMV, DGER, DDOT, DAXPY, DCOPY |
| 150 | + EXTERNAL DGEMV, DGER, DDOT, DAXPY, DCOPY, DSCAL |
171 | 151 | * ..
|
172 | 152 | * .. External Functions ..
|
173 | 153 | LOGICAL LSAME
|
@@ -206,15 +186,17 @@ SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
|
206 | 186 | END IF
|
207 | 187 | END IF
|
208 | 188 |
|
209 |
| - IF( LASTC.EQ.0 ) THEN |
| 189 | + IF( LASTC.EQ.0 .OR. LASTV.EQ.0 ) THEN |
210 | 190 | RETURN
|
211 | 191 | END IF
|
212 | 192 |
|
213 | 193 | IF( APPLYLEFT ) THEN
|
214 | 194 | *
|
215 | 195 | * Form H * C
|
216 | 196 | *
|
217 |
| - IF( LASTV.GT.0 ) THEN |
| 197 | + IF( LASTV.EQ.1 ) THEN |
| 198 | + CALL DSCAL(LASTC, ONE - TAU, C, LDC) |
| 199 | + ELSE |
218 | 200 | DOT1 = - TAU * DDOT( LASTV - 1, V( 1 + INCV ), INCV,
|
219 | 201 | $ C( 2, 1 ), 1 )
|
220 | 202 |
|
@@ -249,7 +231,9 @@ SUBROUTINE DLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
|
249 | 231 | *
|
250 | 232 | * Form C * H
|
251 | 233 | *
|
252 |
| - IF( LASTV.GT.0 ) THEN |
| 234 | + IF( LASTV.EQ.1 ) THEN |
| 235 | + CALL DSCAL(LASTC, ONE - TAU, C, 1) |
| 236 | + ELSE |
253 | 237 | DOT1 = - TAU * DDOT( LASTV - 1, V( 1 + INCV ), INCV,
|
254 | 238 | $ C( 1, 2 ), LDC )
|
255 | 239 |
|
|
0 commit comments