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