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