119 fftw_plan back_fft(
int, Tbl*&) ;
120 double* cheb_ini(
const int) ;
121 double* chebimp_ini(
const int ) ;
125 void circhebpip(
const int* deg,
const int* dimc,
double* cf,
126 const int* dimf,
double* ff)
145 cout <<
"circhebpip: nr > n3c : nr = " << nr <<
" , n3c = " 151 cout <<
"circhebpip: nr > n3f : nr = " << nr <<
" , n3f = " 157 cout <<
"circhebpip: n1c > n1f : n1c = " << n1c <<
" , n1f = " 163 cout <<
"circhebpip: n2c > n2f : n2c = " << n2c <<
" , n2f = " 175 fftw_plan p = back_fft(nm1, pg) ;
177 double* t1 =
new double[nr] ;
180 double* sinp = cheb_ini(nr);
183 double* x = chebimp_ini(nr);
187 int n2n3f = n2f * n3f ;
188 int n2n3c = n2c * n3c ;
196 int borne_phi = ( n1c > 1 ) ? n1c-1 : 1 ;
198 for (j=0; j< borne_phi; j++) {
205 for (k=0; k<n2c; k+=2) {
207 int i0 = n2n3c * j + n3c * k ;
208 double* cf0 = cf + i0 ;
210 i0 = n2n3f * j + n3f * k ;
211 double* ff0 = ff + i0 ;
225 for ( i = 3; i < nr; i += 2 ) {
226 ff0[i] = cf0[i] - c1 ;
231 double fmoins0 = nm1s2 * c1 + som ;
236 for ( i = 3; i < nr; i += 2 ) {
237 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
249 for (i=1; i<nm1s2; i++) g.set(i) = 0.5 * cf0[2*i] ;
250 g.set(nm1s2) = cf0[nm1] ;
261 for ( i = 1; i < nm1s2 ; i++ ) {
267 int ixsym = nm1 - isym ;
269 double fp = .5 * ( g(i) + g(isym) ) ;
270 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
273 ff0[ixsym] = fp - fm ;
277 ff0[0] = g(0) - fmoins0 ;
278 ff0[nm1] = g(0) + fmoins0 ;
279 ff0[nm1s2] = g(nm1s2) ;
286 for (k=1; k<n2c; k+=2) {
288 int i0 = n2n3c * j + n3c * k ;
289 double* cf0 = cf + i0 ;
291 i0 = n2n3f * j + n3f * k ;
292 double* ff0 = ff + i0 ;
297 t1[0] = .5 * cf0[0] ;
298 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[i] + cf0[i-1] ) ;
299 t1[nm1] = .5 * cf0[nr-2] ;
313 for ( i = 3; i < nr; i += 2 ) {
314 ff0[i] = t1[i] - c1 ;
319 double fmoins0 = nm1s2 * c1 + som ;
324 for ( i = 3; i < nr; i += 2 ) {
325 g.set(nm1-i/2) = 0.25 * ( ff0[i] - ff0[i-2] ) ;
337 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * t1[2*i] ;
338 g.set(nm1s2) = t1[nm1] ;
349 for ( i = 1; i < nm1s2 ; i++ ) {
355 int ixsym = nm1 - isym ;
357 double fp = .5 * ( g(i) + g(isym) ) ;
358 double fm = .5 * ( g(i) - g(isym) ) / sinp[i] ;
360 ff0[ix] = ( fp + fm ) / x[ix];
361 ff0[ixsym] = ( fp - fm ) / x[ixsym] ;
366 ff0[nm1] = g(0) + fmoins0 ;
367 ff0[nm1s2] = g(nm1s2) / x[nm1s2] ;