134 fftw_plan prepare_fft(
int, Tbl*&) ;
135 double* cheb_ini(
const int) ;
136 double* chebimp_ini(
const int ) ;
139 void cftcosi(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
158 cout <<
"cftcosi: nt > n2f : nt = " << nt <<
" , n2f = " 164 cout <<
"cftcosi: nt > n2c : nt = " << nt <<
" , n2c = " 170 cout <<
"cftcosi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 176 cout <<
"cftcosi: n3f > n3c : n3f = " << n3f <<
" , n3c = " 188 fftw_plan p = prepare_fft(nm1, pg) ;
192 double* sinp = cheb_ini(nt);
195 double* x = chebimp_ini(nt);
200 int n2n3f = n2f * n3f ;
201 int n2n3c = n2c * n3c ;
209 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
211 for (j=0; j< borne_phi; j++) {
215 for (k=0; k<n3f; k++) {
217 int i0 = n2n3f * j + k ;
218 double* ff0 = ff + i0 ;
221 double* cf0 = cf + i0 ;
227 for (i=0; i<nt-1; i++) cf0[n3c*i] = x[nm1-i] * ff0[n3f*i] ;
236 double fmoins0 = 0.5 * ( cf0[0] - cf0[ n3c*nm1 ] );
240 for ( i = 1; i < nm1s2 ; i++ ) {
246 int ixsym = n3c * isym ;
248 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
250 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
251 g.set(i) = fp + fms ;
252 g.set(isym) = fp - fms ;
255 g.set(0) = 0.5 * ( cf0[0] + cf0[ n3c*nm1 ] );
256 g.set(nm1s2) = cf0[ n3c*nm1s2 ];
270 double fac = 2./double(nm1) ;
271 cf0[0] = g(0) / double(nm1) ;
272 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = fac * g(i/2) ;
273 cf0[n3c*nm1] = g(nm1s2) ;
284 for ( i = 3; i < nt; i += 2 ) {
285 cf0[n3c*i] = cf0[n3c*(i-2)] + fac * g(nm1 - i/2) ;
290 double c1 = ( fmoins0 - som ) / nm1s2 ;
294 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
301 for (i=1; i<nm1; i++) {
302 cf0[n3c*i] = 2 * cf0[n3c*i] - cf0[n3c*(i-1)] ;