121 fftw_plan prepare_fft(
int, Tbl*&) ;
122 double* cheb_ini(
const int) ;
123 double* chebimp_ini(
const int ) ;
127 void cfrchebpip(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
147 cout <<
"cfrchebpip: nr > n3f : nr = " << nr <<
" , n3f = " 153 cout <<
"cfrchebpip: nr > n3c : nr = " << nr <<
" , n3c = " 159 cout <<
"cfrchebpip: n1f > n1c : n1f = " << n1f <<
" , n1c = " 165 cout <<
"cfrchebpip: n2f > n2c : n2f = " << n2f <<
" , n2c = " 177 fftw_plan p = prepare_fft(nm1, pg) ;
181 double* sinp = cheb_ini(nr);
184 double* x = chebimp_ini(nr);
188 int n2n3f = n2f * n3f ;
189 int n2n3c = n2c * n3c ;
197 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
199 for (j=0; j< borne_phi; j++) {
205 for (k=0; k<n2f; k+=2) {
207 int i0 = n2n3f * j + n3f * k ;
208 double* ff0 = ff + i0 ;
210 i0 = n2n3c * j + n3c * k ;
211 double* cf0 = cf + i0 ;
215 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
219 for ( i = 1; i < nm1s2 ; i++ ) {
225 int ixsym = nm1 - isym ;
228 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
230 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
231 g.set(i) = fp + fms ;
232 g.set(isym) = fp - fms ;
235 g.set(0) = 0.5 * ( ff0[nm1] + ff0[0] );
236 g.set(nm1s2) = ff0[nm1s2];
249 double fac = 2./double(nm1) ;
250 cf0[0] = g(0) / double(nm1) ;
251 for (i=2; i<nm1; i += 2) cf0[i] = fac*g(i/2) ;
252 cf0[nm1] = g(nm1s2) / double(nm1) ;
263 for ( i = 3; i < nr; i += 2 ) {
264 cf0[i] = cf0[i-2] + fac * g(nm1-i/2) ;
269 double c1 = ( fmoins0 - som ) / nm1s2 ;
273 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
280 for (k=1; k<n2f; k+=2) {
281 int i0 = n2n3f * j + n3f * k ;
282 double* ff0 = ff + i0 ;
284 i0 = n2n3c * j + n3c * k ;
285 double* cf0 = cf + i0 ;
292 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
296 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
300 for ( i = 1; i < nm1s2 ; i++ ) {
306 int ixsym = nm1 - isym ;
309 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
311 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
312 g.set(i) = fp + fms ;
313 g.set(isym) = fp - fms ;
316 g.set(0) = 0.5 * ( cf0[nm1] + cf0[0] );
317 g.set(nm1s2) = cf0[nm1s2];
331 double fac = 2./double(nm1) ;
332 cf0[0] = g(0) / double(nm1) ;
333 for (i=2; i<nm1; i += 2 ) cf0[i] = fac * g(i/2) ;
334 cf0[nm1] = g(nm1s2) / double(nm1) ;
345 for ( i = 3; i < nr; i += 2 ) {
346 cf0[i] = cf0[i-2] + fac * g(nm1 - i/2) ;
351 double c1 = ( fmoins0 - som ) / nm1s2 ;
355 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
361 for (i=1; i<nm1; i++) {
362 cf0[i] = 2 * cf0[i] - cf0[i-1] ;