145 #include "proto_f77.h" 149 int* facto_ini(
int ) ;
150 double* trigo_ini(
int ) ;
151 double* cheb_ini(
const int) ;
152 double* chebimp_ini(
const int ) ;
156 void cfrchebpimi(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
176 cout <<
"cfrchebpimi: nr > n3f : nr = " << nr <<
" , n3f = " 182 cout <<
"cfrchebpimi: nr > n3c : nr = " << nr <<
" , n3c = " 188 cout <<
"cfrchebpimi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 194 cout <<
"cfrchebpimi: n2f > n2c : n2f = " << n2f <<
" , n2c = " 205 int* facto = facto_ini(nm1) ;
206 double* trigo = trigo_ini(nm1) ;
209 double* sinp = cheb_ini(nr);
212 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 ;
242 for (k=0; k<n2f; k++) {
244 int i0 = n2n3f * j + n3f * k ;
245 double* ff0 = ff + i0 ;
247 i0 = n2n3c * j + n3c * k ;
248 double* cf0 = cf + i0 ;
255 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
263 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
267 for ( i = 1; i < nm1s2 ; i++ ) {
273 int ixsym = nm1 - isym ;
276 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
278 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
283 g[0] = 0.5 * ( cf0[nm1] + cf0[0] );
284 g[nm1s2] = cf0[nm1s2];
289 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
299 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
310 for ( i = 3; i < nr; i += 2 ) {
311 cf0[i] = cf0[i-2] + 4. * g[i] ;
316 double c1 = ( fmoins0 - som ) / nm1s2 ;
320 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
326 for (i=1; i<nm1; i++) {
327 cf0[i] = 2 * cf0[i] - cf0[i-1] ;
341 if ( (j != 1) && (j != n1f-1) ) {
345 for (k=0; k<n2f; k++) {
347 int i0 = n2n3f * j + n3f * k ;
348 double* ff0 = ff + i0 ;
350 i0 = n2n3c * j + n3c * k ;
351 double* cf0 = cf + i0 ;
358 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
366 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
370 for ( i = 1; i < nm1s2 ; i++ ) {
376 int ixsym = nm1 - isym ;
379 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
381 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
386 g[0] = 0.5 * ( cf0[nm1] + cf0[0] );
387 g[nm1s2] = cf0[nm1s2];
392 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
402 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
413 for ( i = 3; i < nr; i += 2 ) {
414 cf0[i] = cf0[i-2] + 4. * g[i] ;
419 double c1 = ( fmoins0 - som ) / nm1s2 ;
423 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
429 for (i=1; i<nm1; i++) {
430 cf0[i] = 2 * cf0[i] - cf0[i-1] ;
462 for (k=0; k<n2f; k++) {
464 int i0 = n2n3f * j + n3f * k ;
465 double* ff0 = ff + i0 ;
467 i0 = n2n3c * j + n3c * k ;
468 double* cf0 = cf + i0 ;
476 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
480 for ( i = 1; i < nm1s2 ; i++ ) {
486 int ixsym = nm1 - isym ;
489 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
491 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
496 g[0] = 0.5 * ( ff0[nm1] + ff0[0] );
497 g[nm1s2] = ff0[nm1s2];
502 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
511 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
522 for ( i = 3; i < nr; i += 2 ) {
523 cf0[i] = cf0[i-2] + 4. * g[i] ;
528 double c1 = ( fmoins0 - som ) / nm1s2 ;
532 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
547 for (k=0; k<n2f; k++) {
549 int i0 = n2n3f * j + n3f * k ;
550 double* ff0 = ff + i0 ;
552 i0 = n2n3c * j + n3c * k ;
553 double* cf0 = cf + i0 ;
561 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
565 for ( i = 1; i < nm1s2 ; i++ ) {
571 int ixsym = nm1 - isym ;
574 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
576 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
581 g[0] = 0.5 * ( ff0[nm1] + ff0[0] );
582 g[nm1s2] = ff0[nm1s2];
587 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
596 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
607 for ( i = 3; i < nr; i += 2 ) {
608 cf0[i] = cf0[i-2] + 4. * g[i] ;
613 double c1 = ( fmoins0 - som ) / nm1s2 ;
617 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;