138 #include "proto_f77.h" 142 int* facto_ini(
int ) ;
143 double* trigo_ini(
int ) ;
144 double* cheb_ini(
const int) ;
145 double* chebimp_ini(
const int ) ;
148 void cftcossinci(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
167 cout <<
"cftcossinci: nt > n2f : nt = " << nt <<
" , n2f = " 172 cout <<
"cftcossinci: nt > n2c : nt = " << nt <<
" , n2c = " 177 cout <<
"cftcossinci: n1f > n1c : n1f = " << n1f <<
" , n1c = " 182 cout <<
"cftcossinci: n3f > n3c : n3f = " << n3f <<
" , n3c = " 192 int* facto = facto_ini(nm1) ;
193 double* trigo = trigo_ini(nm1) ;
196 double* sinp = cheb_ini(nt);
199 double* x = chebimp_ini(nt);
203 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) );
204 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
215 int n2n3f = n2f * n3f ;
216 int n2n3c = n2c * n3c ;
231 for (k=0; k<n3f; k++) {
233 int i0 = n2n3f * j + k ;
234 double* ff0 = ff + i0 ;
237 double* cf0 = cf + i0 ;
243 for (i=0; i<nt-1; i++) cf0[n3c*i] = x[nm1-i] * ff0[n3f*i] ;
252 double fmoins0 = 0.5 * ( cf0[0] - cf0[ n3c*nm1 ] );
256 for ( i = 1; i < nm1s2 ; i++ ) {
262 int ixsym = n3c * isym ;
264 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
266 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
271 g[0] = 0.5 * ( cf0[0] + cf0[ n3c*nm1 ] );
272 g[nm1s2] = cf0[ n3c*nm1s2 ];
277 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
287 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = 2.* g[i] ;
288 cf0[n3c*nm1] = g[nm1] ;
298 for ( i = 3; i < nt; i += 2 ) {
299 cf0[n3c*i] = cf0[n3c*(i-2)] + 4. * g[i] ;
304 double c1 = ( fmoins0 - som ) / nm1s2 ;
308 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
315 for (i=1; i<nm1; i++) {
316 cf0[n3c*i] = 2 * cf0[n3c*i] - cf0[n3c*(i-1)] ;
329 if ( (j != 1) && (j != n1f-1 ) ) {
333 for (k=0; k<n3f; k++) {
335 int i0 = n2n3f * j + k ;
336 double* ff0 = ff + i0 ;
339 double* cf0 = cf + i0 ;
345 for (i=0; i<nt-1; i++) cf0[n3c*i] = x[nm1-i] * ff0[n3f*i] ;
354 double fmoins0 = 0.5 * ( cf0[0] - cf0[ n3c*nm1 ] );
358 for ( i = 1; i < nm1s2 ; i++ ) {
364 int ixsym = n3c * isym ;
366 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
368 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
373 g[0] = 0.5 * ( cf0[0] + cf0[ n3c*nm1 ] );
374 g[nm1s2] = cf0[ n3c*nm1s2 ];
379 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
389 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = 2.* g[i] ;
390 cf0[n3c*nm1] = g[nm1] ;
400 for ( i = 3; i < nt; i += 2 ) {
401 cf0[n3c*i] = cf0[n3c*(i-2)] + 4. * g[i] ;
406 double c1 = ( fmoins0 - som ) / nm1s2 ;
410 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
417 for (i=1; i<nm1; i++) {
418 cf0[n3c*i] = 2 * cf0[n3c*i] - cf0[n3c*(i-1)] ;
451 for (k=0; k<n3f; k++) {
453 int i0 = n2n3f * j + k ;
454 double* ff0 = ff + i0 ;
457 double* cf0 = cf + i0 ;
466 for ( i = 1; i < nm1s2 ; i++ ) {
472 int ixsym = n3f * isym ;
474 double fps = 0.5 * ( ff0[ix] + ff0[ixsym] ) * sinp[i] ;
476 double fm = 0.5 * ( ff0[ix] - ff0[ixsym] ) ;
481 g[0] = 0.5 * ( ff0[0] - ff0[ n3f*nm1 ] ) ;
482 g[nm1s2] = ff0[ n3f*nm1s2 ] ;
487 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
497 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = -2. * g[i+1] ;
508 cf0[n3c] = 2.* g[0] ;
509 for ( i = 3; i < nt; i += 2 ) {
510 cf0[ n3c*i ] = cf0[ n3c*(i-2) ] + 4. * g[i-1] ;
525 for (k=0; k<n3f; k++) {
527 int i0 = n2n3f * j + k ;
528 double* ff0 = ff + i0 ;
531 double* cf0 = cf + i0 ;
540 for ( i = 1; i < nm1s2 ; i++ ) {
546 int ixsym = n3f * isym ;
548 double fps = 0.5 * ( ff0[ix] + ff0[ixsym] ) * sinp[i] ;
550 double fm = 0.5 * ( ff0[ix] - ff0[ixsym] ) ;
555 g[0] = 0.5 * ( ff0[0] - ff0[ n3f*nm1 ] ) ;
556 g[nm1s2] = ff0[ n3f*nm1s2 ] ;
561 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
571 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = -2. * g[i+1] ;
582 cf0[n3c] = 2.* g[0] ;
583 for ( i = 3; i < nt; i += 2 ) {
584 cf0[ n3c*i ] = cf0[ n3c*(i-2) ] + 4. * g[i-1] ;