dasum
C DASUM SOURCE CB215821 16/04/21 21:16:15 8920 C C TAKES THE SUM OF THE ABSOLUTE VALUES. C USES UNROLLED LOOPS FOR INCREMENT EQUAL TO ONE. C JACK DONGARRA, LINPACK, 3/11/78. C MODIFIED TO CORRECT PROBLEM WITH NEGATIVE INCREMENT, 8/21/90. C INTEGER I,INCX,IX,M,MP1,N C DASUM = 0.0D0 DTEMP = 0.0D0 IF(N.LE.0)RETURN IF(INCX.EQ.1)GO TO 20 C C CODE FOR INCREMENT NOT EQUAL TO 1 C IX = 1 IF(INCX.LT.0)IX = (-N+1)*INCX + 1 DO 10 I = 1,N DTEMP = DTEMP + ABS(DX(IX)) IX = IX + INCX 10 CONTINUE DASUM = DTEMP RETURN C C CODE FOR INCREMENT EQUAL TO 1 C C C CLEAN-UP LOOP C 20 M = MOD(N,6) IF( M .EQ. 0 ) GO TO 40 DO 30 I = 1,M DTEMP = DTEMP + ABS(DX(I)) 30 CONTINUE IF( N .LT. 6 ) GO TO 60 40 MP1 = M + 1 DO 50 I = MP1,N,6 DTEMP = DTEMP + ABS(DX(I)) + ABS(DX(I + 1)) + ABS(DX(I + 2)) * + ABS(DX(I + 3)) + ABS(DX(I + 4)) + ABS(DX(I + 5)) 50 CONTINUE RETURN END
© Cast3M 2003 - Tous droits réservés.
Mentions légales