ccopy.c
来自「InsightToolkit-1.4.0(有大量的优化算法程序)」· C语言 代码 · 共 42 行
C
42 行
#include "f2c.h"
#include "netlib.h"
/* Modified by Peter Vanroose, June 2001: manual optimisation and clean-up */
/* Subroutine */ void ccopy_(n, cx, incx, cy, incy)
const integer *n;
const complex *cx;
const integer *incx;
complex *cy;
const integer *incy;
{
/* Local variables */
static integer i, ix, iy;
/* copies a vector, x, to a vector, y. */
/* jack dongarra, linpack, 3/11/78. */
/* modified 12/3/93, array(1) declarations changed to array(*) */
if (*n <= 0) {
return;
}
if (*incx == 1 && *incy == 1) {
for (i = 0; i < *n; ++i) {
cy[i].r = cx[i].r, cy[i].i = cx[i].i;
}
}
else {
ix = 0; iy = 0;
if (*incx < 0) {
ix = (1-(*n)) * *incx;
}
if (*incy < 0) {
iy = (1-(*n)) * *incy;
}
for (i = 0; i < *n; ++i) {
cy[iy].r = cx[ix].r, cy[iy].i = cx[ix].i;
ix += *incx; iy += *incy;
}
}
} /* ccopy_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?