121 fftw_plan prepare_fft(
int, Tbl*&) ;
122 double* cheb_ini(
const int) ;
123 double* chebimp_ini(
const int ) ;
127 void cfrchebpii(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
147 cout <<
"cfrchebpii: nr > n3f : nr = " << nr <<
" , n3f = " 153 cout <<
"cfrchebpii: nr > n3c : nr = " << nr <<
" , n3c = " 159 cout <<
"cfrchebpii: n1f > n1c : n1f = " << n1f <<
" , n1c = " 165 cout <<
"cfrchebpii: 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=1; 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 * ( cf0[nm1] + cf0[0] );
236 g.set(nm1s2) = cf0[nm1s2];
250 double fac = 2./double(nm1) ;
251 cf0[0] = g(0) / double(nm1) ;
252 for (i=2; i<nm1; i += 2 ) cf0[i] = fac * g(i/2) ;
253 cf0[nm1] = g(nm1s2) / double(nm1) ;
264 for ( i = 3; i < nr; i += 2 ) {
265 cf0[i] = cf0[i-2] + fac * g(nm1 - i/2) ;
270 double c1 = ( fmoins0 - som ) / nm1s2 ;
274 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
281 for (k=0; k<n2f; k+=2) {
282 int i0 = n2n3f * j + n3f * k ;
283 double* ff0 = ff + i0 ;
285 i0 = n2n3c * j + n3c * k ;
286 double* cf0 = cf + i0 ;
293 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 * ( ff0[nm1] + ff0[0] );
317 g.set(nm1s2) = ff0[nm1s2];
330 double fac = 2./double(nm1) ;
331 cf0[0] = g(0) / double(nm1) ;
332 for (i=2; i<nm1; i += 2) cf0[i] = fac*g(i/2) ;
333 cf0[nm1] = g(nm1s2) / double(nm1) ;
344 for ( i = 3; i < nr; i += 2 ) {
345 cf0[i] = cf0[i-2] + fac * g(nm1-i/2) ;
350 double c1 = ( fmoins0 - som ) / nm1s2 ;
354 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
360 for (i=1; i<nm1; i++) {
361 cf0[i] = 2 * cf0[i] - cf0[i-1] ;