140 fftw_plan prepare_fft(
int, Tbl*&) ;
141 double* cheb_ini(
const int) ;
142 double* chebimp_ini(
const int ) ;
145 void cftcossinsi(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
164 cout <<
"cftcossinsi: nt > n2f : nt = " << nt <<
" , n2f = " 170 cout <<
"cftcossinsi: nt > n2c : nt = " << nt <<
" , n2c = " 176 cout <<
"cftcossinsi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 182 cout <<
"cftcossinsi: n3f > n3c : n3f = " << n3f <<
" , n3c = " 194 fftw_plan p = prepare_fft(nm1, pg) ;
198 double* sinp = cheb_ini(nt);
201 double* sinth = chebimp_ini(nt);
206 int n2n3f = n2f * n3f ;
207 int n2n3c = n2c * n3c ;
222 for (k=0; k<n3f; k++) {
224 int i0 = n2n3f * j + k ;
225 double* ff0 = ff + i0 ;
228 double* cf0 = cf + i0 ;
237 for (i=1; i<nt; i++) cf0[n3c*i] = sinth[i] * ff0[n3f*i] ;
245 double fmoins0 = 0.5 * ( cf0[0] - cf0[ n3c*nm1 ] );
249 for ( i = 1; i < nm1s2 ; i++ ) {
255 int ixsym = n3c * isym ;
257 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
259 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
260 g.set(i) = fp + fms ;
261 g.set(isym) = fp - fms ;
264 g.set(0) = 0.5 * ( cf0[0] + cf0[ n3c*nm1 ] );
265 g.set(nm1s2) = cf0[ n3c*nm1s2 ];
278 double fac = 2./double(nm1) ;
279 cf0[0] = g(0)/double(nm1) ;
280 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = fac * g(i/2) ;
281 cf0[n3c*nm1] = g(nm1s2)/double(nm1) ;
292 for ( i = 3; i < nt; i += 2 ) {
293 cf0[n3c*i] = cf0[n3c*(i-2)] + fac * g(nm1 - i/2) ;
298 double c1 = ( fmoins0 - som ) / nm1s2 ;
302 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
308 for (i=1; i<nm1; i++) {
309 cf0[n3c*i] = 2 * cf0[n3c*i] + cf0[n3c*(i-1)] ;
321 if ( (j != 1) && (j != n1f-1 ) ) {
325 for (k=0; k<n3f; k++) {
327 int i0 = n2n3f * j + k ;
328 double* ff0 = ff + i0 ;
331 double* cf0 = cf + i0 ;
340 for (i=1; i<nt; i++) cf0[n3c*i] = sinth[i] * ff0[n3f*i] ;
348 double fmoins0 = 0.5 * ( cf0[0] - cf0[ n3c*nm1 ] );
352 for ( i = 1; i < nm1s2 ; i++ ) {
358 int ixsym = n3c * isym ;
360 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
362 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
363 g.set(i) = fp + fms ;
364 g.set(isym) = fp - fms ;
367 g.set(0) = 0.5 * ( cf0[0] + cf0[ n3c*nm1 ] );
368 g.set(nm1s2) = cf0[ n3c*nm1s2 ];
381 double fac = 2./double(nm1) ;
382 cf0[0] = g(0)/double(nm1) ;
383 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = fac * g(i/2) ;
384 cf0[n3c*nm1] = g(nm1s2)/double(nm1) ;
395 for ( i = 3; i < nt; i += 2 ) {
396 cf0[n3c*i] = cf0[n3c*(i-2)] + fac * g(nm1 - i/2) ;
401 double c1 = ( fmoins0 - som ) / nm1s2 ;
405 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
411 for (i=1; i<nm1; i++) {
412 cf0[n3c*i] = 2 * cf0[n3c*i] + cf0[n3c*(i-1)] ;
442 for (k=0; k<n3f; k++) {
444 int i0 = n2n3f * j + k ;
445 double* ff0 = ff + i0 ;
448 double* cf0 = cf + i0 ;
456 double fmoins0 = 0.5 * ( ff0[0] - ff0[ n3f*nm1 ] );
460 for ( i = 1; i < nm1s2 ; i++ ) {
466 int ixsym = n3f * isym ;
468 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
470 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
471 g.set(i) = fp + fms ;
472 g.set(isym) = fp - fms ;
475 g.set(0) = 0.5 * ( ff0[0] + ff0[ n3f*nm1 ] );
476 g.set(nm1s2) = ff0[ n3f*nm1s2 ];
489 double fac = 2./double(nm1) ;
490 cf0[0] = g(0) / double(nm1) ;
491 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = fac*g(i/2) ;
492 cf0[n3c*nm1] = g(nm1s2) / double(nm1) ;
503 for ( i = 3; i < nt; i += 2 ) {
504 cf0[n3c*i] = cf0[n3c*(i-2)] + fac * g(nm1 - i/2) ;
509 double c1 = ( fmoins0 - som ) / nm1s2 ;
513 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
528 for (k=0; k<n3f; k++) {
530 int i0 = n2n3f * j + k ;
531 double* ff0 = ff + i0 ;
534 double* cf0 = cf + i0 ;
542 double fmoins0 = 0.5 * ( ff0[0] - ff0[ n3f*nm1 ] );
546 for ( i = 1; i < nm1s2 ; i++ ) {
552 int ixsym = n3f * isym ;
554 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
556 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
557 g.set(i) = fp + fms ;
558 g.set(isym) = fp - fms ;
561 g.set(0) = 0.5 * ( ff0[0] + ff0[ n3f*nm1 ] );
562 g.set(nm1s2) = ff0[ n3f*nm1s2 ];
575 double fac = 2./double(nm1) ;
576 cf0[0] = g(0) / double(nm1) ;
577 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = fac*g(i/2) ;
578 cf0[n3c*nm1] = g(nm1s2) / double(nm1) ;
589 for ( i = 3; i < nt; i += 2 ) {
590 cf0[n3c*i] = cf0[n3c*(i-2)] + fac * g(nm1 - i/2) ;
595 double c1 = ( fmoins0 - som ) / nm1s2 ;
599 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;