Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/mathlibs/src/blas/cdotu.f
5199 views
1
complex function cdotu(n,cx,incx,cy,incy)
2
c
3
c forms the dot product of two vectors.
4
c jack dongarra, linpack, 3/11/78.
5
c modified 12/3/93, array(1) declarations changed to array(*)
6
c
7
complex cx(*),cy(*),ctemp
8
integer i,incx,incy,ix,iy,n
9
c
10
ctemp = (0.0,0.0)
11
cdotu = (0.0,0.0)
12
if(n.le.0)return
13
if(incx.eq.1.and.incy.eq.1)go to 20
14
c
15
c code for unequal increments or equal increments
16
c not equal to 1
17
c
18
ix = 1
19
iy = 1
20
if(incx.lt.0)ix = (-n+1)*incx + 1
21
if(incy.lt.0)iy = (-n+1)*incy + 1
22
do 10 i = 1,n
23
ctemp = ctemp + cx(ix)*cy(iy)
24
ix = ix + incx
25
iy = iy + incy
26
10 continue
27
cdotu = ctemp
28
return
29
c
30
c code for both increments equal to 1
31
c
32
20 do 30 i = 1,n
33
ctemp = ctemp + cx(i)*cy(i)
34
30 continue
35
cdotu = ctemp
36
return
37
end
38
39