repo.or.cz
/
gromacs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Split g96 I/O routines from confio.cpp
[gromacs.git]
/
src
/
gromacs
/
linearalgebra
/
gmx_blas
/
scopy.c
blob
00264fe3cc115cd332a48a5e7cf6e385e0894ba3
1
#include
"../gmx_blas.h"
2
3
void
4
F77_FUNC
(
scopy
,
SCOPY
)(
int
*
n__
,
5
float
*
dx
,
6
int
*
incx__
,
7
float
*
dy
,
8
int
*
incy__
)
9
{
10
int
i
,
ix
,
iy
;
11
12
int
n
= *
n__
;
13
int
incx
= *
incx__
;
14
int
incy
= *
incy__
;
15
16
if
(
incx
!=
1
||
incy
!=
1
)
17
{
18
ix
=
0
;
19
iy
=
0
;
20
if
(
incx
<
0
)
21
ix
= (
1
-
n
)*(
incx
);
22
if
(
incy
<
0
)
23
iy
= (
1
-
n
)*(
incy
);
24
25
for
(
i
=
0
;
i
<
n
;
i
++,
ix
+=
incx
,
iy
+=
incy
)
26
dy
[
iy
] =
dx
[
ix
];
27
28
return
;
29
30
}
else
{
31
32
/* unroll */
33
34
for
(
i
=
0
;
i
<(
n
-
8
);
i
+=
8
) {
35
dy
[
i
] =
dx
[
i
];
36
dy
[
i
+
1
] =
dx
[
i
+
1
];
37
dy
[
i
+
2
] =
dx
[
i
+
2
];
38
dy
[
i
+
3
] =
dx
[
i
+
3
];
39
dy
[
i
+
4
] =
dx
[
i
+
4
];
40
dy
[
i
+
5
] =
dx
[
i
+
5
];
41
dy
[
i
+
6
] =
dx
[
i
+
6
];
42
dy
[
i
+
7
] =
dx
[
i
+
7
];
43
}
44
/* continue with current value of i */
45
for
(;
i
<
n
;
i
++)
46
dy
[
i
] =
dx
[
i
];
47
}
48
}