146 fftw_plan prepare_fft(
int, Tbl*&) ;
147 double* cheb_ini(
const int) ;
148 double* chebimp_ini(
const int ) ;
152 void cfrchebpimi(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
172 cout <<
"cfrchebpimi: nr > n3f : nr = " << nr <<
" , n3f = " 178 cout <<
"cfrchebpimi: nr > n3c : nr = " << nr <<
" , n3c = " 184 cout <<
"cfrchebpimi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 190 cout <<
"cfrchebpimi: n2f > n2c : n2f = " << n2f <<
" , n2c = " 202 fftw_plan p = prepare_fft(nm1, pg) ;
206 double* sinp = cheb_ini(nr);
209 double* x = chebimp_ini(nr);
213 int n2n3f = n2f * n3f ;
214 int n2n3c = n2c * n3c ;
228 for (k=0; k<n2f; k++) {
230 int i0 = n2n3f * j + n3f * k ;
231 double* ff0 = ff + i0 ;
233 i0 = n2n3c * j + n3c * k ;
234 double* cf0 = cf + i0 ;
241 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
249 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
253 for ( i = 1; i < nm1s2 ; i++ ) {
259 int ixsym = nm1 - isym ;
262 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
264 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
265 g.set(i) = fp + fms ;
266 g.set(isym) = fp - fms ;
269 g.set(0) = 0.5 * ( cf0[nm1] + cf0[0] );
270 g.set(nm1s2) = cf0[nm1s2];
284 double fac = 2./double(nm1) ;
285 cf0[0] = g(0) / double(nm1) ;
286 for (i=2; i<nm1; i += 2 ) cf0[i] = fac * g(i/2) ;
287 cf0[nm1] = g(nm1s2) / double(nm1) ;
298 for ( i = 3; i < nr; i += 2 ) {
299 cf0[i] = cf0[i-2] + fac * g(nm1 - i/2) ;
304 double c1 = ( fmoins0 - som ) / nm1s2 ;
308 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
314 for (i=1; i<nm1; i++) {
315 cf0[i] = 2 * cf0[i] - cf0[i-1] ;
329 if ( (j != 1) && (j != n1f-1) ) {
333 for (k=0; k<n2f; k++) {
335 int i0 = n2n3f * j + n3f * k ;
336 double* ff0 = ff + i0 ;
338 i0 = n2n3c * j + n3c * k ;
339 double* cf0 = cf + i0 ;
346 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
354 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
358 for ( i = 1; i < nm1s2 ; i++ ) {
364 int ixsym = nm1 - isym ;
367 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
369 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
370 g.set(i) = fp + fms ;
371 g.set(isym) = fp - fms ;
374 g.set(0) = 0.5 * ( cf0[nm1] + cf0[0] );
375 g.set(nm1s2) = cf0[nm1s2];
389 double fac = 2./double(nm1) ;
390 cf0[0] = g(0) / double(nm1) ;
391 for (i=2; i<nm1; i += 2 ) cf0[i] = fac * g(i/2) ;
392 cf0[nm1] = g(nm1s2) / double(nm1) ;
403 for ( i = 3; i < nr; i += 2 ) {
404 cf0[i] = cf0[i-2] + fac * g(nm1 - i/2) ;
409 double c1 = ( fmoins0 - som ) / nm1s2 ;
413 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
419 for (i=1; i<nm1; i++) {
420 cf0[i] = 2 * cf0[i] - cf0[i-1] ;
450 for (k=0; k<n2f; k++) {
452 int i0 = n2n3f * j + n3f * k ;
453 double* ff0 = ff + i0 ;
455 i0 = n2n3c * j + n3c * k ;
456 double* cf0 = cf + i0 ;
464 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
468 for ( i = 1; i < nm1s2 ; i++ ) {
474 int ixsym = nm1 - isym ;
477 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
479 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
480 g.set(i) = fp + fms ;
481 g.set(isym) = fp - fms ;
484 g.set(0) = 0.5 * ( ff0[nm1] + ff0[0] );
485 g.set(nm1s2) = ff0[nm1s2];
498 double fac = 2./double(nm1) ;
499 cf0[0] = g(0) / double(nm1) ;
500 for (i=2; i<nm1; i += 2) cf0[i] = fac*g(i/2) ;
501 cf0[nm1] = g(nm1s2) / double(nm1) ;
512 for ( i = 3; i < nr; i += 2 ) {
513 cf0[i] = cf0[i-2] + fac * g(nm1-i/2) ;
518 double c1 = ( fmoins0 - som ) / nm1s2 ;
522 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
537 for (k=0; k<n2f; k++) {
539 int i0 = n2n3f * j + n3f * k ;
540 double* ff0 = ff + i0 ;
542 i0 = n2n3c * j + n3c * k ;
543 double* cf0 = cf + i0 ;
551 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
555 for ( i = 1; i < nm1s2 ; i++ ) {
561 int ixsym = nm1 - isym ;
564 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
566 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
567 g.set(i) = fp + fms ;
568 g.set(isym) = fp - fms ;
571 g.set(0) = 0.5 * ( ff0[nm1] + ff0[0] );
572 g.set(nm1s2) = ff0[nm1s2];
585 double fac = 2./double(nm1) ;
586 cf0[0] = g(0) / double(nm1) ;
587 for (i=2; i<nm1; i += 2) cf0[i] = fac*g(i/2) ;
588 cf0[nm1] = g(nm1s2) / double(nm1) ;
599 for ( i = 3; i < nr; i += 2 ) {
600 cf0[i] = cf0[i-2] + fac * g(nm1-i/2) ;
605 double c1 = ( fmoins0 - som ) / nm1s2 ;
609 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;