117 fftw_plan back_fft(
int, Tbl*&) ;
118 double* cheb_ini(
const int) ;
121 void citcossinc(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
140 cout <<
"citcossinc: nt > n2f : nt = " << nt <<
" , n2f = " 146 cout <<
"citcossinc: nt > n2c : nt = " << nt <<
" , n2c = " 152 cout <<
"citcossinc: n1c > n1f : n1c = " << n1c <<
" , n1f = " 158 cout <<
"citcossinc: n3c > n3f : n3c = " << n3c <<
" , n3f = " 170 fftw_plan p = back_fft(nm1, pg) ;
174 double* sinp = cheb_ini(nt);
179 int n2n3f = n2f * n3f ;
180 int n2n3c = n2c * n3c ;
195 for (k=0; k<n3c; k++) {
197 int i0 = n2n3c * j + k ;
198 double* cf0 = cf + i0 ;
201 double* ff0 = ff + i0 ;
207 double c1 = cf0[n3c] ;
211 for ( i = 3; i < nt; i += 2 ) {
212 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
213 som += ff0[ n3f*i ] ;
217 double fmoins0 = nm1s2 * c1 + som ;
222 for ( i = 3; i < nt; i += 2 ) {
223 g.set(nm1-i/2) = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
235 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * cf0[ n3c*2*i ] ;
236 g.set(nm1s2) = cf0[ n3c*nm1 ] ;
247 for ( i = 1; i < nm1s2 ; i++ ) {
251 double fp = 0.5 * ( g(i) + g(isym) ) ;
252 double fm = 0.5 * ( g(i) - g(isym) ) / sinp[i] ;
253 ff0[ n3f*i ] = fp + fm ;
254 ff0[ n3f*isym ] = fp - fm ;
258 ff0[0] = g(0) + fmoins0 ;
259 ff0[ n3f*nm1 ] = g(0) - fmoins0 ;
260 ff0[ n3f*nm1s2 ] = g(nm1s2) ;
269 if ( (j != 1) && (j != n1f-1 ) ) {
273 for (k=0; k<n3c; k++) {
275 int i0 = n2n3c * j + k ;
276 double* cf0 = cf + i0 ;
279 double* ff0 = ff + i0 ;
284 double c1 = cf0[n3c] ;
288 for ( i = 3; i < nt; i += 2 ) {
289 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
290 som += ff0[ n3f*i ] ;
294 double fmoins0 = nm1s2 * c1 + som ;
299 for ( i = 3; i < nt; i += 2 ) {
300 g.set(nm1-i/2) = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
312 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * cf0[ n3c*2*i ] ;
313 g.set(nm1s2) = cf0[ n3c*nm1 ] ;
324 for ( i = 1; i < nm1s2 ; i++ ) {
328 double fp = 0.5 * ( g(i) + g(isym) ) ;
329 double fm = 0.5 * ( g(i) - g(isym) ) / sinp[i] ;
330 ff0[ n3f*i ] = fp + fm ;
331 ff0[ n3f*isym ] = fp - fm ;
335 ff0[0] = g(0) + fmoins0 ;
336 ff0[ n3f*nm1 ] = g(0) - fmoins0 ;
337 ff0[ n3f*nm1s2 ] = g(nm1s2) ;
365 for (k=0; k<n3c; k++) {
367 int i0 = n2n3c * j + k ;
368 double* cf0 = cf + i0 ;
371 double* ff0 = ff + i0 ;
376 for (i=2; i<nm1; i += 2 ) g.set(nm1-i/2) = -0.5 * cf0[ n3c*i ] ;
381 g.set(0) = .5 * cf0[n3c] ;
382 for ( i = 3; i < nt; i += 2 ) {
383 g.set(i/2) = .25 * ( cf0[ n3c*i ] - cf0[ n3c*(i-2) ] ) ;
385 g.set(nm1s2) = - .5 * cf0[ n3c*(nt-2) ] ;
396 for ( i = 1; i < nm1s2 ; i++ ) {
400 double fp = 0.5 * ( g(i) + g(isym) ) / sinp[i] ;
401 double fm = 0.5 * ( g(i) - g(isym) ) ;
402 ff0[ n3f*i ] = fp + fm ;
403 ff0[ n3f*isym ] = fp - fm ;
408 ff0[ n3f*nm1 ] = -2*g(0) ;
409 ff0[ n3f*nm1s2 ] = g(nm1s2) ;
422 for (k=0; k<n3c; k++) {
424 int i0 = n2n3c * j + k ;
425 double* cf0 = cf + i0 ;
428 double* ff0 = ff + i0 ;
433 for (i=2; i<nm1; i += 2 ) g.set(nm1-i/2) = -0.5 * cf0[ n3c*i ] ;
438 g.set(0) = .5 * cf0[n3c] ;
439 for ( i = 3; i < nt; i += 2 ) {
440 g.set(i/2) = .25 * ( cf0[ n3c*i ] - cf0[ n3c*(i-2) ] ) ;
442 g.set(nm1s2) = - .5 * cf0[ n3c*(nt-2) ] ;
453 for ( i = 1; i < nm1s2 ; i++ ) {
457 double fp = 0.5 * ( g(i) + g(isym) ) / sinp[i] ;
458 double fm = 0.5 * ( g(i) - g(isym) ) ;
459 ff0[ n3f*i ] = fp + fm ;
460 ff0[ n3f*isym ] = fp - fm ;
465 ff0[ n3f*nm1 ] = -2*g(0) ;
466 ff0[ n3f*nm1s2 ] = g(nm1s2) ;