root / src / blas / sdsdot.f @ 4
Historique | Voir | Annoter | Télécharger (2,78 ko)
1 | 1 | pfleura2 | REAL FUNCTION SDSDOT(N,SB,SX,INCX,SY,INCY) |
---|---|---|---|
2 | 1 | pfleura2 | * .. Scalar Arguments .. |
3 | 1 | pfleura2 | REAL SB |
4 | 1 | pfleura2 | INTEGER INCX,INCY,N |
5 | 1 | pfleura2 | * .. |
6 | 1 | pfleura2 | * .. Array Arguments .. |
7 | 1 | pfleura2 | REAL SX(*),SY(*) |
8 | 1 | pfleura2 | * .. |
9 | 1 | pfleura2 | * |
10 | 1 | pfleura2 | * PURPOSE |
11 | 1 | pfleura2 | * ======= |
12 | 1 | pfleura2 | * |
13 | 1 | pfleura2 | * Compute the inner product of two vectors with extended |
14 | 1 | pfleura2 | * precision accumulation. |
15 | 1 | pfleura2 | * |
16 | 1 | pfleura2 | * Returns S.P. result with dot product accumulated in D.P. |
17 | 1 | pfleura2 | * SDSDOT = SB + sum for I = 0 to N-1 of SX(LX+I*INCX)*SY(LY+I*INCY), |
18 | 1 | pfleura2 | * where LX = 1 if INCX .GE. 0, else LX = 1+(1-N)*INCX, and LY is |
19 | 1 | pfleura2 | * defined in a similar way using INCY. |
20 | 1 | pfleura2 | * |
21 | 1 | pfleura2 | * AUTHOR |
22 | 1 | pfleura2 | * ====== |
23 | 1 | pfleura2 | * Lawson, C. L., (JPL), Hanson, R. J., (SNLA), |
24 | 1 | pfleura2 | * Kincaid, D. R., (U. of Texas), Krogh, F. T., (JPL) |
25 | 1 | pfleura2 | * |
26 | 1 | pfleura2 | * ARGUMENTS |
27 | 1 | pfleura2 | * ========= |
28 | 1 | pfleura2 | * |
29 | 1 | pfleura2 | * N (input) INTEGER |
30 | 1 | pfleura2 | * number of elements in input vector(s) |
31 | 1 | pfleura2 | * |
32 | 1 | pfleura2 | * SB (input) REAL |
33 | 1 | pfleura2 | * single precision scalar to be added to inner product |
34 | 1 | pfleura2 | * |
35 | 1 | pfleura2 | * SX (input) REAL array, dimension (N) |
36 | 1 | pfleura2 | * single precision vector with N elements |
37 | 1 | pfleura2 | * |
38 | 1 | pfleura2 | * INCX (input) INTEGER |
39 | 1 | pfleura2 | * storage spacing between elements of SX |
40 | 1 | pfleura2 | * |
41 | 1 | pfleura2 | * SY (input) REAL array, dimension (N) |
42 | 1 | pfleura2 | * single precision vector with N elements |
43 | 1 | pfleura2 | * |
44 | 1 | pfleura2 | * INCY (input) INTEGER |
45 | 1 | pfleura2 | * storage spacing between elements of SY |
46 | 1 | pfleura2 | * |
47 | 1 | pfleura2 | * SDSDOT (output) REAL |
48 | 1 | pfleura2 | * single precision dot product (SB if N .LE. 0) |
49 | 1 | pfleura2 | * |
50 | 1 | pfleura2 | * REFERENCES |
51 | 1 | pfleura2 | * ========== |
52 | 1 | pfleura2 | * |
53 | 1 | pfleura2 | * C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T. |
54 | 1 | pfleura2 | * Krogh, Basic linear algebra subprograms for Fortran |
55 | 1 | pfleura2 | * usage, Algorithm No. 539, Transactions on Mathematical |
56 | 1 | pfleura2 | * Software 5, 3 (September 1979), pp. 308-323. |
57 | 1 | pfleura2 | * |
58 | 1 | pfleura2 | * REVISION HISTORY (YYMMDD) |
59 | 1 | pfleura2 | * ========================== |
60 | 1 | pfleura2 | * |
61 | 1 | pfleura2 | * 791001 DATE WRITTEN |
62 | 1 | pfleura2 | * 890531 Changed all specific intrinsics to generic. (WRB) |
63 | 1 | pfleura2 | * 890831 Modified array declarations. (WRB) |
64 | 1 | pfleura2 | * 890831 REVISION DATE from Version 3.2 |
65 | 1 | pfleura2 | * 891214 Prologue converted to Version 4.0 format. (BAB) |
66 | 1 | pfleura2 | * 920310 Corrected definition of LX in DESCRIPTION. (WRB) |
67 | 1 | pfleura2 | * 920501 Reformatted the REFERENCES section. (WRB) |
68 | 1 | pfleura2 | * 070118 Reformat to LAPACK coding style |
69 | 1 | pfleura2 | * |
70 | 1 | pfleura2 | * ===================================================================== |
71 | 1 | pfleura2 | * |
72 | 1 | pfleura2 | * .. Local Scalars .. |
73 | 1 | pfleura2 | DOUBLE PRECISION DSDOT |
74 | 1 | pfleura2 | INTEGER I,KX,KY,NS |
75 | 1 | pfleura2 | * .. |
76 | 1 | pfleura2 | * .. Intrinsic Functions .. |
77 | 1 | pfleura2 | INTRINSIC DBLE |
78 | 1 | pfleura2 | * .. |
79 | 1 | pfleura2 | DSDOT = SB |
80 | 1 | pfleura2 | IF (N.LE.0) GO TO 30 |
81 | 1 | pfleura2 | IF (INCX.EQ.INCY .AND. INCX.GT.0) GO TO 40 |
82 | 1 | pfleura2 | * |
83 | 1 | pfleura2 | * Code for unequal or nonpositive increments. |
84 | 1 | pfleura2 | * |
85 | 1 | pfleura2 | KX = 1 |
86 | 1 | pfleura2 | KY = 1 |
87 | 1 | pfleura2 | IF (INCX.LT.0) KX = 1 + (1-N)*INCX |
88 | 1 | pfleura2 | IF (INCY.LT.0) KY = 1 + (1-N)*INCY |
89 | 1 | pfleura2 | DO 10 I = 1,N |
90 | 1 | pfleura2 | DSDOT = DSDOT + DBLE(SX(KX))*DBLE(SY(KY)) |
91 | 1 | pfleura2 | KX = KX + INCX |
92 | 1 | pfleura2 | KY = KY + INCY |
93 | 1 | pfleura2 | 10 CONTINUE |
94 | 1 | pfleura2 | 30 SDSDOT = DSDOT |
95 | 1 | pfleura2 | RETURN |
96 | 1 | pfleura2 | * |
97 | 1 | pfleura2 | * Code for equal and positive increments. |
98 | 1 | pfleura2 | * |
99 | 1 | pfleura2 | 40 NS = N*INCX |
100 | 1 | pfleura2 | DO 50 I = 1,NS,INCX |
101 | 1 | pfleura2 | DSDOT = DSDOT + DBLE(SX(I))*DBLE(SY(I)) |
102 | 1 | pfleura2 | 50 CONTINUE |
103 | 1 | pfleura2 | SDSDOT = DSDOT |
104 | 1 | pfleura2 | RETURN |
105 | 1 | pfleura2 | END |