152 fftw_plan back_fft(
int, Tbl*&) ;
153 double* cheb_ini(
const int) ;
154 double* chebimp_ini(
const int ) ;
157 void circhebpimp(
const int* deg,
const int* dimc,
double* cf,
158 const int* dimf,
double* ff)
176 cout <<
"circhebpimp: nr > n3c : nr = " << nr <<
" , n3c = " 182 cout <<
"circhebpimp: nr > n3f : nr = " << nr <<
" , n3f = " 188 cout <<
"circhebpimp: n1c > n1f : n1c = " << n1c <<
" , n1f = " 194 cout <<
"circhebpimp: n2c > n2f : n2c = " << n2c <<
" , n2f = " 206 fftw_plan p = back_fft(nm1, pg) ;
208 double* t1 =
new double[nr] ;
211 double* sinp = cheb_ini(nr);
214 double* x = chebimp_ini(nr);
218 int n2n3f = n2f * n3f ;
219 int n2n3c = n2c * n3c ;
234 for (k=0; k<n2c; k++) {
236 int i0 = n2n3c * j + n3c * k ;
237 double* cf0 = cf + i0 ;
239 i0 = n2n3f * j + n3f * k ;
240 double* ff0 = ff + i0 ;
258 for ( i = 3; i < nr; i += 2 ) {
259 ff0[i] = cf0[i] - c1 ;
264 double fmoins0 = nm1s2 * c1 + som ;
269 for ( i = 3; i < nr; i += 2 ) {
270 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
282 for (i=1; i<nm1s2; i++) g.set(i) = 0.5 * cf0[2*i] ;
283 g.set(nm1s2) = cf0[nm1] ;
294 for ( i = 1; i < nm1s2 ; i++ ) {
300 int ixsym = nm1 - isym ;
302 double fp = .5 * ( g(i) + g(isym) ) ;
303 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
306 ff0[ixsym] = fp - fm ;
310 ff0[0] = g(0) - fmoins0 ;
311 ff0[nm1] = g(0) + fmoins0 ;
312 ff0[nm1s2] = g(nm1s2) ;
322 if ( (j != 1) && (j != n1f-1) ) {
326 for (k=0; k<n2c; k++) {
328 int i0 = n2n3c * j + n3c * k ;
329 double* cf0 = cf + i0 ;
331 i0 = n2n3f * j + n3f * k ;
332 double* ff0 = ff + i0 ;
350 for ( i = 3; i < nr; i += 2 ) {
351 ff0[i] = cf0[i] - c1 ;
356 double fmoins0 = nm1s2 * c1 + som ;
361 for ( i = 3; i < nr; i += 2 ) {
362 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
374 for (i=1; i<nm1s2; i++) g.set(i) = 0.5 * cf0[2*i] ;
375 g.set(nm1s2) = cf0[nm1] ;
386 for ( i = 1; i < nm1s2 ; i++ ) {
392 int ixsym = nm1 - isym ;
394 double fp = .5 * ( g(i) + g(isym) ) ;
395 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
398 ff0[ixsym] = fp - fm ;
402 ff0[0] = g(0) - fmoins0 ;
403 ff0[nm1] = g(0) + fmoins0 ;
404 ff0[nm1s2] = g(nm1s2) ;
434 for (k=0; k<n2c; k++) {
436 int i0 = n2n3c * j + n3c * k ;
437 double* cf0 = cf + i0 ;
439 i0 = n2n3f * j + n3f * k ;
440 double* ff0 = ff + i0 ;
446 t1[0] = .5 * cf0[0] ;
447 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[i] + cf0[i-1] ) ;
448 t1[nm1] = .5 * cf0[nr-2] ;
466 for ( i = 3; i < nr; i += 2 ) {
467 ff0[i] = t1[i] - c1 ;
472 double fmoins0 = nm1s2 * c1 + som ;
477 for ( i = 3; i < nr; i += 2 ) {
478 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
490 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * t1[2*i] ;
491 g.set(nm1s2) = t1[nm1] ;
502 for ( i = 1; i < nm1s2 ; i++ ) {
508 int ixsym = nm1 - isym ;
510 double fp = .5 * ( g(i) + g(isym) ) ;
511 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
513 ff0[ix] = ( fp + fm ) / x[ix];
514 ff0[ixsym] = ( fp - fm ) / x[ixsym] ;
519 ff0[nm1] = g(0) + fmoins0 ;
520 ff0[nm1s2] = g(nm1s2) / x[nm1s2] ;
533 for (k=0; k<n2c; k++) {
535 int i0 = n2n3c * j + n3c * k ;
536 double* cf0 = cf + i0 ;
538 i0 = n2n3f * j + n3f * k ;
539 double* ff0 = ff + i0 ;
544 t1[0] = .5 * cf0[0] ;
545 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[i] + cf0[i-1] ) ;
546 t1[nm1] = .5 * cf0[nr-2] ;
564 for ( i = 3; i < nr; i += 2 ) {
565 ff0[i] = t1[i] - c1 ;
570 double fmoins0 = nm1s2 * c1 + som ;
575 for ( i = 3; i < nr; i += 2 ) {
576 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
588 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * t1[2*i] ;
589 g.set(nm1s2) = t1[nm1] ;
600 for ( i = 1; i < nm1s2 ; i++ ) {
606 int ixsym = nm1 - isym ;
608 double fp = .5 * ( g(i) + g(isym) ) ;
609 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
611 ff0[ix] = ( fp + fm ) / x[ix];
612 ff0[ixsym] = ( fp - fm ) / x[ixsym] ;
617 ff0[nm1] = g(0) + fmoins0 ;
618 ff0[nm1s2] = g(nm1s2) / x[nm1s2] ;