136 fftw_plan back_fft(
int, Tbl*&) ;
137 double* cheb_ini(
const int) ;
138 double* chebimp_ini(
const int ) ;
141 void citcossinsi(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
160 cout <<
"citcossinsi: nt > n2f : nt = " << nt <<
" , n2f = " 166 cout <<
"citcossinsi: nt > n2c : nt = " << nt <<
" , n2c = " 171 if ( (n1f > 1) && (n1c > n1f)) {
172 cout <<
"citcossinsi: n1c > n1f : n1c = " << n1c <<
" , n1f = " 178 cout <<
"citcossinsi: n3c > n3f : n3c = " << n3c <<
" , n3f = " 190 fftw_plan p = back_fft(nm1, pg) ;
192 double* t1 =
new double[nt] ;
195 double* sinp = cheb_ini(nt);
198 double* sinth = chebimp_ini(nt);
203 int n2n3f = n2f * n3f ;
204 int n2n3c = n2c * n3c ;
206 int borne_phi = n1f-1 ;
207 if (n1f == 1) borne_phi = 1 ;
214 while (j<borne_phi) {
221 for (k=0; k<n3c; k++) {
223 int i0 = n2n3c * j + k ;
224 double* cf0 = cf + i0 ;
227 double* ff0 = ff + i0 ;
232 t1[0] = .5 * cf0[0] ;
233 for (i=1; i<nm1; i++) {
234 t1[i] = .5 * ( cf0[ n3c*i ] - cf0[ n3c*(i-1) ] ) ;
236 t1[nm1] = -.5 * cf0[ n3c*(nt-2) ] ;
254 for ( i = 3; i < nt; i += 2 ) {
255 ff0[ n3f*i ] = t1[i] - c1 ;
256 som += ff0[ n3f*i ] ;
260 double fmoins0 = nm1s2 * c1 + som ;
265 for ( i = 3; i < nt; i += 2 ) {
266 g.set(nm1-i/2) = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
277 for (i=1; i<nm1s2; i ++ ) g.set(i) = 0.5 * t1[2*i] ;
278 g.set(nm1s2) = t1[nm1] ;
289 for ( i = 1; i < nm1s2 ; i++ ) {
293 double fp = 0.5 * ( g(i) + g(isym) ) ;
294 double fm = 0.5 * ( g(i) - g(isym) ) / sinp[i] ;
295 ff0[ n3f*i ] = ( fp + fm ) / sinth[i] ;
296 ff0[ n3f*isym ] = ( fp - fm ) / sinth[isym] ;
301 ff0[ n3f*nm1 ] = g(0) - fmoins0 ;
302 ff0[ n3f*nm1s2 ] = g(nm1s2) / sinth[nm1s2];
312 if ( (j != 1) && (j != borne_phi ) ) {
316 for (k=0; k<n3c; k++) {
318 int i0 = n2n3c * j + k ;
319 double* cf0 = cf + i0 ;
322 double* ff0 = ff + i0 ;
327 t1[0] = .5 * cf0[0] ;
328 for (i=1; i<nm1; i++) {
329 t1[i] = .5 * ( cf0[ n3c*i ] - cf0[ n3c*(i-1) ] ) ;
331 t1[nm1] = -.5 * cf0[ n3c*(nt-2) ] ;
349 for ( i = 3; i < nt; i += 2 ) {
350 ff0[ n3f*i ] = t1[i] - c1 ;
351 som += ff0[ n3f*i ] ;
355 double fmoins0 = nm1s2 * c1 + som ;
360 for ( i = 3; i < nt; i += 2 ) {
361 g.set(nm1-i/2) = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
372 for (i=1; i<nm1s2; i ++ ) g.set(i) = 0.5 * t1[2*i] ;
373 g.set(nm1s2) = t1[nm1] ;
384 for ( i = 1; i < nm1s2 ; i++ ) {
388 double fp = 0.5 * ( g(i) + g(isym) ) ;
389 double fm = 0.5 * ( g(i) - g(isym) ) / sinp[i] ;
390 ff0[ n3f*i ] = ( fp + fm ) / sinth[i] ;
391 ff0[ n3f*isym ] = ( fp - fm ) / sinth[isym] ;
396 ff0[ n3f*nm1 ] = g(0) - fmoins0 ;
397 ff0[ n3f*nm1s2 ] = g(nm1s2) / sinth[nm1s2];
421 while (j < borne_phi) {
428 for (k=0; k<n3c; k++) {
430 int i0 = n2n3c * j + k ;
431 double* cf0 = cf + i0 ;
434 double* ff0 = ff + i0 ;
448 double c1 = cf0[n3c] ;
452 for ( i = 3; i < nt; i += 2 ) {
453 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
454 som += ff0[ n3f*i ] ;
458 double fmoins0 = nm1s2 * c1 + som ;
463 for ( i = 3; i < nt; i += 2 ) {
464 g.set(nm1-i/2) = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
476 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * cf0[ n3c*2*i ] ;
477 g.set(nm1s2) = cf0[ n3c*nm1 ] ;
488 for ( i = 1; i < nm1s2 ; i++ ) {
492 double fp = 0.5 * ( g(i) + g(isym) ) ;
493 double fm = 0.5 * ( g(i) - g(isym) ) / sinp[i] ;
494 ff0[ n3f*i ] = fp + fm ;
495 ff0[ n3f*isym ] = fp - fm ;
499 ff0[0] = g(0) + fmoins0 ;
500 ff0[ n3f*nm1 ] = g(0) - fmoins0 ;
501 ff0[ n3f*nm1s2 ] = g(nm1s2) ;
511 if ( j != borne_phi ) {
515 for (k=0; k<n3c; k++) {
517 int i0 = n2n3c * j + k ;
518 double* cf0 = cf + i0 ;
521 double* ff0 = ff + i0 ;
535 double c1 = cf0[n3c] ;
539 for ( i = 3; i < nt; i += 2 ) {
540 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
541 som += ff0[ n3f*i ] ;
545 double fmoins0 = nm1s2 * c1 + som ;
550 for ( i = 3; i < nt; i += 2 ) {
551 g.set(nm1-i/2) = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
563 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * cf0[ n3c*2*i ] ;
564 g.set(nm1s2) = cf0[ n3c*nm1 ] ;
575 for ( i = 1; i < nm1s2 ; i++ ) {
579 double fp = 0.5 * ( g(i) + g(isym) ) ;
580 double fm = 0.5 * ( g(i) - g(isym) ) / sinp[i] ;
581 ff0[ n3f*i ] = fp + fm ;
582 ff0[ n3f*isym ] = fp - fm ;
586 ff0[0] = g(0) + fmoins0 ;
587 ff0[ n3f*nm1 ] = g(0) - fmoins0 ;
588 ff0[ n3f*nm1s2 ] = g(nm1s2) ;