Skip to content

Commit

Permalink
fix lastv possible range in clarf1f, Reference-LAPACK#1011
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardFedorenkov committed Jun 6, 2024
1 parent 1d4010e commit ea943fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SRC/clarf1f.f
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
* .. Executable Statements ..
*
APPLYLEFT = LSAME( SIDE, 'L' )
LASTV = 0
LASTV = 1
LASTC = 0
IF( TAU.NE.ZERO ) THEN
! Set up variables for scanning V. LASTV begins pointing to the end
! of V.
! of V up to V(1).
IF( APPLYLEFT ) THEN
LASTV = M
ELSE
Expand All @@ -180,7 +180,7 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
I = 1
END IF
! Look for the last non-zero row in V.
DO WHILE( LASTV.GT.0 .AND. V( I ).EQ.ZERO )
DO WHILE( LASTV.GT.1 .AND. V( I ).EQ.ZERO )
LASTV = LASTV - 1
I = I - INCV
END DO
Expand All @@ -192,7 +192,7 @@ SUBROUTINE CLARF1F( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
LASTC = ILACLR(M, LASTV, C, LDC)
END IF
END IF
IF( LASTC.EQ.0 .OR. LASTV.EQ.0 ) THEN
IF( LASTC.EQ.0 ) THEN
RETURN
END IF
IF( APPLYLEFT ) THEN
Expand Down

0 comments on commit ea943fc

Please sign in to comment.