122 fftw_plan prepare_fft(
int, Tbl*&) ;
123 double* cheb_ini(
const int) ;
127 void cftcos(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
146 cout <<
"cftcos: nt > n2f : nt = " << nt <<
" , n2f = " 152 cout <<
"cftcos: nt > n2c : nt = " << nt <<
" , n2c = " 158 cout <<
"cftcos: n1f > n1c : n1f = " << n1f <<
" , n1c = " 164 cout <<
"cftcos: n3f > n3c : n3f = " << n3f <<
" , n3c = " 176 fftw_plan p = prepare_fft(nm1, pg) ;
180 double* sinp = cheb_ini(nt);
185 int n2n3f = n2f * n3f ;
186 int n2n3c = n2c * n3c ;
194 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
196 for (j=0; j< borne_phi; j++) {
200 for (k=0; k<n3f; k++) {
202 int i0 = n2n3f * j + k ;
203 double* ff0 = ff + i0 ;
206 double* cf0 = cf + i0 ;
213 double fmoins0 = 0.5 * ( ff0[0] - ff0[ n3f*nm1 ] );
217 for ( i = 1; i < nm1s2 ; i++ ) {
223 int ixsym = n3f * isym ;
225 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
227 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
228 g.set(i) = fp + fms ;
229 g.set(isym) = fp - fms ;
232 g.set(0) = 0.5 * ( ff0[0] + ff0[ n3f*nm1 ] );
233 g.set(nm1s2) = ff0[ n3f*nm1s2 ];
246 double fac = 2./double(nm1) ;
247 cf0[0] = g(0) / double(nm1) ;
248 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = fac*g(i/2) ;
249 cf0[n3c*nm1] = g(nm1s2) / double(nm1) ;
260 for ( i = 3; i < nt; i += 2 ) {
261 cf0[n3c*i] = cf0[n3c*(i-2)] + fac * g(nm1 - i/2) ;
266 double c1 = ( fmoins0 - som ) / nm1s2 ;
270 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;