146 #include "proto_f77.h" 150 int* facto_ini(
int ) ;
151 double* trigo_ini(
int ) ;
152 double* cheb_ini(
const int) ;
153 double* chebimp_ini(
const int ) ;
157 void cfrchebpimp(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
177 cout <<
"cfrchebpimp: nr > n3f : nr = " << nr <<
" , n3f = " 183 cout <<
"cfrchebpimp: nr > n3c : nr = " << nr <<
" , n3c = " 189 cout <<
"cfrchebpimp: n1f > n1c : n1f = " << n1f <<
" , n1c = " 195 cout <<
"cfrchebpimp: n2f > n2c : n2f = " << n2f <<
" , n2c = " 206 int* facto = facto_ini(nm1) ;
207 double* trigo = trigo_ini(nm1) ;
210 double* sinp = cheb_ini(nr);
213 double* x = chebimp_ini(nr);
216 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) );
217 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
227 int n2n3f = n2f * n3f ;
228 int n2n3c = n2c * n3c ;
243 for (k=0; k<n2f; k++) {
245 int i0 = n2n3f * j + n3f * k ;
246 double* ff0 = ff + i0 ;
248 i0 = n2n3c * j + n3c * k ;
249 double* cf0 = cf + i0 ;
257 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
261 for ( i = 1; i < nm1s2 ; i++ ) {
267 int ixsym = nm1 - isym ;
270 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
272 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
277 g[0] = 0.5 * ( ff0[nm1] + ff0[0] );
278 g[nm1s2] = ff0[nm1s2];
283 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
292 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
303 for ( i = 3; i < nr; i += 2 ) {
304 cf0[i] = cf0[i-2] + 4. * g[i] ;
309 double c1 = ( fmoins0 - som ) / nm1s2 ;
313 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
323 if ( (j != 1) && (j != n1f-1) ) {
327 for (k=0; k<n2f; k++) {
329 int i0 = n2n3f * j + n3f * k ;
330 double* ff0 = ff + i0 ;
332 i0 = n2n3c * j + n3c * k ;
333 double* cf0 = cf + i0 ;
341 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
345 for ( i = 1; i < nm1s2 ; i++ ) {
351 int ixsym = nm1 - isym ;
354 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
356 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
361 g[0] = 0.5 * ( ff0[nm1] + ff0[0] );
362 g[nm1s2] = ff0[nm1s2];
367 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
376 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
387 for ( i = 3; i < nr; i += 2 ) {
388 cf0[i] = cf0[i-2] + 4. * g[i] ;
393 double c1 = ( fmoins0 - som ) / nm1s2 ;
397 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
428 for (k=0; k<n2f; k++) {
430 int i0 = n2n3f * j + n3f * k ;
431 double* ff0 = ff + i0 ;
433 i0 = n2n3c * j + n3c * k ;
434 double* cf0 = cf + i0 ;
441 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
449 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
453 for ( i = 1; i < nm1s2 ; i++ ) {
459 int ixsym = nm1 - isym ;
462 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
464 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
469 g[0] = 0.5 * ( cf0[nm1] + cf0[0] );
470 g[nm1s2] = cf0[nm1s2];
475 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
485 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
496 for ( i = 3; i < nr; i += 2 ) {
497 cf0[i] = cf0[i-2] + 4. * g[i] ;
502 double c1 = ( fmoins0 - som ) / nm1s2 ;
506 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
512 for (i=1; i<nm1; i++) {
513 cf0[i] = 2 * cf0[i] - cf0[i-1] ;
530 for (k=0; k<n2f; k++) {
532 int i0 = n2n3f * j + n3f * k ;
533 double* ff0 = ff + i0 ;
535 i0 = n2n3c * j + n3c * k ;
536 double* cf0 = cf + i0 ;
543 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
551 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
555 for ( i = 1; i < nm1s2 ; i++ ) {
561 int ixsym = nm1 - isym ;
564 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
566 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
571 g[0] = 0.5 * ( cf0[nm1] + cf0[0] );
572 g[nm1s2] = cf0[nm1s2];
577 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
587 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
598 for ( i = 3; i < nr; i += 2 ) {
599 cf0[i] = cf0[i-2] + 4. * g[i] ;
604 double c1 = ( fmoins0 - som ) / nm1s2 ;
608 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
614 for (i=1; i<nm1; i++) {
615 cf0[i] = 2 * cf0[i] - cf0[i-1] ;