16 Cpx *
ps, *p, *q, *pa, *pd;
20 double s,
t, tq = 0., zr = 1.e-15;
22 q0 = (
Cpx *)calloc(n,
sizeof(
Cpx));
25 for (j = 0; j < n; ++j, ++pa, pd += n + 1) {
27 for (i = 0, p = pa, q = q0; i < n; ++i, p += n)
29 for (i = 1; i < n; ++i) {
32 for (k = 0, p = pa + i * n - j, q = q0; k < lc; ++k, ++q, ++p) {
33 z.
re += p->re * q->re - p->im * q->im;
34 z.
im += p->im * q->re + p->re * q->im;
39 for (i = 0, p = pa, q = q0; i < n; ++i, p += n)
42 s = fabs(pd->
re) + fabs(pd->
im);
44 for (k = j + 1,
ps = pd; k < n; ++k) {
46 if ((
t = fabs(
ps->re) + fabs(
ps->im)) > s) {
62 for (k = 0; k < n; ++k) {
71 for (k = j + 1,
ps = pd + n; k < n; ++k,
ps += n) {
77 for (j = 1,
ps =
b + 1; j < n; ++j, ++
ps) {
78 for (k = 0, p = a + n * j, q =
b, z.
re = z.
im = 0.; k < j; ++k) {
87 for (j = n - 1, --
ps, pd = a + n * n - 1; j >= 0; --j, pd -= n + 1) {
88 for (k = j + 1, p = pd + 1, q =
b + j + 1, z.
re = z.
im = 0.; k < n;
int csolv(Cpx *a, Cpx *b, int n)