115 fftw_plan prepare_fft(
int, Tbl*&) ;
116 double* cheb_ini(
const int) ;
119 void cftsin(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
138 cout <<
"cftsin: nt > n2f : nt = " << nt <<
" , n2f = " 144 cout <<
"cftsin: nt > n2c : nt = " << nt <<
" , n2c = " 150 cout <<
"cftsin: n1f > n1c : n1f = " << n1f <<
" , n1c = " 156 cout <<
"cftsin: n3f > n3c : n3f = " << n3f <<
" , n3c = " 168 fftw_plan p = prepare_fft(nm1, pg) ;
172 double* sinp = cheb_ini(nt);
177 int n2n3f = n2f * n3f ;
178 int n2n3c = n2c * n3c ;
186 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
188 for (j=0; j< borne_phi; j++) {
192 for (k=0; k<n3f; k++) {
194 int i0 = n2n3f * j + k ;
195 double* ff0 = ff + i0 ;
198 double* cf0 = cf + i0 ;
202 for ( i = 1; i < nm1s2 ; i++ ) {
208 int ixsym = n3f * isym ;
210 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) * sinp[i] ;
212 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) ;
213 g.set(i) = fp + fms ;
214 g.set(isym) = fp - fms ;
217 g.set(0) = 0.5 * ( ff0[0] + ff0[ n3f*nm1 ] );
218 g.set(nm1s2) = ff0[ n3f*nm1s2 ];
231 double fac = -2. / double(nm1) ;
233 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = fac * g(nm1 - i/2) ;
243 cf0[n3c] = -fac * g(0);
245 for ( i = 3; i < nt; i += 2 ) {
246 cf0[n3c*i] = cf0[n3c*(i-2)] + fac * g(i/2) ;