1 double precision function ddot
(n
,dx
,incx
,dy
,incy
)
3 c forms the dot product of two vectors.
4 c uses unrolled loops for increments equal to one.
5 c jack dongarra, linpack, 3/11/78.
6 c modified 12/3/93, array(1) declarations changed to array(*)
8 double precision dx
(*),dy
(*),dtemp
9 integer i
,incx
,incy
,ix
,iy
,m
,mp1
,n
14 if(incx
.eq
.1.and
.incy
.eq
.1)go to 20
16 c code for unequal increments or equal increments
21 if(incx
.lt
.0)ix
= (-n
+1)*incx
+ 1
22 if(incy
.lt
.0)iy
= (-n
+1)*incy
+ 1
24 dtemp
= dtemp
+ dx
(ix
)*dy
(iy
)
31 c code for both increments equal to 1
37 if( m
.eq
. 0 ) go to 40
39 dtemp
= dtemp
+ dx
(i
)*dy
(i
)
41 if( n
.lt
. 5 ) go to 60
44 dtemp
= dtemp
+ dx
(i
)*dy
(i
) + dx
(i
+ 1)*dy
(i
+ 1) +
45 * dx
(i
+ 2)*dy
(i
+ 2) + dx
(i
+ 3)*dy
(i
+ 3) + dx
(i
+ 4)*dy
(i
+ 4)