136 fftw_plan prepare_fft(
int, Tbl*&) ;
137 double* cheb_ini(
const int) ;
141 void cfrchebp(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
161 cout <<
"cfrchebp: nr > n3f : nr = " << nr <<
" , n3f = " 167 cout <<
"cfrchebp: nr > n3c : nr = " << nr <<
" , n3c = " 173 cout <<
"cfrchebp: n1f > n1c : n1f = " << n1f <<
" , n1c = " 179 cout <<
"cfrchebp: n2f > n2c : n2f = " << n2f <<
" , n2c = " 191 fftw_plan p = prepare_fft(nm1, pg) ;
195 double* sinp = cheb_ini(nr);
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<n2f; k++) {
216 int i0 = n2n3f * j + n3f * k ;
217 double* ff0 = ff + i0 ;
219 i0 = n2n3c * j + n3c * k ;
220 double* cf0 = cf + i0 ;
228 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
232 for ( i = 1; i < nm1s2 ; i++ ) {
238 int ixsym = nm1 - isym ;
241 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
243 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
244 g.set(i) = fp + fms ;
245 g.set(isym) = fp - fms ;
248 g.set(0) = 0.5 * ( ff0[nm1] + ff0[0] );
249 g.set(nm1s2) = ff0[nm1s2];
262 double fac = 2./double(nm1) ;
263 cf0[0] = g(0) / double(nm1) ;
264 for (i=2; i<nm1; i += 2) cf0[i] = fac*g(i/2) ;
265 cf0[nm1] = g(nm1s2) / double(nm1) ;
276 for ( i = 3; i < nr; i += 2 ) {
277 cf0[i] = cf0[i-2] + fac * g(nm1-i/2) ;
282 double c1 = ( fmoins0 - som ) / nm1s2 ;
286 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;