Annotation of rpl/lapack/blas/dsdot.f, revision 1.13
1.6 bertrand 1: *> \brief \b DSDOT
2: *
3: * =========== DOCUMENTATION ===========
4: *
1.11 bertrand 5: * Online html documentation available at
6: * http://www.netlib.org/lapack/explore-html/
1.6 bertrand 7: *
8: * Definition:
9: * ===========
10: *
11: * DOUBLE PRECISION FUNCTION DSDOT(N,SX,INCX,SY,INCY)
1.11 bertrand 12: *
1.6 bertrand 13: * .. Scalar Arguments ..
14: * INTEGER INCX,INCY,N
15: * ..
16: * .. Array Arguments ..
17: * REAL SX(*),SY(*)
18: * ..
1.11 bertrand 19: *
1.6 bertrand 20: * AUTHORS
21: * =======
1.11 bertrand 22: * Lawson, C. L., (JPL), Hanson, R. J., (SNLA),
1.6 bertrand 23: * Kincaid, D. R., (U. of Texas), Krogh, F. T., (JPL)
1.11 bertrand 24: *
1.6 bertrand 25: *
26: *> \par Purpose:
27: * =============
28: *>
29: *> \verbatim
30: *>
31: *> Compute the inner product of two vectors with extended
32: *> precision accumulation and result.
33: *>
34: *> Returns D.P. dot product accumulated in D.P., for S.P. SX and SY
35: *> DSDOT = sum for I = 0 to N-1 of SX(LX+I*INCX) * SY(LY+I*INCY),
36: *> where LX = 1 if INCX .GE. 0, else LX = 1+(1-N)*INCX, and LY is
37: *> defined in a similar way using INCY.
38: *> \endverbatim
39: *
40: * Arguments:
41: * ==========
42: *
43: *> \param[in] N
44: *> \verbatim
45: *> N is INTEGER
46: *> number of elements in input vector(s)
47: *> \endverbatim
48: *>
49: *> \param[in] SX
50: *> \verbatim
51: *> SX is REAL array, dimension(N)
52: *> single precision vector with N elements
53: *> \endverbatim
54: *>
55: *> \param[in] INCX
56: *> \verbatim
57: *> INCX is INTEGER
58: *> storage spacing between elements of SX
59: *> \endverbatim
60: *>
61: *> \param[in] SY
62: *> \verbatim
63: *> SY is REAL array, dimension(N)
64: *> single precision vector with N elements
65: *> \endverbatim
66: *>
67: *> \param[in] INCY
68: *> \verbatim
69: *> INCY is INTEGER
70: *> storage spacing between elements of SY
71: *> \endverbatim
72: *>
73: *> \result DSDOT
74: *> \verbatim
75: *> DSDOT is DOUBLE PRECISION
76: *> DSDOT double precision dot product (zero if N.LE.0)
77: *> \endverbatim
78: *
79: * Authors:
80: * ========
81: *
1.11 bertrand 82: *> \author Univ. of Tennessee
83: *> \author Univ. of California Berkeley
84: *> \author Univ. of Colorado Denver
85: *> \author NAG Ltd.
1.6 bertrand 86: *
87: *> \ingroup double_blas_level1
88: *
89: *> \par Further Details:
90: * =====================
91: *>
92: *> \verbatim
93: *> \endverbatim
94: *
95: *> \par References:
96: * ================
97: *>
98: *> \verbatim
99: *>
1.11 bertrand 100: *>
1.6 bertrand 101: *> C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T.
102: *> Krogh, Basic linear algebra subprograms for Fortran
103: *> usage, Algorithm No. 539, Transactions on Mathematical
104: *> Software 5, 3 (September 1979), pp. 308-323.
105: *>
106: *> REVISION HISTORY (YYMMDD)
107: *>
108: *> 791001 DATE WRITTEN
109: *> 890831 Modified array declarations. (WRB)
110: *> 890831 REVISION DATE from Version 3.2
111: *> 891214 Prologue converted to Version 4.0 format. (BAB)
112: *> 920310 Corrected definition of LX in DESCRIPTION. (WRB)
113: *> 920501 Reformatted the REFERENCES section. (WRB)
114: *> 070118 Reformat to LAPACK style (JL)
115: *> \endverbatim
116: *>
117: * =====================================================================
1.1 bertrand 118: DOUBLE PRECISION FUNCTION DSDOT(N,SX,INCX,SY,INCY)
1.6 bertrand 119: *
1.13 ! bertrand 120: * -- Reference BLAS level1 routine --
1.6 bertrand 121: * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
122: * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
123: *
1.1 bertrand 124: * .. Scalar Arguments ..
125: INTEGER INCX,INCY,N
126: * ..
127: * .. Array Arguments ..
128: REAL SX(*),SY(*)
129: * ..
130: *
1.6 bertrand 131: * Authors:
132: * ========
1.11 bertrand 133: * Lawson, C. L., (JPL), Hanson, R. J., (SNLA),
1.1 bertrand 134: * Kincaid, D. R., (U. of Texas), Krogh, F. T., (JPL)
135: *
136: * =====================================================================
137: *
138: * .. Local Scalars ..
139: INTEGER I,KX,KY,NS
140: * ..
141: * .. Intrinsic Functions ..
142: INTRINSIC DBLE
143: * ..
144: DSDOT = 0.0D0
145: IF (N.LE.0) RETURN
1.5 bertrand 146: IF (INCX.EQ.INCY .AND. INCX.GT.0) THEN
1.1 bertrand 147: *
1.5 bertrand 148: * Code for equal, positive, non-unit increments.
1.1 bertrand 149: *
1.5 bertrand 150: NS = N*INCX
151: DO I = 1,NS,INCX
152: DSDOT = DSDOT + DBLE(SX(I))*DBLE(SY(I))
153: END DO
154: ELSE
1.1 bertrand 155: *
1.5 bertrand 156: * Code for unequal or nonpositive increments.
1.1 bertrand 157: *
1.5 bertrand 158: KX = 1
159: KY = 1
160: IF (INCX.LT.0) KX = 1 + (1-N)*INCX
161: IF (INCY.LT.0) KY = 1 + (1-N)*INCY
162: DO I = 1,N
163: DSDOT = DSDOT + DBLE(SX(KX))*DBLE(SY(KY))
164: KX = KX + INCX
165: KY = KY + INCY
166: END DO
167: END IF
1.1 bertrand 168: RETURN
1.13 ! bertrand 169: *
! 170: * End of DSDOT
! 171: *
1.1 bertrand 172: END
CVSweb interface <joel.bertrand@systella.fr>