Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/mathlibs/src/blas/ccopy.f
5179 views
1
subroutine ccopy(n,cx,incx,cy,incy)
2
c
3
c copies a vector, x, to a vector, y.
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(*)
8
integer i,incx,incy,ix,iy,n
9
c
10
if(n.le.0)return
11
if(incx.eq.1.and.incy.eq.1)go to 20
12
c
13
c code for unequal increments or equal increments
14
c not equal to 1
15
c
16
ix = 1
17
iy = 1
18
if(incx.lt.0)ix = (-n+1)*incx + 1
19
if(incy.lt.0)iy = (-n+1)*incy + 1
20
do 10 i = 1,n
21
cy(iy) = cx(ix)
22
ix = ix + incx
23
iy = iy + incy
24
10 continue
25
return
26
c
27
c code for both increments equal to 1
28
c
29
20 do 30 i = 1,n
30
cy(i) = cx(i)
31
30 continue
32
return
33
end
34
35