139 fftw_plan prepare_fft(
int, Tbl*&) ;
140 double* cheb_ini(
const int) ;
141 double* chebimp_ini(
const int ) ;
145 void cfrchebi(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
165 cout <<
"cfrchebi: nr > n3f : nr = " << nr <<
" , n3f = " 171 cout <<
"cfrchebi: nr > n3c : nr = " << nr <<
" , n3c = " 177 cout <<
"cfrchebi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 183 cout <<
"cfrchebi: n2f > n2c : n2f = " << n2f <<
" , n2c = " 195 fftw_plan p = prepare_fft(nm1, pg) ;
199 double* sinp = cheb_ini(nr);
202 double* x = chebimp_ini(nr);
206 int n2n3f = n2f * n3f ;
207 int n2n3c = n2c * n3c ;
215 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
217 for (j=0; j< borne_phi; j++) {
221 for (k=0; k<n2f; k++) {
223 int i0 = n2n3f * j + n3f * k ;
224 double* ff0 = ff + i0 ;
226 i0 = n2n3c * j + n3c * k ;
227 double* cf0 = cf + i0 ;
234 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
242 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
246 for ( i = 1; i < nm1s2 ; i++ ) {
252 int ixsym = nm1 - isym ;
255 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
257 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
258 g.set(i) = fp + fms ;
259 g.set(isym) = fp - fms ;
262 g.set(0) = 0.5 * ( cf0[nm1] + cf0[0] );
263 g.set(nm1s2) = cf0[nm1s2];
277 double fac = 2./double(nm1) ;
278 cf0[0] = g(0) / double(nm1) ;
279 for (i=2; i<nm1; i += 2 ) cf0[i] = fac * g(i/2) ;
280 cf0[nm1] = g(nm1s2) / double(nm1) ;
291 for ( i = 3; i < nr; i += 2 ) {
292 cf0[i] = cf0[i-2] + fac * g(nm1 - i/2) ;
297 double c1 = ( fmoins0 - som ) / nm1s2 ;
301 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
307 for (i=1; i<nm1; i++) {
308 cf0[i] = 2 * cf0[i] - cf0[i-1] ;