153 fftw_plan back_fft(
int, Tbl*&) ;
154 double* cheb_ini(
const int) ;
155 double* chebimp_ini(
const int ) ;
158 void circhebpimi(
const int* deg,
const int* dimc,
double* cf,
159 const int* dimf,
double* ff)
177 cout <<
"circhebpimi: nr > n3c : nr = " << nr <<
" , n3c = " 183 cout <<
"circhebpimi: nr > n3f : nr = " << nr <<
" , n3f = " 189 cout <<
"circhebpimi: n1c > n1f : n1c = " << n1c <<
" , n1f = " 195 cout <<
"circhebpimi: n2c > n2f : n2c = " << n2c <<
" , n2f = " 207 fftw_plan p = back_fft(nm1, pg) ;
209 double* t1 =
new double[nr] ;
212 double* sinp = cheb_ini(nr);
215 double* x = chebimp_ini(nr);
219 int n2n3f = n2f * n3f ;
220 int n2n3c = n2c * n3c ;
236 for (k=0; k<n2c; k++) {
238 int i0 = n2n3c * j + n3c * k ;
239 double* cf0 = cf + i0 ;
241 i0 = n2n3f * j + n3f * k ;
242 double* ff0 = ff + i0 ;
247 t1[0] = .5 * cf0[0] ;
248 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[i] + cf0[i-1] ) ;
249 t1[nm1] = .5 * cf0[nr-2] ;
267 for ( i = 3; i < nr; i += 2 ) {
268 ff0[i] = t1[i] - c1 ;
273 double fmoins0 = nm1s2 * c1 + som ;
278 for ( i = 3; i < nr; i += 2 ) {
279 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
291 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * t1[2*i] ;
292 g.set(nm1s2) = t1[nm1] ;
303 for ( i = 1; i < nm1s2 ; i++ ) {
309 int ixsym = nm1 - isym ;
311 double fp = .5 * ( g(i) + g(isym) ) ;
312 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
314 ff0[ix] = ( fp + fm ) / x[ix];
315 ff0[ixsym] = ( fp - fm ) / x[ixsym] ;
320 ff0[nm1] = g(0) + fmoins0 ;
321 ff0[nm1s2] = g(nm1s2) / x[nm1s2] ;
331 if ( (j != 1) && (j != n1f-1) ) {
335 for (k=0; k<n2c; k++) {
337 int i0 = n2n3c * j + n3c * k ;
338 double* cf0 = cf + i0 ;
340 i0 = n2n3f * j + n3f * k ;
341 double* ff0 = ff + i0 ;
346 t1[0] = .5 * cf0[0] ;
347 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[i] + cf0[i-1] ) ;
348 t1[nm1] = .5 * cf0[nr-2] ;
366 for ( i = 3; i < nr; i += 2 ) {
367 ff0[i] = t1[i] - c1 ;
372 double fmoins0 = nm1s2 * c1 + som ;
377 for ( i = 3; i < nr; i += 2 ) {
378 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
390 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * t1[2*i] ;
391 g.set(nm1s2) = t1[nm1] ;
402 for ( i = 1; i < nm1s2 ; i++ ) {
408 int ixsym = nm1 - isym ;
410 double fp = .5 * ( g(i) + g(isym) ) ;
411 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
413 ff0[ix] = ( fp + fm ) / x[ix];
414 ff0[ixsym] = ( fp - fm ) / x[ixsym] ;
419 ff0[nm1] = g(0) + fmoins0 ;
420 ff0[nm1s2] = g(nm1s2) / x[nm1s2] ;
449 for (k=0; k<n2c; k++) {
451 int i0 = n2n3c * j + n3c * k ;
452 double* cf0 = cf + i0 ;
454 i0 = n2n3f * j + n3f * k ;
455 double* ff0 = ff + i0 ;
473 for ( i = 3; i < nr; i += 2 ) {
474 ff0[i] = cf0[i] - c1 ;
479 double fmoins0 = nm1s2 * c1 + som ;
484 for ( i = 3; i < nr; i += 2 ) {
485 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
497 for (i=1; i<nm1s2; i++) g.set(i) = 0.5 * cf0[2*i] ;
498 g.set(nm1s2) = cf0[nm1] ;
509 for ( i = 1; i < nm1s2 ; i++ ) {
515 int ixsym = nm1 - isym ;
517 double fp = .5 * ( g(i) + g(isym) ) ;
518 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
521 ff0[ixsym] = fp - fm ;
525 ff0[0] = g(0) - fmoins0 ;
526 ff0[nm1] = g(0) + fmoins0 ;
527 ff0[nm1s2] = g(nm1s2) ;
542 for (k=0; k<n2c; k++) {
544 int i0 = n2n3c * j + n3c * k ;
545 double* cf0 = cf + i0 ;
547 i0 = n2n3f * j + n3f * k ;
548 double* ff0 = ff + i0 ;
566 for ( i = 3; i < nr; i += 2 ) {
567 ff0[i] = cf0[i] - c1 ;
572 double fmoins0 = nm1s2 * c1 + som ;
577 for ( i = 3; i < nr; i += 2 ) {
578 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
590 for (i=1; i<nm1s2; i++) g.set(i) = 0.5 * cf0[2*i] ;
591 g.set(nm1s2) = cf0[nm1] ;
602 for ( i = 1; i < nm1s2 ; i++ ) {
608 int ixsym = nm1 - isym ;
610 double fp = .5 * ( g(i) + g(isym) ) ;
611 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
614 ff0[ixsym] = fp - fm ;
618 ff0[0] = g(0) - fmoins0 ;
619 ff0[nm1] = g(0) + fmoins0 ;
620 ff0[nm1s2] = g(nm1s2) ;