98 fftw_plan prepare_fft(
int, Tbl*&) ;
99 double* cheb_ini(
const int) ;
100 double* chebimp_ini(
const int ) ;
104 void cfrcheb_interp(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
123 cout <<
"cfrcheb: nr > n3f : nr = " << nr <<
" , n3f = " 129 cout <<
"cfrcheb: nr > n3c : nr = " << nr <<
" , n3c = " 135 cout <<
"cfrcheb: n1f > n1c : n1f = " << n1f <<
" , n1c = " 141 cout <<
"cfrcheb: n2f > n2c : n2f = " << n2f <<
" , n2c = " 154 fftw_plan p = prepare_fft(nm1, pg) ;
158 double* sinp = cheb_ini(nr);
162 int n2n3f = n2f * n3f ;
163 int n2n3c = n2c * n3c ;
165 for (j=0; j< n1f; j++) {
167 for (k=0; k<n2f; k++) {
169 int i0 = n2n3f * j + n3f * k ;
170 double* ff0 = ff + i0 ;
172 i0 = n2n3c * j + n3c * k ;
173 double* cf0 = cf + i0 ;
181 double fmoins0 = 0.5 * ( ff0[0] - ff0[nm1] );
185 for ( i = 1; i < nm1s2 ; i++ ) {
189 double fp = 0.5 * ( ff0[i] + ff0[isym] ) ;
191 double fms = 0.5 * ( ff0[i] - ff0[isym] ) * sinp[i] ;
192 g.set(i) = fp + fms ;
193 g.set(isym) = fp - fms ;
196 g.set(0) = 0.5 * ( ff0[0] + ff0[nm1] );
197 g.set(nm1s2) = ff0[nm1s2];
210 double fac = 2./double(nm1) ;
211 cf0[0] = g(0) / double(nm1) ;
212 for (i=2; i<nm1; i += 2) cf0[i] = fac*g(i/2) ;
213 cf0[nm1] = g(nm1s2) / double(nm1) ;
224 for ( i = 3; i < nr; i += 2 ) {
225 cf0[i] = cf0[i-2] + fac * g(nm1-i/2) ;
230 double c1 = - ( fmoins0 + som ) / nm1s2 ;
234 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
243 void cfrchebp_interp(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
262 cout <<
"cfrchebp: nr > n3f : nr = " << nr <<
" , n3f = " 268 cout <<
"cfrchebp: nr > n3c : nr = " << nr <<
" , n3c = " 274 cout <<
"cfrchebp: n1f > n1c : n1f = " << n1f <<
" , n1c = " 280 cout <<
"cfrchebp: n2f > n2c : n2f = " << n2f <<
" , n2c = " 292 fftw_plan p = prepare_fft(nm1, pg) ;
296 double* sinp = cheb_ini(nr);
300 int n2n3f = n2f * n3f ;
301 int n2n3c = n2c * n3c ;
304 for (j=0; j< n1f; j++) {
306 for (k=0; k<n2f; k++) {
308 int i0 = n2n3f * j + n3f * k ;
309 double* ff0 = ff + i0 ;
311 i0 = n2n3c * j + n3c * k ;
312 double* cf0 = cf + i0 ;
320 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
324 for ( i = 1; i < nm1s2 ; i++ ) {
330 int ixsym = nm1 - isym ;
333 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
335 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
336 g.set(i) = fp + fms ;
337 g.set(isym) = fp - fms ;
340 g.set(0) = 0.5 * ( ff0[nm1] + ff0[0] );
341 g.set(nm1s2) = ff0[nm1s2];
354 double fac = 2./double(nm1) ;
355 cf0[0] = g(0) / double(nm1) ;
356 for (i=2; i<nm1; i += 2) cf0[i] = fac*g(i/2) ;
357 cf0[nm1] = g(nm1s2) / double(nm1) ;
368 for ( i = 3; i < nr; i += 2 ) {
369 cf0[i] = cf0[i-2] + fac * g(nm1-i/2) ;
374 double c1 = ( fmoins0 - som ) / nm1s2 ;
378 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
388 void cfrchebi_interp(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
407 cout <<
"cfrchebi: nr > n3f : nr = " << nr <<
" , n3f = " 413 cout <<
"cfrchebi: nr > n3c : nr = " << nr <<
" , n3c = " 419 cout <<
"cfrchebi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 425 cout <<
"cfrchebi: n2f > n2c : n2f = " << n2f <<
" , n2c = " 437 fftw_plan p = prepare_fft(nm1, pg) ;
441 double* sinp = cheb_ini(nr);
444 double* x = chebimp_ini(nr);
448 int n2n3f = n2f * n3f ;
449 int n2n3c = n2c * n3c ;
451 for (j=0; j< n1f; j++) {
453 for (k=0; k<n2f; k++) {
455 int i0 = n2n3f * j + n3f * k ;
456 double* ff0 = ff + i0 ;
458 i0 = n2n3c * j + n3c * k ;
459 double* cf0 = cf + i0 ;
466 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
474 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
478 for ( i = 1; i < nm1s2 ; i++ ) {
484 int ixsym = nm1 - isym ;
487 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
489 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
490 g.set(i) = fp + fms ;
491 g.set(isym) = fp - fms ;
494 g.set(0) = 0.5 * ( cf0[nm1] + cf0[0] );
495 g.set(nm1s2) = cf0[nm1s2];
509 double fac = 2./double(nm1) ;
510 cf0[0] = g(0) / double(nm1) ;
511 for (i=2; i<nm1; i += 2 ) cf0[i] = fac * g(i/2) ;
512 cf0[nm1] = g(nm1s2) / double(nm1) ;
523 for ( i = 3; i < nr; i += 2 ) {
524 cf0[i] = cf0[i-2] + fac * g(nm1 - i/2) ;
529 double c1 = ( fmoins0 - som ) / nm1s2 ;
533 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
539 for (i=1; i<nm1; i++) {
540 cf0[i] = 2 * cf0[i] - cf0[i-1] ;