15 #define M_PI 3.14159265358979323846
18 int passb(
int *nac,
int *ido,
int *ip,
int *
19 l1,
int *idl1,
double *cc,
double *c1,
double *c2,
20 double *ch,
double *ch2,
double *wa)
23 int ch_dim1, ch_dim2, ch_offset, cc_dim1, cc_dim2, cc_offset, c1_dim1,
24 c1_dim2, c1_offset, c2_dim1, c2_offset, ch2_dim1, ch2_offset,
28 static int idij, idlj, idot, ipph, i, j, k, l, jc, lc, ik, nt, idj,
30 static double wai, war;
36 cc_offset = cc_dim1 * (cc_dim2 + 1) + 1;
40 c1_offset = c1_dim1 * (c1_dim2 + 1) + 1;
43 c2_offset = c2_dim1 + 1;
47 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
50 ch2_offset = ch2_dim1 + 1;
65 for (j = 2; j <= i_1; ++j) {
68 for (k = 1; k <= i_2; ++k) {
70 for (i = 1; i <= i_3; ++i) {
71 ch[i + (k + j * ch_dim2) * ch_dim1] = cc[i + (j + k * cc_dim2)
72 * cc_dim1] + cc[i + (jc + k * cc_dim2) * cc_dim1];
73 ch[i + (k + jc * ch_dim2) * ch_dim1] = cc[i + (j + k *
74 cc_dim2) * cc_dim1] - cc[i + (jc + k * cc_dim2) *
83 for (k = 1; k <= i_1; ++k) {
85 for (i = 1; i <= i_2; ++i) {
86 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + (k * cc_dim2 + 1) *
95 for (j = 2; j <= i_1; ++j) {
98 for (i = 1; i <= i_2; ++i) {
100 for (k = 1; k <= i_3; ++k) {
101 ch[i + (k + j * ch_dim2) * ch_dim1] = cc[i + (j + k * cc_dim2)
102 * cc_dim1] + cc[i + (jc + k * cc_dim2) * cc_dim1];
103 ch[i + (k + jc * ch_dim2) * ch_dim1] = cc[i + (j + k *
104 cc_dim2) * cc_dim1] - cc[i + (jc + k * cc_dim2) *
113 for (i = 1; i <= i_1; ++i) {
115 for (k = 1; k <= i_2; ++k) {
116 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + (k * cc_dim2 + 1) *
126 for (l = 2; l <= i_1; ++l) {
130 for (ik = 1; ik <= i_2; ++ik) {
131 c2[ik + l * c2_dim1] = ch2[ik + ch2_dim1] + wa[idl - 1] * ch2[ik
133 c2[ik + lc * c2_dim1] = wa[idl] * ch2[ik + *ip * ch2_dim1];
139 for (j = 3; j <= i_2; ++j) {
148 for (ik = 1; ik <= i_3; ++ik) {
149 c2[ik + l * c2_dim1] += war * ch2[ik + j * ch2_dim1];
150 c2[ik + lc * c2_dim1] += wai * ch2[ik + jc * ch2_dim1];
158 for (j = 2; j <= i_1; ++j) {
160 for (ik = 1; ik <= i_2; ++ik) {
161 ch2[ik + ch2_dim1] += ch2[ik + j * ch2_dim1];
167 for (j = 2; j <= i_1; ++j) {
170 for (ik = 2; ik <= i_2; ik += 2) {
171 ch2[ik - 1 + j * ch2_dim1] = c2[ik - 1 + j * c2_dim1] - c2[ik +
173 ch2[ik - 1 + jc * ch2_dim1] = c2[ik - 1 + j * c2_dim1] + c2[ik +
175 ch2[ik + j * ch2_dim1] = c2[ik + j * c2_dim1] + c2[ik - 1 + jc *
177 ch2[ik + jc * ch2_dim1] = c2[ik + j * c2_dim1] - c2[ik - 1 + jc *
189 for (ik = 1; ik <= i_1; ++ik) {
190 c2[ik + c2_dim1] = ch2[ik + ch2_dim1];
194 for (j = 2; j <= i_1; ++j) {
196 for (k = 1; k <= i_2; ++k) {
197 c1[(k + j * c1_dim2) * c1_dim1 + 1] = ch[(k + j * ch_dim2) *
199 c1[(k + j * c1_dim2) * c1_dim1 + 2] = ch[(k + j * ch_dim2) *
210 for (j = 2; j <= i_1; ++j) {
213 for (i = 4; i <= i_2; i += 2) {
216 for (k = 1; k <= i_3; ++k) {
217 c1[i - 1 + (k + j * c1_dim2) * c1_dim1] = wa[idij - 1] * ch[i
218 - 1 + (k + j * ch_dim2) * ch_dim1] - wa[idij] * ch[i
219 + (k + j * ch_dim2) * ch_dim1];
220 c1[i + (k + j * c1_dim2) * c1_dim1] = wa[idij - 1] * ch[i + (
221 k + j * ch_dim2) * ch_dim1] + wa[idij] * ch[i - 1 + (
222 k + j * ch_dim2) * ch_dim1];
233 for (j = 2; j <= i_1; ++j) {
236 for (k = 1; k <= i_2; ++k) {
239 for (i = 4; i <= i_3; i += 2) {
241 c1[i - 1 + (k + j * c1_dim2) * c1_dim1] = wa[idij - 1] * ch[i
242 - 1 + (k + j * ch_dim2) * ch_dim1] - wa[idij] * ch[i
243 + (k + j * ch_dim2) * ch_dim1];
244 c1[i + (k + j * c1_dim2) * c1_dim1] = wa[idij - 1] * ch[i + (
245 k + j * ch_dim2) * ch_dim1] + wa[idij] * ch[i - 1 + (
246 k + j * ch_dim2) * ch_dim1];
257 int passb2(
int *ido,
int *l1,
double *cc,
258 double *ch,
double *wa1)
261 int cc_dim1, cc_offset, ch_dim1, ch_dim2, ch_offset, i_1, i_2;
265 static double ti2, tr2;
269 cc_offset = cc_dim1 * 3 + 1;
273 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
282 for (k = 1; k <= i_1; ++k) {
283 ch[(k + ch_dim2) * ch_dim1 + 1] = cc[((k << 1) + 1) * cc_dim1 + 1] +
284 cc[((k << 1) + 2) * cc_dim1 + 1];
285 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 1] = cc[((k << 1) + 1) * cc_dim1
286 + 1] - cc[((k << 1) + 2) * cc_dim1 + 1];
287 ch[(k + ch_dim2) * ch_dim1 + 2] = cc[((k << 1) + 1) * cc_dim1 + 2] +
288 cc[((k << 1) + 2) * cc_dim1 + 2];
289 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 2] = cc[((k << 1) + 1) * cc_dim1
290 + 2] - cc[((k << 1) + 2) * cc_dim1 + 2];
296 for (k = 1; k <= i_1; ++k) {
298 for (i = 2; i <= i_2; i += 2) {
299 ch[i - 1 + (k + ch_dim2) * ch_dim1] = cc[i - 1 + ((k << 1) + 1) *
300 cc_dim1] + cc[i - 1 + ((k << 1) + 2) * cc_dim1];
301 tr2 = cc[i - 1 + ((k << 1) + 1) * cc_dim1] - cc[i - 1 + ((k << 1)
303 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + ((k << 1) + 1) * cc_dim1]
304 + cc[i + ((k << 1) + 2) * cc_dim1];
305 ti2 = cc[i + ((k << 1) + 1) * cc_dim1] - cc[i + ((k << 1) + 2) *
307 ch[i + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * ti2 + wa1[i]
309 ch[i - 1 + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * tr2 -
319 int passb3(
int *ido,
int *l1,
double *cc,
320 double *ch,
double *wa1,
double *wa2)
324 static double taur = -.5;
325 static double taui = .866025403784439;
328 int cc_dim1, cc_offset, ch_dim1, ch_dim2, ch_offset, i_1, i_2;
332 static double ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
336 cc_offset = (cc_dim1 << 2) + 1;
340 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
350 for (k = 1; k <= i_1; ++k) {
351 tr2 = cc[(k * 3 + 2) * cc_dim1 + 1] + cc[(k * 3 + 3) * cc_dim1 + 1];
352 cr2 = cc[(k * 3 + 1) * cc_dim1 + 1] + taur * tr2;
353 ch[(k + ch_dim2) * ch_dim1 + 1] = cc[(k * 3 + 1) * cc_dim1 + 1] + tr2;
355 ti2 = cc[(k * 3 + 2) * cc_dim1 + 2] + cc[(k * 3 + 3) * cc_dim1 + 2];
356 ci2 = cc[(k * 3 + 1) * cc_dim1 + 2] + taur * ti2;
357 ch[(k + ch_dim2) * ch_dim1 + 2] = cc[(k * 3 + 1) * cc_dim1 + 2] + ti2;
359 cr3 = taui * (cc[(k * 3 + 2) * cc_dim1 + 1] - cc[(k * 3 + 3) *
361 ci3 = taui * (cc[(k * 3 + 2) * cc_dim1 + 2] - cc[(k * 3 + 3) *
363 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 1] = cr2 - ci3;
364 ch[(k + ch_dim2 * 3) * ch_dim1 + 1] = cr2 + ci3;
365 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 2] = ci2 + cr3;
366 ch[(k + ch_dim2 * 3) * ch_dim1 + 2] = ci2 - cr3;
372 for (k = 1; k <= i_1; ++k) {
374 for (i = 2; i <= i_2; i += 2) {
375 tr2 = cc[i - 1 + (k * 3 + 2) * cc_dim1] + cc[i - 1 + (k * 3 + 3) *
377 cr2 = cc[i - 1 + (k * 3 + 1) * cc_dim1] + taur * tr2;
378 ch[i - 1 + (k + ch_dim2) * ch_dim1] = cc[i - 1 + (k * 3 + 1) *
380 ti2 = cc[i + (k * 3 + 2) * cc_dim1] + cc[i + (k * 3 + 3) *
382 ci2 = cc[i + (k * 3 + 1) * cc_dim1] + taur * ti2;
383 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + (k * 3 + 1) * cc_dim1] +
385 cr3 = taui * (cc[i - 1 + (k * 3 + 2) * cc_dim1] - cc[i - 1 + (k *
387 ci3 = taui * (cc[i + (k * 3 + 2) * cc_dim1] - cc[i + (k * 3 + 3) *
393 ch[i + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * di2 + wa1[i]
395 ch[i - 1 + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * dr2 -
397 ch[i + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * di3 + wa2[i] *
399 ch[i - 1 + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * dr3 - wa2[
408 int passb4(
int *ido,
int *l1,
double *cc,
409 double *ch,
double *wa1,
double *wa2,
double *wa3)
412 int cc_dim1, cc_offset, ch_dim1, ch_dim2, ch_offset, i_1, i_2;
416 static double ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1,
421 cc_offset = cc_dim1 * 5 + 1;
425 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
436 for (k = 1; k <= i_1; ++k) {
437 ti1 = cc[((k << 2) + 1) * cc_dim1 + 2] - cc[((k << 2) + 3) * cc_dim1
439 ti2 = cc[((k << 2) + 1) * cc_dim1 + 2] + cc[((k << 2) + 3) * cc_dim1
441 tr4 = cc[((k << 2) + 4) * cc_dim1 + 2] - cc[((k << 2) + 2) * cc_dim1
443 ti3 = cc[((k << 2) + 2) * cc_dim1 + 2] + cc[((k << 2) + 4) * cc_dim1
445 tr1 = cc[((k << 2) + 1) * cc_dim1 + 1] - cc[((k << 2) + 3) * cc_dim1
447 tr2 = cc[((k << 2) + 1) * cc_dim1 + 1] + cc[((k << 2) + 3) * cc_dim1
449 ti4 = cc[((k << 2) + 2) * cc_dim1 + 1] - cc[((k << 2) + 4) * cc_dim1
451 tr3 = cc[((k << 2) + 2) * cc_dim1 + 1] + cc[((k << 2) + 4) * cc_dim1
453 ch[(k + ch_dim2) * ch_dim1 + 1] = tr2 + tr3;
454 ch[(k + ch_dim2 * 3) * ch_dim1 + 1] = tr2 - tr3;
455 ch[(k + ch_dim2) * ch_dim1 + 2] = ti2 + ti3;
456 ch[(k + ch_dim2 * 3) * ch_dim1 + 2] = ti2 - ti3;
457 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 1] = tr1 + tr4;
458 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 1] = tr1 - tr4;
459 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 2] = ti1 + ti4;
460 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 2] = ti1 - ti4;
466 for (k = 1; k <= i_1; ++k) {
468 for (i = 2; i <= i_2; i += 2) {
469 ti1 = cc[i + ((k << 2) + 1) * cc_dim1] - cc[i + ((k << 2) + 3) *
471 ti2 = cc[i + ((k << 2) + 1) * cc_dim1] + cc[i + ((k << 2) + 3) *
473 ti3 = cc[i + ((k << 2) + 2) * cc_dim1] + cc[i + ((k << 2) + 4) *
475 tr4 = cc[i + ((k << 2) + 4) * cc_dim1] - cc[i + ((k << 2) + 2) *
477 tr1 = cc[i - 1 + ((k << 2) + 1) * cc_dim1] - cc[i - 1 + ((k << 2)
479 tr2 = cc[i - 1 + ((k << 2) + 1) * cc_dim1] + cc[i - 1 + ((k << 2)
481 ti4 = cc[i - 1 + ((k << 2) + 2) * cc_dim1] - cc[i - 1 + ((k << 2)
483 tr3 = cc[i - 1 + ((k << 2) + 2) * cc_dim1] + cc[i - 1 + ((k << 2)
485 ch[i - 1 + (k + ch_dim2) * ch_dim1] = tr2 + tr3;
487 ch[i + (k + ch_dim2) * ch_dim1] = ti2 + ti3;
493 ch[i - 1 + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * cr2 -
495 ch[i + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * ci2 + wa1[i]
497 ch[i - 1 + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * cr3 - wa2[
499 ch[i + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * ci3 + wa2[i] *
501 ch[i - 1 + (k + (ch_dim2 << 2)) * ch_dim1] = wa3[i - 1] * cr4 -
503 ch[i + (k + (ch_dim2 << 2)) * ch_dim1] = wa3[i - 1] * ci4 + wa3[i]
512 int passb5(
int *ido,
int *l1,
double *cc,
513 double *ch,
double *wa1,
double *wa2,
double *wa3,
518 static double tr11 = .309016994374947;
519 static double ti11 = .951056516295154;
520 static double tr12 = -.809016994374947;
521 static double ti12 = .587785252292473;
524 int cc_dim1, cc_offset, ch_dim1, ch_dim2, ch_offset, i_1, i_2;
528 static double ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5,
529 cr4, ti2, ti3, ti4, ti5, dr3, dr4, dr5, dr2, tr2, tr3, tr4, tr5;
533 cc_offset = cc_dim1 * 6 + 1;
537 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
549 for (k = 1; k <= i_1; ++k) {
550 ti5 = cc[(k * 5 + 2) * cc_dim1 + 2] - cc[(k * 5 + 5) * cc_dim1 + 2];
551 ti2 = cc[(k * 5 + 2) * cc_dim1 + 2] + cc[(k * 5 + 5) * cc_dim1 + 2];
552 ti4 = cc[(k * 5 + 3) * cc_dim1 + 2] - cc[(k * 5 + 4) * cc_dim1 + 2];
553 ti3 = cc[(k * 5 + 3) * cc_dim1 + 2] + cc[(k * 5 + 4) * cc_dim1 + 2];
554 tr5 = cc[(k * 5 + 2) * cc_dim1 + 1] - cc[(k * 5 + 5) * cc_dim1 + 1];
555 tr2 = cc[(k * 5 + 2) * cc_dim1 + 1] + cc[(k * 5 + 5) * cc_dim1 + 1];
556 tr4 = cc[(k * 5 + 3) * cc_dim1 + 1] - cc[(k * 5 + 4) * cc_dim1 + 1];
557 tr3 = cc[(k * 5 + 3) * cc_dim1 + 1] + cc[(k * 5 + 4) * cc_dim1 + 1];
558 ch[(k + ch_dim2) * ch_dim1 + 1] = cc[(k * 5 + 1) * cc_dim1 + 1] + tr2
560 ch[(k + ch_dim2) * ch_dim1 + 2] = cc[(k * 5 + 1) * cc_dim1 + 2] + ti2
562 cr2 = cc[(k * 5 + 1) * cc_dim1 + 1] + tr11 * tr2 + tr12 * tr3;
563 ci2 = cc[(k * 5 + 1) * cc_dim1 + 2] + tr11 * ti2 + tr12 * ti3;
564 cr3 = cc[(k * 5 + 1) * cc_dim1 + 1] + tr12 * tr2 + tr11 * tr3;
565 ci3 = cc[(k * 5 + 1) * cc_dim1 + 2] + tr12 * ti2 + tr11 * ti3;
566 cr5 = ti11 * tr5 + ti12 * tr4;
567 ci5 = ti11 * ti5 + ti12 * ti4;
568 cr4 = ti12 * tr5 - ti11 * tr4;
569 ci4 = ti12 * ti5 - ti11 * ti4;
570 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 1] = cr2 - ci5;
571 ch[(k + ch_dim2 * 5) * ch_dim1 + 1] = cr2 + ci5;
572 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 2] = ci2 + cr5;
573 ch[(k + ch_dim2 * 3) * ch_dim1 + 2] = ci3 + cr4;
574 ch[(k + ch_dim2 * 3) * ch_dim1 + 1] = cr3 - ci4;
575 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 1] = cr3 + ci4;
576 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 2] = ci3 - cr4;
577 ch[(k + ch_dim2 * 5) * ch_dim1 + 2] = ci2 - cr5;
583 for (k = 1; k <= i_1; ++k) {
585 for (i = 2; i <= i_2; i += 2) {
586 ti5 = cc[i + (k * 5 + 2) * cc_dim1] - cc[i + (k * 5 + 5) *
588 ti2 = cc[i + (k * 5 + 2) * cc_dim1] + cc[i + (k * 5 + 5) *
590 ti4 = cc[i + (k * 5 + 3) * cc_dim1] - cc[i + (k * 5 + 4) *
592 ti3 = cc[i + (k * 5 + 3) * cc_dim1] + cc[i + (k * 5 + 4) *
594 tr5 = cc[i - 1 + (k * 5 + 2) * cc_dim1] - cc[i - 1 + (k * 5 + 5) *
596 tr2 = cc[i - 1 + (k * 5 + 2) * cc_dim1] + cc[i - 1 + (k * 5 + 5) *
598 tr4 = cc[i - 1 + (k * 5 + 3) * cc_dim1] - cc[i - 1 + (k * 5 + 4) *
600 tr3 = cc[i - 1 + (k * 5 + 3) * cc_dim1] + cc[i - 1 + (k * 5 + 4) *
602 ch[i - 1 + (k + ch_dim2) * ch_dim1] = cc[i - 1 + (k * 5 + 1) *
603 cc_dim1] + tr2 + tr3;
604 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + (k * 5 + 1) * cc_dim1] +
606 cr2 = cc[i - 1 + (k * 5 + 1) * cc_dim1] + tr11 * tr2 + tr12 * tr3;
608 ci2 = cc[i + (k * 5 + 1) * cc_dim1] + tr11 * ti2 + tr12 * ti3;
609 cr3 = cc[i - 1 + (k * 5 + 1) * cc_dim1] + tr12 * tr2 + tr11 * tr3;
611 ci3 = cc[i + (k * 5 + 1) * cc_dim1] + tr12 * ti2 + tr11 * ti3;
612 cr5 = ti11 * tr5 + ti12 * tr4;
613 ci5 = ti11 * ti5 + ti12 * ti4;
614 cr4 = ti12 * tr5 - ti11 * tr4;
615 ci4 = ti12 * ti5 - ti11 * ti4;
624 ch[i - 1 + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * dr2 -
626 ch[i + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * di2 + wa1[i]
628 ch[i - 1 + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * dr3 - wa2[
630 ch[i + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * di3 + wa2[i] *
632 ch[i - 1 + (k + (ch_dim2 << 2)) * ch_dim1] = wa3[i - 1] * dr4 -
634 ch[i + (k + (ch_dim2 << 2)) * ch_dim1] = wa3[i - 1] * di4 + wa3[i]
636 ch[i - 1 + (k + ch_dim2 * 5) * ch_dim1] = wa4[i - 1] * dr5 - wa4[
638 ch[i + (k + ch_dim2 * 5) * ch_dim1] = wa4[i - 1] * di5 + wa4[i] *
647 int passf(
int *nac,
int *ido,
int *ip,
int *
648 l1,
int *idl1,
double *cc,
double *c1,
double *c2,
649 double *ch,
double *ch2,
double *wa)
652 int ch_dim1, ch_dim2, ch_offset, cc_dim1, cc_dim2, cc_offset, c1_dim1,
653 c1_dim2, c1_offset, c2_dim1, c2_offset, ch2_dim1, ch2_offset,
657 static int idij, idlj, idot, ipph, i, j, k, l, jc, lc, ik, nt, idj,
659 static double wai, war;
665 cc_offset = cc_dim1 * (cc_dim2 + 1) + 1;
669 c1_offset = c1_dim1 * (c1_dim2 + 1) + 1;
672 c2_offset = c2_dim1 + 1;
676 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
679 ch2_offset = ch2_dim1 + 1;
687 ipph = (*ip + 1) / 2;
694 for (j = 2; j <= i_1; ++j) {
697 for (k = 1; k <= i_2; ++k) {
699 for (i = 1; i <= i_3; ++i) {
700 ch[i + (k + j * ch_dim2) * ch_dim1] = cc[i + (j + k * cc_dim2)
701 * cc_dim1] + cc[i + (jc + k * cc_dim2) * cc_dim1];
702 ch[i + (k + jc * ch_dim2) * ch_dim1] = cc[i + (j + k *
703 cc_dim2) * cc_dim1] - cc[i + (jc + k * cc_dim2) *
712 for (k = 1; k <= i_1; ++k) {
714 for (i = 1; i <= i_2; ++i) {
715 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + (k * cc_dim2 + 1) *
724 for (j = 2; j <= i_1; ++j) {
727 for (i = 1; i <= i_2; ++i) {
729 for (k = 1; k <= i_3; ++k) {
730 ch[i + (k + j * ch_dim2) * ch_dim1] = cc[i + (j + k * cc_dim2)
731 * cc_dim1] + cc[i + (jc + k * cc_dim2) * cc_dim1];
732 ch[i + (k + jc * ch_dim2) * ch_dim1] = cc[i + (j + k *
733 cc_dim2) * cc_dim1] - cc[i + (jc + k * cc_dim2) *
742 for (i = 1; i <= i_1; ++i) {
744 for (k = 1; k <= i_2; ++k) {
745 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + (k * cc_dim2 + 1) *
755 for (l = 2; l <= i_1; ++l) {
759 for (ik = 1; ik <= i_2; ++ik) {
760 c2[ik + l * c2_dim1] = ch2[ik + ch2_dim1] + wa[idl - 1] * ch2[ik
762 c2[ik + lc * c2_dim1] = -wa[idl] * ch2[ik + *ip * ch2_dim1];
768 for (j = 3; j <= i_2; ++j) {
777 for (ik = 1; ik <= i_3; ++ik) {
778 c2[ik + l * c2_dim1] += war * ch2[ik + j * ch2_dim1];
779 c2[ik + lc * c2_dim1] -= wai * ch2[ik + jc * ch2_dim1];
787 for (j = 2; j <= i_1; ++j) {
789 for (ik = 1; ik <= i_2; ++ik) {
790 ch2[ik + ch2_dim1] += ch2[ik + j * ch2_dim1];
796 for (j = 2; j <= i_1; ++j) {
799 for (ik = 2; ik <= i_2; ik += 2) {
800 ch2[ik - 1 + j * ch2_dim1] = c2[ik - 1 + j * c2_dim1] - c2[ik +
802 ch2[ik - 1 + jc * ch2_dim1] = c2[ik - 1 + j * c2_dim1] + c2[ik +
804 ch2[ik + j * ch2_dim1] = c2[ik + j * c2_dim1] + c2[ik - 1 + jc *
806 ch2[ik + jc * ch2_dim1] = c2[ik + j * c2_dim1] - c2[ik - 1 + jc *
818 for (ik = 1; ik <= i_1; ++ik) {
819 c2[ik + c2_dim1] = ch2[ik + ch2_dim1];
823 for (j = 2; j <= i_1; ++j) {
825 for (k = 1; k <= i_2; ++k) {
826 c1[(k + j * c1_dim2) * c1_dim1 + 1] = ch[(k + j * ch_dim2) *
828 c1[(k + j * c1_dim2) * c1_dim1 + 2] = ch[(k + j * ch_dim2) *
839 for (j = 2; j <= i_1; ++j) {
842 for (i = 4; i <= i_2; i += 2) {
845 for (k = 1; k <= i_3; ++k) {
846 c1[i - 1 + (k + j * c1_dim2) * c1_dim1] = wa[idij - 1] * ch[i
847 - 1 + (k + j * ch_dim2) * ch_dim1] + wa[idij] * ch[i
848 + (k + j * ch_dim2) * ch_dim1];
849 c1[i + (k + j * c1_dim2) * c1_dim1] = wa[idij - 1] * ch[i + (
850 k + j * ch_dim2) * ch_dim1] - wa[idij] * ch[i - 1 + (
851 k + j * ch_dim2) * ch_dim1];
862 for (j = 2; j <= i_1; ++j) {
865 for (k = 1; k <= i_2; ++k) {
868 for (i = 4; i <= i_3; i += 2) {
870 c1[i - 1 + (k + j * c1_dim2) * c1_dim1] = wa[idij - 1] * ch[i
871 - 1 + (k + j * ch_dim2) * ch_dim1] + wa[idij] * ch[i
872 + (k + j * ch_dim2) * ch_dim1];
873 c1[i + (k + j * c1_dim2) * c1_dim1] = wa[idij - 1] * ch[i + (
874 k + j * ch_dim2) * ch_dim1] - wa[idij] * ch[i - 1 + (
875 k + j * ch_dim2) * ch_dim1];
885 int passf2(
int *ido,
int *l1,
double *cc,
886 double *ch,
double *wa1)
889 int cc_dim1, cc_offset, ch_dim1, ch_dim2, ch_offset, i_1, i_2;
893 static double ti2, tr2;
897 cc_offset = cc_dim1 * 3 + 1;
901 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
910 for (k = 1; k <= i_1; ++k) {
911 ch[(k + ch_dim2) * ch_dim1 + 1] = cc[((k << 1) + 1) * cc_dim1 + 1] +
912 cc[((k << 1) + 2) * cc_dim1 + 1];
913 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 1] = cc[((k << 1) + 1) * cc_dim1
914 + 1] - cc[((k << 1) + 2) * cc_dim1 + 1];
915 ch[(k + ch_dim2) * ch_dim1 + 2] = cc[((k << 1) + 1) * cc_dim1 + 2] +
916 cc[((k << 1) + 2) * cc_dim1 + 2];
917 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 2] = cc[((k << 1) + 1) * cc_dim1
918 + 2] - cc[((k << 1) + 2) * cc_dim1 + 2];
924 for (k = 1; k <= i_1; ++k) {
926 for (i = 2; i <= i_2; i += 2) {
927 ch[i - 1 + (k + ch_dim2) * ch_dim1] = cc[i - 1 + ((k << 1) + 1) *
928 cc_dim1] + cc[i - 1 + ((k << 1) + 2) * cc_dim1];
929 tr2 = cc[i - 1 + ((k << 1) + 1) * cc_dim1] - cc[i - 1 + ((k << 1)
931 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + ((k << 1) + 1) * cc_dim1]
932 + cc[i + ((k << 1) + 2) * cc_dim1];
933 ti2 = cc[i + ((k << 1) + 1) * cc_dim1] - cc[i + ((k << 1) + 2) *
935 ch[i + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * ti2 - wa1[i]
937 ch[i - 1 + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * tr2 +
946 int passf3(
int *ido,
int *l1,
double *cc,
947 double *ch,
double *wa1,
double *wa2)
951 static double taur = -.5;
952 static double taui = -.866025403784439;
955 int cc_dim1, cc_offset, ch_dim1, ch_dim2, ch_offset, i_1, i_2;
959 static double ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
963 cc_offset = (cc_dim1 << 2) + 1;
967 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
977 for (k = 1; k <= i_1; ++k) {
978 tr2 = cc[(k * 3 + 2) * cc_dim1 + 1] + cc[(k * 3 + 3) * cc_dim1 + 1];
979 cr2 = cc[(k * 3 + 1) * cc_dim1 + 1] + taur * tr2;
980 ch[(k + ch_dim2) * ch_dim1 + 1] = cc[(k * 3 + 1) * cc_dim1 + 1] + tr2;
982 ti2 = cc[(k * 3 + 2) * cc_dim1 + 2] + cc[(k * 3 + 3) * cc_dim1 + 2];
983 ci2 = cc[(k * 3 + 1) * cc_dim1 + 2] + taur * ti2;
984 ch[(k + ch_dim2) * ch_dim1 + 2] = cc[(k * 3 + 1) * cc_dim1 + 2] + ti2;
986 cr3 = taui * (cc[(k * 3 + 2) * cc_dim1 + 1] - cc[(k * 3 + 3) *
988 ci3 = taui * (cc[(k * 3 + 2) * cc_dim1 + 2] - cc[(k * 3 + 3) *
990 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 1] = cr2 - ci3;
991 ch[(k + ch_dim2 * 3) * ch_dim1 + 1] = cr2 + ci3;
992 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 2] = ci2 + cr3;
993 ch[(k + ch_dim2 * 3) * ch_dim1 + 2] = ci2 - cr3;
999 for (k = 1; k <= i_1; ++k) {
1001 for (i = 2; i <= i_2; i += 2) {
1002 tr2 = cc[i - 1 + (k * 3 + 2) * cc_dim1] + cc[i - 1 + (k * 3 + 3) *
1004 cr2 = cc[i - 1 + (k * 3 + 1) * cc_dim1] + taur * tr2;
1005 ch[i - 1 + (k + ch_dim2) * ch_dim1] = cc[i - 1 + (k * 3 + 1) *
1007 ti2 = cc[i + (k * 3 + 2) * cc_dim1] + cc[i + (k * 3 + 3) *
1009 ci2 = cc[i + (k * 3 + 1) * cc_dim1] + taur * ti2;
1010 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + (k * 3 + 1) * cc_dim1] +
1012 cr3 = taui * (cc[i - 1 + (k * 3 + 2) * cc_dim1] - cc[i - 1 + (k *
1014 ci3 = taui * (cc[i + (k * 3 + 2) * cc_dim1] - cc[i + (k * 3 + 3) *
1020 ch[i + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * di2 - wa1[i]
1022 ch[i - 1 + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * dr2 +
1024 ch[i + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * di3 - wa2[i] *
1026 ch[i - 1 + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * dr3 + wa2[
1036 double *ch,
double *wa1,
double *wa2,
double *wa3)
1039 int cc_dim1, cc_offset, ch_dim1, ch_dim2, ch_offset, i_1, i_2;
1043 static double ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1,
1048 cc_offset = cc_dim1 * 5 + 1;
1052 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
1063 for (k = 1; k <= i_1; ++k) {
1064 ti1 = cc[((k << 2) + 1) * cc_dim1 + 2] - cc[((k << 2) + 3) * cc_dim1
1066 ti2 = cc[((k << 2) + 1) * cc_dim1 + 2] + cc[((k << 2) + 3) * cc_dim1
1068 tr4 = cc[((k << 2) + 2) * cc_dim1 + 2] - cc[((k << 2) + 4) * cc_dim1
1070 ti3 = cc[((k << 2) + 2) * cc_dim1 + 2] + cc[((k << 2) + 4) * cc_dim1
1072 tr1 = cc[((k << 2) + 1) * cc_dim1 + 1] - cc[((k << 2) + 3) * cc_dim1
1074 tr2 = cc[((k << 2) + 1) * cc_dim1 + 1] + cc[((k << 2) + 3) * cc_dim1
1076 ti4 = cc[((k << 2) + 4) * cc_dim1 + 1] - cc[((k << 2) + 2) * cc_dim1
1078 tr3 = cc[((k << 2) + 2) * cc_dim1 + 1] + cc[((k << 2) + 4) * cc_dim1
1080 ch[(k + ch_dim2) * ch_dim1 + 1] = tr2 + tr3;
1081 ch[(k + ch_dim2 * 3) * ch_dim1 + 1] = tr2 - tr3;
1082 ch[(k + ch_dim2) * ch_dim1 + 2] = ti2 + ti3;
1083 ch[(k + ch_dim2 * 3) * ch_dim1 + 2] = ti2 - ti3;
1084 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 1] = tr1 + tr4;
1085 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 1] = tr1 - tr4;
1086 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 2] = ti1 + ti4;
1087 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 2] = ti1 - ti4;
1093 for (k = 1; k <= i_1; ++k) {
1095 for (i = 2; i <= i_2; i += 2) {
1096 ti1 = cc[i + ((k << 2) + 1) * cc_dim1] - cc[i + ((k << 2) + 3) *
1098 ti2 = cc[i + ((k << 2) + 1) * cc_dim1] + cc[i + ((k << 2) + 3) *
1100 ti3 = cc[i + ((k << 2) + 2) * cc_dim1] + cc[i + ((k << 2) + 4) *
1102 tr4 = cc[i + ((k << 2) + 2) * cc_dim1] - cc[i + ((k << 2) + 4) *
1104 tr1 = cc[i - 1 + ((k << 2) + 1) * cc_dim1] - cc[i - 1 + ((k << 2)
1106 tr2 = cc[i - 1 + ((k << 2) + 1) * cc_dim1] + cc[i - 1 + ((k << 2)
1108 ti4 = cc[i - 1 + ((k << 2) + 4) * cc_dim1] - cc[i - 1 + ((k << 2)
1110 tr3 = cc[i - 1 + ((k << 2) + 2) * cc_dim1] + cc[i - 1 + ((k << 2)
1112 ch[i - 1 + (k + ch_dim2) * ch_dim1] = tr2 + tr3;
1114 ch[i + (k + ch_dim2) * ch_dim1] = ti2 + ti3;
1120 ch[i - 1 + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * cr2 +
1122 ch[i + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * ci2 - wa1[i]
1124 ch[i - 1 + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * cr3 + wa2[
1126 ch[i + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * ci3 - wa2[i] *
1128 ch[i - 1 + (k + (ch_dim2 << 2)) * ch_dim1] = wa3[i - 1] * cr4 +
1130 ch[i + (k + (ch_dim2 << 2)) * ch_dim1] = wa3[i - 1] * ci4 - wa3[i]
1140 double *ch,
double *wa1,
double *wa2,
double *wa3,
1145 static double tr11 = .309016994374947;
1146 static double ti11 = -.951056516295154;
1147 static double tr12 = -.809016994374947;
1148 static double ti12 = -.587785252292473;
1151 int cc_dim1, cc_offset, ch_dim1, ch_dim2, ch_offset, i_1, i_2;
1155 static double ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5,
1156 cr4, ti2, ti3, ti4, ti5, dr3, dr4, dr5, dr2, tr2, tr3, tr4, tr5;
1160 cc_offset = cc_dim1 * 6 + 1;
1164 ch_offset = ch_dim1 * (ch_dim2 + 1) + 1;
1176 for (k = 1; k <= i_1; ++k) {
1177 ti5 = cc[(k * 5 + 2) * cc_dim1 + 2] - cc[(k * 5 + 5) * cc_dim1 + 2];
1178 ti2 = cc[(k * 5 + 2) * cc_dim1 + 2] + cc[(k * 5 + 5) * cc_dim1 + 2];
1179 ti4 = cc[(k * 5 + 3) * cc_dim1 + 2] - cc[(k * 5 + 4) * cc_dim1 + 2];
1180 ti3 = cc[(k * 5 + 3) * cc_dim1 + 2] + cc[(k * 5 + 4) * cc_dim1 + 2];
1181 tr5 = cc[(k * 5 + 2) * cc_dim1 + 1] - cc[(k * 5 + 5) * cc_dim1 + 1];
1182 tr2 = cc[(k * 5 + 2) * cc_dim1 + 1] + cc[(k * 5 + 5) * cc_dim1 + 1];
1183 tr4 = cc[(k * 5 + 3) * cc_dim1 + 1] - cc[(k * 5 + 4) * cc_dim1 + 1];
1184 tr3 = cc[(k * 5 + 3) * cc_dim1 + 1] + cc[(k * 5 + 4) * cc_dim1 + 1];
1185 ch[(k + ch_dim2) * ch_dim1 + 1] = cc[(k * 5 + 1) * cc_dim1 + 1] + tr2
1187 ch[(k + ch_dim2) * ch_dim1 + 2] = cc[(k * 5 + 1) * cc_dim1 + 2] + ti2
1189 cr2 = cc[(k * 5 + 1) * cc_dim1 + 1] + tr11 * tr2 + tr12 * tr3;
1190 ci2 = cc[(k * 5 + 1) * cc_dim1 + 2] + tr11 * ti2 + tr12 * ti3;
1191 cr3 = cc[(k * 5 + 1) * cc_dim1 + 1] + tr12 * tr2 + tr11 * tr3;
1192 ci3 = cc[(k * 5 + 1) * cc_dim1 + 2] + tr12 * ti2 + tr11 * ti3;
1193 cr5 = ti11 * tr5 + ti12 * tr4;
1194 ci5 = ti11 * ti5 + ti12 * ti4;
1195 cr4 = ti12 * tr5 - ti11 * tr4;
1196 ci4 = ti12 * ti5 - ti11 * ti4;
1197 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 1] = cr2 - ci5;
1198 ch[(k + ch_dim2 * 5) * ch_dim1 + 1] = cr2 + ci5;
1199 ch[(k + (ch_dim2 << 1)) * ch_dim1 + 2] = ci2 + cr5;
1200 ch[(k + ch_dim2 * 3) * ch_dim1 + 2] = ci3 + cr4;
1201 ch[(k + ch_dim2 * 3) * ch_dim1 + 1] = cr3 - ci4;
1202 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 1] = cr3 + ci4;
1203 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 2] = ci3 - cr4;
1204 ch[(k + ch_dim2 * 5) * ch_dim1 + 2] = ci2 - cr5;
1210 for (k = 1; k <= i_1; ++k) {
1212 for (i = 2; i <= i_2; i += 2) {
1213 ti5 = cc[i + (k * 5 + 2) * cc_dim1] - cc[i + (k * 5 + 5) *
1215 ti2 = cc[i + (k * 5 + 2) * cc_dim1] + cc[i + (k * 5 + 5) *
1217 ti4 = cc[i + (k * 5 + 3) * cc_dim1] - cc[i + (k * 5 + 4) *
1219 ti3 = cc[i + (k * 5 + 3) * cc_dim1] + cc[i + (k * 5 + 4) *
1221 tr5 = cc[i - 1 + (k * 5 + 2) * cc_dim1] - cc[i - 1 + (k * 5 + 5) *
1223 tr2 = cc[i - 1 + (k * 5 + 2) * cc_dim1] + cc[i - 1 + (k * 5 + 5) *
1225 tr4 = cc[i - 1 + (k * 5 + 3) * cc_dim1] - cc[i - 1 + (k * 5 + 4) *
1227 tr3 = cc[i - 1 + (k * 5 + 3) * cc_dim1] + cc[i - 1 + (k * 5 + 4) *
1229 ch[i - 1 + (k + ch_dim2) * ch_dim1] = cc[i - 1 + (k * 5 + 1) *
1230 cc_dim1] + tr2 + tr3;
1231 ch[i + (k + ch_dim2) * ch_dim1] = cc[i + (k * 5 + 1) * cc_dim1] +
1233 cr2 = cc[i - 1 + (k * 5 + 1) * cc_dim1] + tr11 * tr2 + tr12 * tr3;
1235 ci2 = cc[i + (k * 5 + 1) * cc_dim1] + tr11 * ti2 + tr12 * ti3;
1236 cr3 = cc[i - 1 + (k * 5 + 1) * cc_dim1] + tr12 * tr2 + tr11 * tr3;
1238 ci3 = cc[i + (k * 5 + 1) * cc_dim1] + tr12 * ti2 + tr11 * ti3;
1239 cr5 = ti11 * tr5 + ti12 * tr4;
1240 ci5 = ti11 * ti5 + ti12 * ti4;
1241 cr4 = ti12 * tr5 - ti11 * tr4;
1242 ci4 = ti12 * ti5 - ti11 * ti4;
1251 ch[i - 1 + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * dr2 +
1253 ch[i + (k + (ch_dim2 << 1)) * ch_dim1] = wa1[i - 1] * di2 - wa1[i]
1255 ch[i - 1 + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * dr3 + wa2[
1257 ch[i + (k + ch_dim2 * 3) * ch_dim1] = wa2[i - 1] * di3 - wa2[i] *
1259 ch[i - 1 + (k + (ch_dim2 << 2)) * ch_dim1] = wa3[i - 1] * dr4 +
1261 ch[i + (k + (ch_dim2 << 2)) * ch_dim1] = wa3[i - 1] * di4 - wa3[i]
1263 ch[i - 1 + (k + ch_dim2 * 5) * ch_dim1] = wa4[i - 1] * dr5 + wa4[
1265 ch[i + (k + ch_dim2 * 5) * ch_dim1] = wa4[i - 1] * di5 - wa4[i] *
1274 int passb4(
int *ido,
int *l1,
double *cc,
1275 double *ch,
double *wa1,
double *wa2,
double *wa3);
1278 double *wa,
int *ifac)
1285 static int k1, l1, l2, n2;
1286 static int na, nf, ip, iw, ix2, ix3, ix4, nac, ido, idl1;
1300 for (k1 = 1; k1 <= i_1; ++k1) {
1314 passb4(&idot, &l1, &c[1], &ch[1], &wa[iw], &wa[ix2], &wa[ix3]);
1317 passb4(&idot, &l1, &ch[1], &c[1], &wa[iw], &wa[ix2], &wa[ix3]);
1328 passb2(&idot, &l1, &c[1], &ch[1], &wa[iw]);
1331 passb2(&idot, &l1, &ch[1], &c[1], &wa[iw]);
1343 passb3(&idot, &l1, &c[1], &ch[1], &wa[iw], &wa[ix2]);
1346 passb3(&idot, &l1, &ch[1], &c[1], &wa[iw], &wa[ix2]);
1360 passb5(&idot, &l1, &c[1], &ch[1], &wa[iw], &wa[ix2], &wa[ix3], &wa[
1364 passb5(&idot, &l1, &ch[1], &c[1], &wa[iw], &wa[ix2], &wa[ix3], &wa[
1373 passb(&nac, &idot, &ip, &l1, &idl1, &c[1], &c[1], &c[1], &ch[1], &ch[
1377 passb(&nac, &idot, &ip, &l1, &idl1, &ch[1], &ch[1], &ch[1], &c[1], &
1385 iw += (ip - 1) * idot;
1393 for (i = 1; i <= i_1; ++i) {
1401 int cfftb(
int *n,
double *c,
double *wsave)
1403 static int iw1, iw2;
1414 iw2 = iw1 + *n + *n;
1415 cfftb1(n, &c[1], &wsave[1], &wsave[iw1], (
int*) &wsave[iw2]);
1421 double *wa,
int *ifac)
1428 static int k1, l1, l2, n2;
1429 static int na, nf, ip, iw, ix2, ix3, ix4, nac, ido, idl1;
1443 for (k1 = 1; k1 <= i_1; ++k1) {
1457 passf4(&idot, &l1, &c[1], &ch[1], &wa[iw], &wa[ix2], &wa[ix3]);
1460 passf4(&idot, &l1, &ch[1], &c[1], &wa[iw], &wa[ix2], &wa[ix3]);
1471 passf2(&idot, &l1, &c[1], &ch[1], &wa[iw]);
1474 passf2(&idot, &l1, &ch[1], &c[1], &wa[iw]);
1486 passf3(&idot, &l1, &c[1], &ch[1], &wa[iw], &wa[ix2]);
1489 passf3(&idot, &l1, &ch[1], &c[1], &wa[iw], &wa[ix2]);
1503 passf5(&idot, &l1, &c[1], &ch[1], &wa[iw], &wa[ix2], &wa[ix3], &wa[
1507 passf5(&idot, &l1, &ch[1], &c[1], &wa[iw], &wa[ix2], &wa[ix3], &wa[
1516 passf(&nac, &idot, &ip, &l1, &idl1, &c[1], &c[1], &c[1], &ch[1], &ch[
1520 passf(&nac, &idot, &ip, &l1, &idl1, &ch[1], &ch[1], &ch[1], &c[1], &
1528 iw += (ip - 1) * idot;
1536 for (i = 1; i <= i_1; ++i) {
1544 int cfftf(
int *n,
double *c,
double *wsave)
1546 static int iw1, iw2;
1557 iw2 = iw1 + *n + *n;
1558 cfftf1(n, &c[1], &wsave[1], &wsave[iw1], (
int*) &wsave[iw2]);
1567 static int ntryh[4] = { 3,4,2,5 };
1574 static int idot, ntry, i, j;
1575 static double argld;
1576 static int i1, k1, l1, l2, ib;
1578 static int ld, ii, nf, ip, nl, nq, nr;
1580 static int ido, ipm;
1599 ntry = ntryh[j - 1];
1605 nr = nl - ntry * nq;
1613 ifac[nf + 2] = ntry;
1622 for (i = 2; i <= i_1; ++i) {
1624 ifac[ib + 2] = ifac[ib + 1];
1634 tpi = 6.28318530717959;
1635 argh = tpi / (double) (*n);
1639 for (k1 = 1; k1 <= i_1; ++k1) {
1644 idot = ido + ido + 2;
1647 for (j = 1; j <= i_2; ++j) {
1653 argld = (double) ld * argh;
1655 for (ii = 4; ii <= i_3; ii += 2) {
1659 wa[i - 1] = cos(arg);
1666 wa[i1 - 1] = wa[i - 1];
1678 static int iw1, iw2;
1688 iw2 = iw1 + *n + *n;
1689 cffti1(n, &wsave[iw1], (
int*) &wsave[iw2]);
1707 double *table,
int *ntable)
1710 int table_dim1, table_offset;
1715 table_dim1 = *ntable;
1716 table_offset = table_dim1 + 1;
1717 table -= table_offset;
1721 cffti(n1, &table[table_dim1 + 1]);
1722 cffti(n2, &table[(table_dim1 << 1) + 1]);
1723 cffti(n3, &table[table_dim1 * 3 + 1]);
1734 int w_dim1, w_dim2, w_offset, table_dim1, table_offset, i_1, i_2, i_3,
1743 w_offset = w_dim1 * (w_dim2 + 1) + 1;
1745 table_dim1 = *ntable;
1746 table_offset = table_dim1 + 1;
1747 table -= table_offset;
1757 for (k = 1; k <= i_1; ++k) {
1759 for (j = 1; j <= i_2; ++j) {
1761 for (i = 1; i <= i_3; ++i) {
1763 i_5 = i + (j + k * w_dim2) * w_dim1;
1764 work[i_4].
r = w[i_5].r, work[i_4].
i = w[i_5].i;
1768 cfftf(n1, (
double*) &work[1], &table[table_dim1 + 1]);
1771 cfftb(n1, (
double*) &work[1], &table[table_dim1 + 1]);
1774 for (i = 1; i <= i_3; ++i) {
1775 i_4 = i + (j + k * w_dim2) * w_dim1;
1777 w[i_4].r = work[i_5].
r, w[i_4].i = work[i_5].
i;
1788 for (k = 1; k <= i_1; ++k) {
1790 for (i = 1; i <= i_2; ++i) {
1792 for (j = 1; j <= i_3; ++j) {
1794 i_5 = i + (j + k * w_dim2) * w_dim1;
1795 work[i_4].
r = w[i_5].r, work[i_4].
i = w[i_5].i;
1799 cfftf(n2, (
double*) &work[1], &table[(table_dim1 << 1) + 1]);
1802 cfftb(n2, (
double*) &work[1], &table[(table_dim1 << 1) + 1]);
1805 for (j = 1; j <= i_3; ++j) {
1806 i_4 = i + (j + k * w_dim2) * w_dim1;
1808 w[i_4].r = work[i_5].
r, w[i_4].i = work[i_5].
i;
1819 for (i = 1; i <= i_1; ++i) {
1821 for (j = 1; j <= i_2; ++j) {
1823 for (k = 1; k <= i_3; ++k) {
1825 i_5 = i + (j + k * w_dim2) * w_dim1;
1826 work[i_4].
r = w[i_5].r, work[i_4].
i = w[i_5].i;
1830 cfftf(n3, (
double*) &work[1], &table[table_dim1 * 3 + 1]);
1833 cfftb(n3, (
double*) &work[1], &table[table_dim1 * 3 + 1]);
1836 for (k = 1; k <= i_3; ++k) {
1837 i_4 = i + (j + k * w_dim2) * w_dim1;
1839 w[i_4].r = work[i_5].
r, w[i_4].i = work[i_5].
i;
1851 int pubd3di(
int n1,
int n2,
int n3,
double *table,
int ntable) {
1856 return pubz3di(&n1over2,&n2,&n3,table,&ntable);
1864 int n3,
double *w,
int ld1,
int ld2,
double
1865 *table,
int ntable,
double *work) {
1867 int n1over2, ld1over2, rval;
1868 int i, j, j2, k, k2, i1, i2, imax;
1869 double *data, *data2;
1870 double TwoPiOverN, tmp1r, tmp1i, tmp2r, tmp2i;
1879 TwoPiOverN = isign * 2.0 *
M_PI / n1;
1881 for ( i=0; i<imax; ++i ) {
1882 work[2*i] = cos(i * TwoPiOverN);
1883 work[2*i+1] = sin(i * TwoPiOverN);
1885 for ( k=0; k<n3; ++k ) {
1886 for ( j=0; j<n2; ++j ) {
1887 data = w + ld1*(ld2*k + j);
1889 data[n1+1] = data[1];
1892 for ( k=0; k<n3; ++k ) {
1894 for ( j=0; j<n2; ++j ) {
1896 data = w + ld1*(ld2*k + j);
1897 data2 = w + ld1*(ld2*k2 + j2);
1899 if ( (n1/2) & 1 ) imax += 1;
1901 if ( (2*j<n2) || (2*j==n2 && 2*k<=n3) ) imax +=1;
1902 if ( j==0 && 2*k>n3 ) imax -=1;
1904 for ( i=0; i<imax; ++i ) {
1905 i1 = 2*i; i2 = n1-i1;
1906 tmp1r = data[i1] - data2[i2];
1907 tmp1i = data[i1+1] + data2[i2+1];
1908 tmp2r = tmp1r * work[i1+1] + tmp1i * work[i1];
1909 tmp2i = tmp1i * work[i1+1] - tmp1r * work[i1];
1910 tmp1r = data[i1] + data2[i2];
1911 tmp1i = data[i1+1] - data2[i2+1];
1912 data[i1] = 0.5 * ( tmp1r + tmp2r );
1913 data[i1+1] = 0.5 * ( tmp1i + tmp2i );
1914 data2[i2] = 0.5 * ( tmp1r - tmp2r );
1915 data2[i2+1] = 0.5 * ( tmp2i - tmp1i );
1928 int n3,
double *w,
int ld1,
int ld2,
double
1929 *table,
int ntable,
double *work) {
1931 int n1over2, ld1over2;
1932 int i, j, j2, k, k2, i1, i2, imax;
1933 double *data, *data2;
1934 double TwoPiOverN, tmp1r, tmp1i, tmp2r, tmp2i;
1937 TwoPiOverN = isign * 2.0 *
M_PI / n1;
1939 for ( i=0; i<imax; ++i ) {
1940 work[2*i] = -cos(i * TwoPiOverN);
1941 work[2*i+1] = -sin(i * TwoPiOverN);
1943 for ( k=0; k<n3; ++k ) {
1945 for ( j=0; j<n2; ++j ) {
1947 data = w + ld1*(ld2*k + j);
1948 data2 = w + ld1*(ld2*k2 + j2);
1950 if ( (n1/2) & 1 ) imax += 1;
1952 if ( (2*j<n2) || (2*j==n2 && 2*k<=n3) ) imax +=1;
1953 if ( j==0 && 2*k>n3 ) imax -=1;
1955 for ( i=0; i<imax; ++i ) {
1956 i1 = 2*i; i2 = n1-i1;
1957 tmp1r = data[i1] - data2[i2];
1958 tmp1i = data[i1+1] + data2[i2+1];
1959 tmp2r = tmp1r * work[i1+1] + tmp1i * work[i1];
1960 tmp2i = tmp1i * work[i1+1] - tmp1r * work[i1];
1961 tmp1r = data[i1] + data2[i2];
1962 tmp1i = data[i1+1] - data2[i2+1];
1963 data[i1] = tmp1r + tmp2r;
1964 data[i1+1] = tmp1i + tmp2i;
1965 data2[i2] = tmp1r - tmp2r;
1966 data2[i2+1] = tmp2i - tmp1i;
int cfftb(int *n, double *c, double *wsave)
int pubdz3d(int isign, int n1, int n2, int n3, double *w, int ld1, int ld2, double *table, int ntable, double *work)
int passf5(int *ido, int *l1, double *cc, double *ch, double *wa1, double *wa2, double *wa3, double *wa4)
int cfftf1(int *n, double *c, double *ch, double *wa, int *ifac)
int passf3(int *ido, int *l1, double *cc, double *ch, double *wa1, double *wa2)
int passf(int *nac, int *ido, int *ip, int *l1, int *idl1, double *cc, double *c1, double *c2, double *ch, double *ch2, double *wa)
int cffti1(int *n, double *wa, int *ifac)
int passf4(int *ido, int *l1, double *cc, double *ch, double *wa1, double *wa2, double *wa3)
int pubz3di(int *n1, int *n2, int *n3, double *table, int *ntable)
int passb4(int *ido, int *l1, double *cc, double *ch, double *wa1, double *wa2, double *wa3)
int cfftf(int *n, double *c, double *wsave)
int pubzd3d(int isign, int n1, int n2, int n3, double *w, int ld1, int ld2, double *table, int ntable, double *work)
int cfftb1(int *n, double *c, double *ch, double *wa, int *ifac)
int passf2(int *ido, int *l1, double *cc, double *ch, double *wa1)
int passb2(int *ido, int *l1, double *cc, double *ch, double *wa1)
int pubd3di(int n1, int n2, int n3, double *table, int ntable)
int cffti(int *n, double *wsave)
int pubz3d(int *isign, int *n1, int *n2, int *n3, doublecomplex *w, int *ld1, int *ld2, double *table, int *ntable, doublecomplex *work)
int passb3(int *ido, int *l1, double *cc, double *ch, double *wa1, double *wa2)
int passb5(int *ido, int *l1, double *cc, double *ch, double *wa1, double *wa2, double *wa3, double *wa4)
int passb(int *nac, int *ido, int *ip, int *l1, int *idl1, double *cc, double *c1, double *c2, double *ch, double *ch2, double *wa)