01:       REAL FUNCTION SDOT(N,SX,INCX,SY,INCY)
02: *     .. Scalar Arguments ..
03:       INTEGER INCX,INCY,N
04: *     ..
05: *     .. Array Arguments ..
06:       REAL SX(*),SY(*)
07: *     ..
08: *
09: *  Purpose
10: *  =======
11: *
12: *     SDOT forms the dot product of two vectors.
13: *     uses unrolled loops for increments equal to one.
14: *
15: *  Further Details
16: *  ===============
17: *
18: *     jack dongarra, linpack, 3/11/78.
19: *     modified 12/3/93, array(1) declarations changed to array(*)
20: *
21: *  =====================================================================
22: *
23: *     .. Local Scalars ..
24:       REAL STEMP
25:       INTEGER I,IX,IY,M,MP1
26: *     ..
27: *     .. Intrinsic Functions ..
28:       INTRINSIC MOD
29: *     ..
30:       STEMP = 0.0e0
31:       SDOT = 0.0e0
32:       IF (N.LE.0) RETURN
33:       IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
34: *
35: *        code for unequal increments or equal increments
36: *          not equal to 1
37: *
38:       IX = 1
39:       IY = 1
40:       IF (INCX.LT.0) IX = (-N+1)*INCX + 1
41:       IF (INCY.LT.0) IY = (-N+1)*INCY + 1
42:       DO 10 I = 1,N
43:           STEMP = STEMP + SX(IX)*SY(IY)
44:           IX = IX + INCX
45:           IY = IY + INCY
46:    10 CONTINUE
47:       SDOT = STEMP
48:       RETURN
49: *
50: *        code for both increments equal to 1
51: *
52: *
53: *        clean-up loop
54: *
55:    20 M = MOD(N,5)
56:       IF (M.EQ.0) GO TO 40
57:       DO 30 I = 1,M
58:           STEMP = STEMP + SX(I)*SY(I)
59:    30 CONTINUE
60:       IF (N.LT.5) GO TO 60
61:    40 MP1 = M + 1
62:       DO 50 I = MP1,N,5
63:           STEMP = STEMP + SX(I)*SY(I) + SX(I+1)*SY(I+1) +
64:      +            SX(I+2)*SY(I+2) + SX(I+3)*SY(I+3) + SX(I+4)*SY(I+4)
65:    50 CONTINUE
66:    60 SDOT = STEMP
67:       RETURN
68:       END
69: