133 fftw_plan prepare_fft(
int, Tbl*&) ;
134 double* cheb_ini(
const int) ;
135 double* chebimp_ini(
const int ) ;
138 void cftsini(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
157 cout <<
"cftsini: nt > n2f : nt = " << nt <<
" , n2f = " 163 cout <<
"cftsini: nt > n2c : nt = " << nt <<
" , n2c = " 169 cout <<
"cftsini: n1f > n1c : n1f = " << n1f <<
" , n1c = " 175 cout <<
"cftsini: n3f > n3c : n3f = " << n3f <<
" , n3c = " 187 fftw_plan p = prepare_fft(nm1, pg) ;
191 double* sinp = cheb_ini(nt);
194 double* sinth = chebimp_ini(nt);
199 int n2n3f = n2f * n3f ;
200 int n2n3c = n2c * n3c ;
208 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
210 for (j=0; j< borne_phi; j++) {
214 for (k=0; k<n3f; k++) {
216 int i0 = n2n3f * j + k ;
217 double* ff0 = ff + i0 ;
220 double* cf0 = cf + i0 ;
229 for (i=1; i<nt; i++) cf0[n3c*i] = sinth[i] * ff0[n3f*i] ;
237 double fmoins0 = 0.5 * ( cf0[0] - cf0[ n3c*nm1 ] );
241 for ( i = 1; i < nm1s2 ; i++ ) {
247 int ixsym = n3c * isym ;
249 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
251 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
252 g.set(i) = fp + fms ;
253 g.set(isym) = fp - fms ;
256 g.set(0) = 0.5 * ( cf0[0] + cf0[ n3c*nm1 ] );
257 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)/double(nm1) ;
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 ;
300 for (i=1; i<nm1; i++) {
301 cf0[n3c*i] = 2 * cf0[n3c*i] + cf0[n3c*(i-1)] ;