117 fftw_plan back_fft(
int, Tbl*&) ;
118 double* cheb_ini(
const int) ;
121 void citcossins(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
140 cout <<
"citcossins: nt > n2f : nt = " << nt <<
" , n2f = " 146 cout <<
"citcossins: nt > n2c : nt = " << nt <<
" , n2c = " 152 cout <<
"citcossins: n1c > n1f : n1c = " << n1c <<
" , n1f = " 158 cout <<
"citcossins: 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 ;
206 for (i=2; i<nm1; i += 2 ) g.set(nm1-i/2) = -0.5 * cf0[ n3c*i ] ;
211 g.set(0) = .5 * cf0[n3c] ;
212 for ( i = 3; i < nt; i += 2 ) {
213 g.set(i/2) = .25 * ( cf0[ n3c*i ] - cf0[ n3c*(i-2) ] ) ;
215 g.set(nm1s2) = - .5 * cf0[ n3c*(nt-2) ] ;
226 for ( i = 1; i < nm1s2 ; i++ ) {
230 double fp = 0.5 * ( g(i) + g(isym) ) / sinp[i] ;
231 double fm = 0.5 * ( g(i) - g(isym) ) ;
232 ff0[ n3f*i ] = fp + fm ;
233 ff0[ n3f*isym ] = fp - fm ;
238 ff0[ n3f*nm1 ] = -2*g(0) ;
239 ff0[ n3f*nm1s2 ] = g(nm1s2) ;
252 for (k=0; k<n3c; k++) {
254 int i0 = n2n3c * j + k ;
255 double* cf0 = cf + i0 ;
258 double* ff0 = ff + i0 ;
263 for (i=2; i<nm1; i += 2 ) g.set(nm1-i/2) = -0.5 * cf0[ n3c*i ] ;
268 g.set(0) = .5 * cf0[n3c] ;
269 for ( i = 3; i < nt; i += 2 ) {
270 g.set(i/2) = .25 * ( cf0[ n3c*i ] - cf0[ n3c*(i-2) ] ) ;
272 g.set(nm1s2) = - .5 * cf0[ n3c*(nt-2) ] ;
283 for ( i = 1; i < nm1s2 ; i++ ) {
287 double fp = 0.5 * ( g(i) + g(isym) ) / sinp[i] ;
288 double fm = 0.5 * ( g(i) - g(isym) ) ;
289 ff0[ n3f*i ] = fp + fm ;
290 ff0[ n3f*isym ] = fp - fm ;
295 ff0[ n3f*nm1 ] = -2*g(0) ;
296 ff0[ n3f*nm1s2 ] = g(nm1s2) ;
323 for (k=0; k<n3c; k++) {
325 int i0 = n2n3c * j + k ;
326 double* cf0 = cf + i0 ;
329 double* ff0 = ff + i0 ;
335 double c1 = cf0[n3c] ;
339 for ( i = 3; i < nt; i += 2 ) {
340 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
341 som += ff0[ n3f*i ] ;
345 double fmoins0 = nm1s2 * c1 + som ;
350 for ( i = 3; i < nt; i += 2 ) {
351 g.set(nm1-i/2) = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
363 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * cf0[ n3c*2*i ] ;
364 g.set(nm1s2) = cf0[ n3c*nm1 ] ;
375 for ( i = 1; i < nm1s2 ; i++ ) {
379 double fp = 0.5 * ( g(i) + g(isym) ) ;
380 double fm = 0.5 * ( g(i) - g(isym) ) / sinp[i] ;
381 ff0[ n3f*i ] = fp + fm ;
382 ff0[ n3f*isym ] = fp - fm ;
386 ff0[0] = g(0) + fmoins0 ;
387 ff0[ n3f*nm1 ] = g(0) - fmoins0 ;
388 ff0[ n3f*nm1s2 ] = g(nm1s2) ;
398 if ( (j != 1) && (j != n1f-1 ) ) {
402 for (k=0; k<n3c; k++) {
404 int i0 = n2n3c * j + k ;
405 double* cf0 = cf + i0 ;
408 double* ff0 = ff + i0 ;
413 double c1 = cf0[n3c] ;
417 for ( i = 3; i < nt; i += 2 ) {
418 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
419 som += ff0[ n3f*i ] ;
423 double fmoins0 = nm1s2 * c1 + som ;
428 for ( i = 3; i < nt; i += 2 ) {
429 g.set(nm1-i/2) = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
441 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * cf0[ n3c*2*i ] ;
442 g.set(nm1s2) = cf0[ n3c*nm1 ] ;
453 for ( i = 1; i < nm1s2 ; i++ ) {
457 double fp = 0.5 * ( g(i) + g(isym) ) ;
458 double fm = 0.5 * ( g(i) - g(isym) ) / sinp[i] ;
459 ff0[ n3f*i ] = fp + fm ;
460 ff0[ n3f*isym ] = fp - fm ;
464 ff0[0] = g(0) + fmoins0 ;
465 ff0[ n3f*nm1 ] = g(0) - fmoins0 ;
466 ff0[ n3f*nm1s2 ] = g(nm1s2) ;