1 /* from fftpkg package in cmlib and netlib -- translated by f2c and modified */
9 static int cffti1_(int *n
, double *wa
, double *ifac
)
11 /* Initialized data */
12 static int ntryh
[4] = { 3,4,2,5 };
14 /* System generated locals */
27 long ip
, ld
, nl
, nq
, nr
;
32 /* Parameter adjustments */
43 if (j
- 4 <= 0) ntry
= ntryh
[j
- 1];
48 if (nr
!= 0) goto L101
;
52 if (ntry
== 2 && nf
!= 1) {
54 for (i
= 2; i
<= i_1
; ++i
) {
56 ifac
[ib
+ 2] = ifac
[ib
+ 1];
60 if (nl
!= 1) goto L104
;
64 tpi
= 6.28318530717959;
65 argh
= tpi
/ (double) (*n
);
69 for (k1
= 1; k1
<= i_1
; ++k1
) {
77 for (j
= 1; j
<= i_2
; ++j
) {
83 argld
= (double) ld
* argh
;
85 for (ii
= 4; ii
<= i_3
; ii
+= 2) {
93 wa
[i1
- 1] = wa
[i
- 1];
102 static int pass_(int *nac
, long *ido
, long *ip
, long *l1
, long *idl1
,
103 double *cc
, double *c1
, double *c2
, double *ch
,
104 double *ch2
, double *wa
, int *isign
)
106 /* System generated locals */
107 long cc_dim1
, cc_dim2
, cc_offset
, ch_dim1
, ch_dim2
, ch_offset
,
108 ch2_offset
, c1_dim1
, c1_dim2
, c1_offset
, ch2_dim1
, c2_offset
,
109 c2_dim1
, i_1
, i_2
, i_3
;
111 /* Local variables */
113 long idij
, idlj
, idot
, ipph
, lc
, jc
, idj
, idl
, inc
, idp
;
117 /* Parameter adjustments */
120 cc_offset
= cc_dim1
* (cc_dim2
+ 1) + 1;
124 c1_offset
= c1_dim1
* (c1_dim2
+ 1) + 1;
127 c2_offset
= c2_dim1
+ 1;
131 ch_offset
= ch_dim1
* (ch_dim2
+ 1) + 1;
134 ch2_offset
= ch2_dim1
+ 1;
141 ipph
= (*ip
+ 1) / 2;
146 for (j
= 2; j
<= i_1
; ++j
) {
149 for (k
= 1; k
<= i_2
; ++k
) {
151 for (i
= 1; i
<= i_3
; ++i
) {
152 ch
[i
+ (k
+ j
* ch_dim2
) * ch_dim1
] =
153 cc
[i
+ (j
+ k
* cc_dim2
) * cc_dim1
]
154 + cc
[i
+ (jc
+ k
* cc_dim2
) * cc_dim1
];
155 ch
[i
+ (k
+ jc
* ch_dim2
) * ch_dim1
] =
156 cc
[i
+ (j
+ k
* cc_dim2
) * cc_dim1
]
157 - cc
[i
+ (jc
+ k
* cc_dim2
) * cc_dim1
];
162 for (k
= 1; k
<= i_1
; ++k
) {
164 for (i
= 1; i
<= i_2
; ++i
) {
165 ch
[i
+ (k
+ ch_dim2
) * ch_dim1
] = cc
[i
+ (k
* cc_dim2
+ 1) * cc_dim1
];
171 for (j
= 2; j
<= i_1
; ++j
) {
174 for (i
= 1; i
<= i_2
; ++i
) {
176 for (k
= 1; k
<= i_3
; ++k
) {
177 ch
[i
+ (k
+ j
* ch_dim2
) * ch_dim1
] =
178 cc
[i
+ (j
+ k
* cc_dim2
) * cc_dim1
]
179 + cc
[i
+ (jc
+ k
* cc_dim2
) * cc_dim1
];
180 ch
[i
+ (k
+ jc
* ch_dim2
) * ch_dim1
] =
181 cc
[i
+ (j
+ k
* cc_dim2
) * cc_dim1
]
182 - cc
[i
+ (jc
+ k
* cc_dim2
) * cc_dim1
];
187 for (i
= 1; i
<= i_1
; ++i
) {
189 for (k
= 1; k
<= i_2
; ++k
) {
190 ch
[i
+ (k
+ ch_dim2
) * ch_dim1
] = cc
[i
+ (k
* cc_dim2
+ 1) * cc_dim1
];
197 for (l
= 2; l
<= i_1
; ++l
) {
201 for (ik
= 1; ik
<= i_2
; ++ik
) {
202 c2
[ik
+ l
* c2_dim1
] = ch2
[ik
+ ch2_dim1
] + wa
[idl
- 1]
203 * ch2
[ik
+ (ch2_dim1
<< 1)];
204 c2
[ik
+ lc
* c2_dim1
] = - *isign
* wa
[idl
] * ch2
[ik
+ *ip
* ch2_dim1
];
209 for (j
= 3; j
<= i_2
; ++j
) {
218 for (ik
= 1; ik
<= i_3
; ++ik
) {
219 c2
[ik
+ l
* c2_dim1
] += war
* ch2
[ik
+ j
* ch2_dim1
];
220 c2
[ik
+ lc
* c2_dim1
] -= *isign
* wai
* ch2
[ik
+ jc
* ch2_dim1
];
225 for (j
= 2; j
<= i_1
; ++j
) {
227 for (ik
= 1; ik
<= i_2
; ++ik
) {
228 ch2
[ik
+ ch2_dim1
] += ch2
[ik
+ j
* ch2_dim1
];
232 for (j
= 2; j
<= i_1
; ++j
) {
235 for (ik
= 2; ik
<= i_2
; ik
+= 2) {
236 ch2
[ik
- 1 + j
* ch2_dim1
] = c2
[ik
- 1 + j
* c2_dim1
]
237 - c2
[ik
+ jc
* c2_dim1
];
238 ch2
[ik
- 1 + jc
* ch2_dim1
] = c2
[ik
- 1 + j
* c2_dim1
]
239 + c2
[ik
+ jc
* c2_dim1
];
240 ch2
[ik
+ j
* ch2_dim1
] = c2
[ik
+ j
* c2_dim1
]
241 + c2
[ik
- 1 + jc
* c2_dim1
];
242 ch2
[ik
+ jc
* ch2_dim1
] = c2
[ik
+ j
* c2_dim1
]
243 - c2
[ik
- 1 + jc
* c2_dim1
];
250 for (ik
= 1; ik
<= i_1
; ++ik
) {
251 c2
[ik
+ c2_dim1
] = ch2
[ik
+ ch2_dim1
];
254 for (j
= 2; j
<= i_1
; ++j
) {
256 for (k
= 1; k
<= i_2
; ++k
) {
257 c1
[(k
+ j
* c1_dim2
) * c1_dim1
+ 1] =
258 ch
[(k
+ j
* ch_dim2
) * ch_dim1
+ 1];
259 c1
[(k
+ j
* c1_dim2
) * c1_dim1
+ 2] =
260 ch
[(k
+ j
* ch_dim2
) * ch_dim1
+ 2];
266 for (j
= 2; j
<= i_1
; ++j
) {
269 for (i
= 4; i
<= i_2
; i
+= 2) {
272 for (k
= 1; k
<= i_3
; ++k
) {
273 c1
[i
- 1 + (k
+ j
* c1_dim2
) * c1_dim1
] = wa
[idij
- 1]
274 * ch
[i
- 1 + (k
+ j
* ch_dim2
) * ch_dim1
] + *isign
* wa
[idij
]
275 * ch
[i
+ (k
+ j
* ch_dim2
) * ch_dim1
];
276 c1
[i
+ (k
+ j
* c1_dim2
) * c1_dim1
] = wa
[idij
- 1]
277 * ch
[i
+ (k
+ j
* ch_dim2
) * ch_dim1
] - *isign
* wa
[idij
]
278 * ch
[i
- 1 + (k
+ j
* ch_dim2
) * ch_dim1
];
286 for (j
= 2; j
<= i_1
; ++j
) {
289 for (k
= 1; k
<= i_2
; ++k
) {
292 for (i
= 4; i
<= i_3
; i
+= 2) {
294 c1
[i
- 1 + (k
+ j
* c1_dim2
) * c1_dim1
] = wa
[idij
- 1]
295 * ch
[i
- 1 + (k
+ j
* ch_dim2
) * ch_dim1
]
296 + *isign
* wa
[idij
] * ch
[i
+ (k
+ j
* ch_dim2
) * ch_dim1
];
297 c1
[i
+ (k
+ j
* c1_dim2
) * c1_dim1
] = wa
[idij
- 1]
298 * ch
[i
+ (k
+ j
* ch_dim2
) * ch_dim1
] - *isign
* wa
[idij
]
299 * ch
[i
- 1 + (k
+ j
* ch_dim2
) * ch_dim1
];
308 static int pass2_(ido
, l1
, cc
, ch
, wa1
, isign
)
310 double *cc
, *ch
, *wa1
;
313 /* System generated locals */
314 int cc_dim1
, cc_offset
, ch_dim1
, ch_dim2
, ch_offset
, i_1
, i_2
;
316 /* Local variables */
320 /* Parameter adjustments */
322 cc_offset
= cc_dim1
* 3 + 1;
326 ch_offset
= ch_dim1
* (ch_dim2
+ 1) + 1;
333 for (k
= 1; k
<= i_1
; ++k
) {
334 ch
[(k
+ ch_dim2
) * ch_dim1
+ 1] = cc
[((k
<< 1) + 1) * cc_dim1
+ 1]
335 + cc
[((k
<< 1) + 2) * cc_dim1
+ 1];
336 ch
[(k
+ (ch_dim2
<< 1)) * ch_dim1
+ 1] = cc
[((k
<< 1) + 1) * cc_dim1
+ 1]
337 - cc
[((k
<< 1) + 2) * cc_dim1
+ 1];
338 ch
[(k
+ ch_dim2
) * ch_dim1
+ 2] = cc
[((k
<< 1) + 1) * cc_dim1
+ 2]
339 + cc
[((k
<< 1) + 2) * cc_dim1
+ 2];
340 ch
[(k
+ (ch_dim2
<< 1)) * ch_dim1
+ 2] = cc
[((k
<< 1) + 1) * cc_dim1
+ 2]
341 - cc
[((k
<< 1) + 2) * cc_dim1
+ 2];
346 for (k
= 1; k
<= i_1
; ++k
) {
348 for (i
= 2; i
<= i_2
; i
+= 2) {
349 ch
[i
- 1 + (k
+ ch_dim2
) * ch_dim1
]
350 = cc
[i
- 1 + ((k
<< 1) + 1) * cc_dim1
]
351 + cc
[i
- 1 + ((k
<< 1) + 2) * cc_dim1
];
352 tr2
= cc
[i
- 1 + ((k
<< 1) + 1) * cc_dim1
]
353 - cc
[i
- 1 + ((k
<< 1) + 2) * cc_dim1
];
354 ch
[i
+ (k
+ ch_dim2
) * ch_dim1
] = cc
[i
+ ((k
<< 1) + 1) * cc_dim1
]
355 + cc
[i
+ ((k
<< 1) + 2) * cc_dim1
];
356 ti2
= cc
[i
+ ((k
<< 1) + 1) * cc_dim1
]
357 - cc
[i
+ ((k
<< 1) + 2) * cc_dim1
];
358 ch
[i
+ (k
+ (ch_dim2
<< 1)) * ch_dim1
] = wa1
[i
- 1] * ti2
359 - *isign
* wa1
[i
] * tr2
;
360 ch
[i
- 1 + (k
+ (ch_dim2
<< 1)) * ch_dim1
] = wa1
[i
- 1] * tr2
361 + *isign
* wa1
[i
] * ti2
;
368 static int pass3_(ido
, l1
, cc
, ch
, wa1
, wa2
, isign
)
370 double *cc
, *ch
, *wa1
, *wa2
;
373 /* System generated locals */
374 int cc_dim1
, cc_offset
, ch_dim1
, ch_dim2
, ch_offset
, i_1
, i_2
;
376 /* Local variables */
379 double ci2
, ci3
, di2
, di3
, cr2
, cr3
, dr2
, dr3
, ti2
, tr2
;
381 /* Parameter adjustments */
383 cc_offset
= (cc_dim1
<< 2) + 1;
387 ch_offset
= ch_dim1
* (ch_dim2
+ 1) + 1;
394 taui
= -(*isign
) * .866025403784439;
397 for (k
= 1; k
<= i_1
; ++k
) {
398 tr2
= cc
[(k
* 3 + 2) * cc_dim1
+ 1] + cc
[(k
* 3 + 3) * cc_dim1
+ 1];
399 cr2
= cc
[(k
* 3 + 1) * cc_dim1
+ 1] + taur
* tr2
;
400 ch
[(k
+ ch_dim2
) * ch_dim1
+ 1] = cc
[(k
* 3 + 1) * cc_dim1
+ 1] + tr2
;
401 ti2
= cc
[(k
* 3 + 2) * cc_dim1
+ 2] + cc
[(k
* 3 + 3) * cc_dim1
+ 2];
402 ci2
= cc
[(k
* 3 + 1) * cc_dim1
+ 2] + taur
* ti2
;
403 ch
[(k
+ ch_dim2
) * ch_dim1
+ 2] = cc
[(k
* 3 + 1) * cc_dim1
+ 2] + ti2
;
404 cr3
= taui
* (cc
[(k
* 3 + 2) * cc_dim1
+ 1]
405 - cc
[(k
* 3 + 3) * cc_dim1
+ 1]);
406 ci3
= taui
* (cc
[(k
* 3 + 2) * cc_dim1
+ 2]
407 - cc
[(k
* 3 + 3) * cc_dim1
+ 2]);
408 ch
[(k
+ (ch_dim2
<< 1)) * ch_dim1
+ 1] = cr2
- ci3
;
409 ch
[(k
+ ch_dim2
* 3) * ch_dim1
+ 1] = cr2
+ ci3
;
410 ch
[(k
+ (ch_dim2
<< 1)) * ch_dim1
+ 2] = ci2
+ cr3
;
411 ch
[(k
+ ch_dim2
* 3) * ch_dim1
+ 2] = ci2
- cr3
;
416 for (k
= 1; k
<= i_1
; ++k
) {
418 for (i
= 2; i
<= i_2
; i
+= 2) {
419 tr2
= cc
[i
- 1 + (k
* 3 + 2) * cc_dim1
]
420 + cc
[i
- 1 + (k
* 3 + 3) * cc_dim1
];
421 cr2
= cc
[i
- 1 + (k
* 3 + 1) * cc_dim1
] + taur
* tr2
;
422 ch
[i
- 1 + (k
+ ch_dim2
) * ch_dim1
] = cc
[i
- 1 + (k
* 3 + 1)
424 ti2
= cc
[i
+ (k
* 3 + 2) * cc_dim1
] + cc
[i
+ (k
* 3 + 3) * cc_dim1
];
425 ci2
= cc
[i
+ (k
* 3 + 1) * cc_dim1
] + taur
* ti2
;
426 ch
[i
+ (k
+ ch_dim2
) * ch_dim1
] = cc
[i
+ (k
* 3 + 1) * cc_dim1
] + ti2
;
427 cr3
= taui
* (cc
[i
- 1 + (k
* 3 + 2) * cc_dim1
]
428 - cc
[i
- 1 + (k
* 3 + 3) * cc_dim1
]);
429 ci3
= taui
* (cc
[i
+ (k
* 3 + 2) * cc_dim1
]
430 - cc
[i
+ (k
* 3 + 3) * cc_dim1
]);
435 ch
[i
+ (k
+ (ch_dim2
<< 1)) * ch_dim1
] = wa1
[i
- 1] * di2
436 - *isign
* wa1
[i
] * dr2
;
437 ch
[i
- 1 + (k
+ (ch_dim2
<< 1)) * ch_dim1
] = wa1
[i
- 1] * dr2
438 + *isign
* wa1
[i
] * di2
;
439 ch
[i
+ (k
+ ch_dim2
* 3) * ch_dim1
] = wa2
[i
- 1] * di3
440 - *isign
* wa2
[i
] * dr3
;
441 ch
[i
- 1 + (k
+ ch_dim2
* 3) * ch_dim1
] = wa2
[i
- 1] * dr3
442 + *isign
* wa2
[i
] * di3
;
449 static int pass4_(ido
, l1
, cc
, ch
, wa1
, wa2
, wa3
, isign
)
451 double *cc
, *ch
, *wa1
, *wa2
, *wa3
;
454 /* System generated locals */
455 int cc_dim1
, cc_offset
, ch_dim1
, ch_dim2
, ch_offset
, i_1
, i_2
;
457 /* Local variables */
459 double ci2
, ci3
, ci4
, cr2
, cr3
, cr4
, ti1
, ti2
, ti3
, ti4
, tr1
, tr2
, tr3
, tr4
;
461 /* Parameter adjustments */
463 cc_offset
= cc_dim1
* 5 + 1;
467 ch_offset
= ch_dim1
* (ch_dim2
+ 1) + 1;
476 for (k
= 1; k
<= i_1
; ++k
) {
477 ti1
= cc
[((k
<< 2) + 1) * cc_dim1
+ 2]
478 - cc
[((k
<< 2) + 3) * cc_dim1
+ 2];
479 ti2
= cc
[((k
<< 2) + 1) * cc_dim1
+ 2]
480 + cc
[((k
<< 2) + 3) * cc_dim1
+ 2];
481 tr4
= *isign
* (cc
[((k
<< 2) + 2) * cc_dim1
+ 2]
482 - cc
[((k
<< 2) + 4) * cc_dim1
+ 2]);
483 ti3
= cc
[((k
<< 2) + 2) * cc_dim1
+ 2]
484 + cc
[((k
<< 2) + 4) * cc_dim1
+ 2];
485 tr1
= cc
[((k
<< 2) + 1) * cc_dim1
+ 1]
486 - cc
[((k
<< 2) + 3) * cc_dim1
+ 1];
487 tr2
= cc
[((k
<< 2) + 1) * cc_dim1
+ 1]
488 + cc
[((k
<< 2) + 3) * cc_dim1
+ 1];
489 ti4
= *isign
* (cc
[((k
<< 2) + 4) * cc_dim1
+ 1]
490 - cc
[((k
<< 2) + 2) * cc_dim1
+ 1]);
491 tr3
= cc
[((k
<< 2) + 2) * cc_dim1
+ 1]
492 + cc
[((k
<< 2) + 4) * cc_dim1
+ 1];
493 ch
[(k
+ ch_dim2
) * ch_dim1
+ 1] = tr2
+ tr3
;
494 ch
[(k
+ ch_dim2
* 3) * ch_dim1
+ 1] = tr2
- tr3
;
495 ch
[(k
+ ch_dim2
) * ch_dim1
+ 2] = ti2
+ ti3
;
496 ch
[(k
+ ch_dim2
* 3) * ch_dim1
+ 2] = ti2
- ti3
;
497 ch
[(k
+ (ch_dim2
<< 1)) * ch_dim1
+ 1] = tr1
+ tr4
;
498 ch
[(k
+ (ch_dim2
<< 2)) * ch_dim1
+ 1] = tr1
- tr4
;
499 ch
[(k
+ (ch_dim2
<< 1)) * ch_dim1
+ 2] = ti1
+ ti4
;
500 ch
[(k
+ (ch_dim2
<< 2)) * ch_dim1
+ 2] = ti1
- ti4
;
505 for (k
= 1; k
<= i_1
; ++k
) {
507 for (i
= 2; i
<= i_2
; i
+= 2) {
508 ti1
= cc
[i
+ ((k
<< 2) + 1) * cc_dim1
]
509 - cc
[i
+ ((k
<< 2) + 3) * cc_dim1
];
510 ti2
= cc
[i
+ ((k
<< 2) + 1) * cc_dim1
]
511 + cc
[i
+ ((k
<< 2) + 3) * cc_dim1
];
512 ti3
= cc
[i
+ ((k
<< 2) + 2) * cc_dim1
]
513 + cc
[i
+ ((k
<< 2) + 4) * cc_dim1
];
514 tr4
= *isign
* (cc
[i
+ ((k
<< 2) + 2) * cc_dim1
]
515 - cc
[i
+ ((k
<< 2) + 4) * cc_dim1
]);
516 tr1
= cc
[i
- 1 + ((k
<< 2) + 1) * cc_dim1
]
517 - cc
[i
- 1 + ((k
<< 2) + 3) * cc_dim1
];
518 tr2
= cc
[i
- 1 + ((k
<< 2) + 1) * cc_dim1
]
519 + cc
[i
- 1 + ((k
<< 2) + 3) * cc_dim1
];
520 ti4
= *isign
* (cc
[i
- 1 + ((k
<< 2) + 4) * cc_dim1
]
521 - cc
[i
- 1 + ((k
<< 2) + 2) * cc_dim1
]);
522 tr3
= cc
[i
- 1 + ((k
<< 2) + 2) * cc_dim1
]
523 + cc
[i
- 1 + ((k
<< 2) + 4) * cc_dim1
];
524 ch
[i
- 1 + (k
+ ch_dim2
) * ch_dim1
] = tr2
+ tr3
;
526 ch
[i
+ (k
+ ch_dim2
) * ch_dim1
] = ti2
+ ti3
;
532 ch
[i
- 1 + (k
+ (ch_dim2
<< 1)) * ch_dim1
] = wa1
[i
- 1] * cr2
533 + *isign
* wa1
[i
] * ci2
;
534 ch
[i
+ (k
+ (ch_dim2
<< 1)) * ch_dim1
] = wa1
[i
- 1] * ci2
535 - *isign
* wa1
[i
] * cr2
;
536 ch
[i
- 1 + (k
+ ch_dim2
* 3) * ch_dim1
] = wa2
[i
- 1] * cr3
537 + *isign
* wa2
[i
] * ci3
;
538 ch
[i
+ (k
+ ch_dim2
* 3) * ch_dim1
] = wa2
[i
- 1] * ci3
539 - *isign
* wa2
[i
] * cr3
;
540 ch
[i
- 1 + (k
+ (ch_dim2
<< 2)) * ch_dim1
] = wa3
[i
- 1] * cr4
541 + *isign
* wa3
[i
] * ci4
;
542 ch
[i
+ (k
+ (ch_dim2
<< 2)) * ch_dim1
] = wa3
[i
- 1] * ci4
543 - *isign
* wa3
[i
] * cr4
;
550 static int pass5_(ido
, l1
, cc
, ch
, wa1
, wa2
, wa3
, wa4
, isign
)
552 double *cc
, *ch
, *wa1
, *wa2
, *wa3
, *wa4
;
555 /* System generated locals */
556 int cc_dim1
, cc_offset
, ch_dim1
, ch_dim2
, ch_offset
, i_1
, i_2
;
558 /* Local variables */
560 double ci2
, ci3
, ci4
, ci5
, di3
, di4
, di5
, di2
, cr2
, cr3
, cr5
, cr4
, ti2
, ti3
,
561 ti4
, ti5
, dr3
, dr4
, dr5
, dr2
, tr2
, tr3
, tr4
, tr5
, ti11
, ti12
, tr11
,
564 /* Parameter adjustments */
566 cc_offset
= cc_dim1
* 6 + 1;
570 ch_offset
= ch_dim1
* (ch_dim2
+ 1) + 1;
578 tr11
= .309016994374947;
579 ti11
= -(*isign
) * .951056516295154;
580 tr12
= -.809016994374947;
581 ti12
= -(*isign
) * .587785252292473;
584 for (k
= 1; k
<= i_1
; ++k
) {
585 ti5
= cc
[(k
* 5 + 2) * cc_dim1
+ 2] - cc
[(k
* 5 + 5) * cc_dim1
+ 2];
586 ti2
= cc
[(k
* 5 + 2) * cc_dim1
+ 2] + cc
[(k
* 5 + 5) * cc_dim1
+ 2];
587 ti4
= cc
[(k
* 5 + 3) * cc_dim1
+ 2] - cc
[(k
* 5 + 4) * cc_dim1
+ 2];
588 ti3
= cc
[(k
* 5 + 3) * cc_dim1
+ 2] + cc
[(k
* 5 + 4) * cc_dim1
+ 2];
589 tr5
= cc
[(k
* 5 + 2) * cc_dim1
+ 1] - cc
[(k
* 5 + 5) * cc_dim1
+ 1];
590 tr2
= cc
[(k
* 5 + 2) * cc_dim1
+ 1] + cc
[(k
* 5 + 5) * cc_dim1
+ 1];
591 tr4
= cc
[(k
* 5 + 3) * cc_dim1
+ 1] - cc
[(k
* 5 + 4) * cc_dim1
+ 1];
592 tr3
= cc
[(k
* 5 + 3) * cc_dim1
+ 1] + cc
[(k
* 5 + 4) * cc_dim1
+ 1];
593 ch
[(k
+ ch_dim2
) * ch_dim1
+ 1] = cc
[(k
* 5 + 1) * cc_dim1
+ 1]
595 ch
[(k
+ ch_dim2
) * ch_dim1
+ 2] = cc
[(k
* 5 + 1) * cc_dim1
+ 2]
597 cr2
= cc
[(k
* 5 + 1) * cc_dim1
+ 1] + tr11
* tr2
+ tr12
* tr3
;
598 ci2
= cc
[(k
* 5 + 1) * cc_dim1
+ 2] + tr11
* ti2
+ tr12
* ti3
;
599 cr3
= cc
[(k
* 5 + 1) * cc_dim1
+ 1] + tr12
* tr2
+ tr11
* tr3
;
600 ci3
= cc
[(k
* 5 + 1) * cc_dim1
+ 2] + tr12
* ti2
+ tr11
* ti3
;
601 cr5
= ti11
* tr5
+ ti12
* tr4
;
602 ci5
= ti11
* ti5
+ ti12
* ti4
;
603 cr4
= ti12
* tr5
- ti11
* tr4
;
604 ci4
= ti12
* ti5
- ti11
* ti4
;
605 ch
[(k
+ (ch_dim2
<< 1)) * ch_dim1
+ 1] = cr2
- ci5
;
606 ch
[(k
+ ch_dim2
* 5) * ch_dim1
+ 1] = cr2
+ ci5
;
607 ch
[(k
+ (ch_dim2
<< 1)) * ch_dim1
+ 2] = ci2
+ cr5
;
608 ch
[(k
+ ch_dim2
* 3) * ch_dim1
+ 2] = ci3
+ cr4
;
609 ch
[(k
+ ch_dim2
* 3) * ch_dim1
+ 1] = cr3
- ci4
;
610 ch
[(k
+ (ch_dim2
<< 2)) * ch_dim1
+ 1] = cr3
+ ci4
;
611 ch
[(k
+ (ch_dim2
<< 2)) * ch_dim1
+ 2] = ci3
- cr4
;
612 ch
[(k
+ ch_dim2
* 5) * ch_dim1
+ 2] = ci2
- cr5
;
617 for (k
= 1; k
<= i_1
; ++k
) {
619 for (i
= 2; i
<= i_2
; i
+= 2) {
620 ti5
= cc
[i
+ (k
* 5 + 2) * cc_dim1
] - cc
[i
+ (k
* 5 + 5) * cc_dim1
];
621 ti2
= cc
[i
+ (k
* 5 + 2) * cc_dim1
] + cc
[i
+ (k
* 5 + 5) * cc_dim1
];
622 ti4
= cc
[i
+ (k
* 5 + 3) * cc_dim1
] - cc
[i
+ (k
* 5 + 4) * cc_dim1
];
623 ti3
= cc
[i
+ (k
* 5 + 3) * cc_dim1
] + cc
[i
+ (k
* 5 + 4) * cc_dim1
];
624 tr5
= cc
[i
- 1 + (k
* 5 + 2) * cc_dim1
]
625 - cc
[i
- 1 + (k
* 5 + 5) * cc_dim1
];
626 tr2
= cc
[i
- 1 + (k
* 5 + 2) * cc_dim1
]
627 + cc
[i
- 1 + (k
* 5 + 5) * cc_dim1
];
628 tr4
= cc
[i
- 1 + (k
* 5 + 3) * cc_dim1
]
629 - cc
[i
- 1 + (k
* 5 + 4) * cc_dim1
];
630 tr3
= cc
[i
- 1 + (k
* 5 + 3) * cc_dim1
]
631 + cc
[i
- 1 + (k
* 5 + 4) * cc_dim1
];
632 ch
[i
- 1 + (k
+ ch_dim2
) * ch_dim1
] = cc
[i
- 1 + (k
* 5 + 1)
633 * cc_dim1
] + tr2
+ tr3
;
634 ch
[i
+ (k
+ ch_dim2
) * ch_dim1
] = cc
[i
+ (k
* 5 + 1)
635 * cc_dim1
] + ti2
+ ti3
;
636 cr2
= cc
[i
- 1 + (k
* 5 + 1) * cc_dim1
] + tr11
* tr2
+ tr12
* tr3
;
637 ci2
= cc
[i
+ (k
* 5 + 1) * cc_dim1
] + tr11
* ti2
+ tr12
* ti3
;
639 cr3
= cc
[i
- 1 + (k
* 5 + 1) * cc_dim1
] + tr12
* tr2
+ tr11
* tr3
;
640 ci3
= cc
[i
+ (k
* 5 + 1) * cc_dim1
] + tr12
* ti2
+ tr11
* ti3
;
642 cr5
= ti11
* tr5
+ ti12
* tr4
;
643 ci5
= ti11
* ti5
+ ti12
* ti4
;
644 cr4
= ti12
* tr5
- ti11
* tr4
;
645 ci4
= ti12
* ti5
- ti11
* ti4
;
654 ch
[i
- 1 + (k
+ (ch_dim2
<< 1)) * ch_dim1
] = wa1
[i
- 1] * dr2
655 + *isign
* wa1
[i
] * di2
;
656 ch
[i
+ (k
+ (ch_dim2
<< 1)) * ch_dim1
] = wa1
[i
- 1] * di2
657 - *isign
* wa1
[i
] * dr2
;
658 ch
[i
- 1 + (k
+ ch_dim2
* 3) * ch_dim1
] = wa2
[i
- 1] * dr3
659 + *isign
* wa2
[i
] * di3
;
660 ch
[i
+ (k
+ ch_dim2
* 3) * ch_dim1
] = wa2
[i
- 1] * di3
661 - *isign
* wa2
[i
] * dr3
;
662 ch
[i
- 1 + (k
+ (ch_dim2
<< 2)) * ch_dim1
] = wa3
[i
- 1] * dr4
663 + *isign
* wa3
[i
] * di4
;
664 ch
[i
+ (k
+ (ch_dim2
<< 2)) * ch_dim1
] = wa3
[i
- 1] * di4
665 - *isign
* wa3
[i
] * dr4
;
666 ch
[i
- 1 + (k
+ ch_dim2
* 5) * ch_dim1
] = wa4
[i
- 1] * dr5
667 + *isign
* wa4
[i
] * di5
;
668 ch
[i
+ (k
+ ch_dim2
* 5) * ch_dim1
] = wa4
[i
- 1] * di5
669 - *isign
* wa4
[i
] * dr5
;
679 cfft1_(int *n
, double *c
, double *ch
, double *wa
,
680 double /* int??*/ *ifac
, int *isign
)
682 /* System generated locals */
685 /* Local variables */
687 int i
, k1
, n2
, na
, nac
;
688 long l1
, l2
, ido
, idl1
, iw
, ix2
, ix3
, ix4
;
691 /* Parameter adjustments */
703 for (k1
= 1; k1
<= i_1
; ++k1
) {
713 pass4_(&idot
, &l1
, &c
[1], &ch
[1], &wa
[iw
], &wa
[ix2
], &wa
[ix3
], isign
);
716 pass4_(&idot
, &l1
, &ch
[1], &c
[1], &wa
[iw
], &wa
[ix2
], &wa
[ix3
], isign
);
722 pass2_(&idot
, &l1
, &c
[1], &ch
[1], &wa
[iw
], isign
);
725 pass2_(&idot
, &l1
, &ch
[1], &c
[1], &wa
[iw
], isign
);
732 pass3_(&idot
, &l1
, &c
[1], &ch
[1], &wa
[iw
], &wa
[ix2
], isign
);
735 pass3_(&idot
, &l1
, &ch
[1], &c
[1], &wa
[iw
], &wa
[ix2
], isign
);
744 pass5_(&idot
, &l1
, &c
[1], &ch
[1], &wa
[iw
], &wa
[ix2
], &wa
[ix3
],
748 pass5_(&idot
, &l1
, &ch
[1], &c
[1], &wa
[iw
], &wa
[ix2
], &wa
[ix3
],
755 pass_(&nac
, &idot
, &ip
, &l1
, &idl1
, &c
[1], &c
[1], &c
[1], &ch
[1],
756 &ch
[1], &wa
[iw
], isign
);
759 pass_(&nac
, &idot
, &ip
, &l1
, &idl1
, &ch
[1], &ch
[1], &ch
[1], &c
[1],
760 &c
[1], &wa
[iw
], isign
);
767 iw
+= (ip
- 1) * idot
;
772 for (i
= 1; i
<= i_1
; ++i
) {
785 * cfft computes the forward or backward complex discrete fourier transform.
789 * n The length of the complex sequence c. The method is
790 * more efficient when n is the product of small primes.
792 * c A complex array of length n which contains the sequence
794 * wsave a real work array which must be dimensioned at least 4n+15
795 * in the program that calls cfft.
796 * isign 1 for transform, -1 for inverse transform.
797 * A call of cfft with isign = 1 followed by a call of cfft with
798 * isign = -1 will multiply the sequence by n.
804 * c(j)=the sum from k=1,...,n of
806 * c(k)*exp(-isign*i*(j-1)*(k-1)*2*pi/n)
811 int cfft(int n
, double *c
, double *wsave
, int isign
)
815 /* Parameter adjustments */
823 cffti1_(&n
, &wsave
[iw1
], &wsave
[iw2
]);
824 cfft1_(&n
, &c
[1], &wsave
[1], &wsave
[iw1
], &wsave
[iw2
], &isign
);