Skip to content

Commit ea943fc

Browse files
fix lastv possible range in clarf1f, #1011
1 parent 1d4010e commit ea943fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

SRC/clarf1f.f

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
164164
* .. Executable Statements ..
165165
*
166166
APPLYLEFT = LSAME( SIDE, 'L' )
167-
LASTV = 0
167+
LASTV = 1
168168
LASTC = 0
169169
IF( TAU.NE.ZERO ) THEN
170170
! Set up variables for scanning V. LASTV begins pointing to the end
171-
! of V.
171+
! of V up to V(1).
172172
IF( APPLYLEFT ) THEN
173173
LASTV = M
174174
ELSE
@@ -180,7 +180,7 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
180180
I = 1
181181
END IF
182182
! Look for the last non-zero row in V.
183-
DO WHILE( LASTV.GT.0 .AND. V( I ).EQ.ZERO )
183+
DO WHILE( LASTV.GT.1 .AND. V( I ).EQ.ZERO )
184184
LASTV = LASTV - 1
185185
I = I - INCV
186186
END DO
@@ -192,7 +192,7 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
192192
LASTC = ILACLR(M, LASTV, C, LDC)
193193
END IF
194194
END IF
195-
IF( LASTC.EQ.0 .OR. LASTV.EQ.0 ) THEN
195+
IF( LASTC.EQ.0 ) THEN
196196
RETURN
197197
END IF
198198
IF( APPLYLEFT ) THEN

0 commit comments

Comments
 (0)