Blame thirdparty/openblas/xianyi-OpenBLAS-e6e87a2/reference/cdotcf.f
|
kusano |
2b45e8 |
complex function cdotcf(n,cx,incx,cy,incy)
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
c forms the dot product of two vectors, conjugating the first
|
|
kusano |
2b45e8 |
c vector.
|
|
kusano |
2b45e8 |
c jack dongarra, linpack, 3/11/78.
|
|
kusano |
2b45e8 |
c modified 12/3/93, array(1) declarations changed to array(*)
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
complex cx(*),cy(*),ctemp
|
|
kusano |
2b45e8 |
integer i,incx,incy,ix,iy,n
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
ctemp = (0.0,0.0)
|
|
kusano |
2b45e8 |
cdotcf = (0.0,0.0)
|
|
kusano |
2b45e8 |
if(n.le.0)return
|
|
kusano |
2b45e8 |
if(incx.eq.1.and.incy.eq.1)go to 20
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
c code for unequal increments or equal increments
|
|
kusano |
2b45e8 |
c not equal to 1
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
ix = 1
|
|
kusano |
2b45e8 |
iy = 1
|
|
kusano |
2b45e8 |
if(incx.lt.0)ix = (-n+1)*incx + 1
|
|
kusano |
2b45e8 |
if(incy.lt.0)iy = (-n+1)*incy + 1
|
|
kusano |
2b45e8 |
do 10 i = 1,n
|
|
kusano |
2b45e8 |
ctemp = ctemp + conjg(cx(ix))*cy(iy)
|
|
kusano |
2b45e8 |
ix = ix + incx
|
|
kusano |
2b45e8 |
iy = iy + incy
|
|
kusano |
2b45e8 |
10 continue
|
|
kusano |
2b45e8 |
cdotcf = ctemp
|
|
kusano |
2b45e8 |
return
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
c code for both increments equal to 1
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
20 do 30 i = 1,n
|
|
kusano |
2b45e8 |
ctemp = ctemp + conjg(cx(i))*cy(i)
|
|
kusano |
2b45e8 |
30 continue
|
|
kusano |
2b45e8 |
cdotcf = ctemp
|
|
kusano |
2b45e8 |
return
|
|
kusano |
2b45e8 |
end
|