diff options
Diffstat (limited to 'BLAS/SRC/icamax.f')
-rw-r--r-- | BLAS/SRC/icamax.f | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/BLAS/SRC/icamax.f b/BLAS/SRC/icamax.f index 4fd4b920..2c941f97 100644 --- a/BLAS/SRC/icamax.f +++ b/BLAS/SRC/icamax.f @@ -32,28 +32,31 @@ IF (N.LT.1 .OR. INCX.LE.0) RETURN ICAMAX = 1 IF (N.EQ.1) RETURN - IF (INCX.EQ.1) GO TO 20 + IF (INCX.EQ.1) THEN * -* code for increment not equal to 1 +* code for increment equal to 1 * - IX = 1 - SMAX = SCABS1(CX(1)) - IX = IX + INCX - DO 10 I = 2,N - IF (SCABS1(CX(IX)).LE.SMAX) GO TO 5 - ICAMAX = I - SMAX = SCABS1(CX(IX)) - 5 IX = IX + INCX - 10 CONTINUE - RETURN + SMAX = SCABS1(CX(1)) + DO I = 2,N + IF (SCABS1(CX(I)).GT.SMAX) THEN + ICAMAX = I + SMAX = SCABS1(CX(I)) + END IF + END DO + ELSE * -* code for increment equal to 1 +* code for increment not equal to 1 * - 20 SMAX = SCABS1(CX(1)) - DO 30 I = 2,N - IF (SCABS1(CX(I)).LE.SMAX) GO TO 30 - ICAMAX = I - SMAX = SCABS1(CX(I)) - 30 CONTINUE + IX = 1 + SMAX = SCABS1(CX(1)) + IX = IX + INCX + DO I = 2,N + IF (SCABS1(CX(IX)).GT.SMAX) THEN + ICAMAX = I + SMAX = SCABS1(CX(IX)) + END IF + IX = IX + INCX + END DO + END IF RETURN END |