140 #include "proto_f77.h" 144 int* facto_ini(
int ) ;
145 double* trigo_ini(
int ) ;
146 double* cheb_ini(
const int) ;
147 double* chebimp_ini(
const int ) ;
150 void cftcossinsi(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
169 cout <<
"cftcossinsi: nt > n2f : nt = " << nt <<
" , n2f = " 175 cout <<
"cftcossinsi: nt > n2c : nt = " << nt <<
" , n2c = " 181 cout <<
"cftcossinsi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 187 cout <<
"cftcossinsi: n3f > n3c : n3f = " << n3f <<
" , n3c = " 198 int* facto = facto_ini(nm1) ;
199 double* trigo = trigo_ini(nm1) ;
202 double* sinp = cheb_ini(nt);
205 double* sinth = chebimp_ini(nt);
209 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) );
210 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
221 int n2n3f = n2f * n3f ;
222 int n2n3c = n2c * n3c ;
237 for (k=0; k<n3f; k++) {
239 int i0 = n2n3f * j + k ;
240 double* ff0 = ff + i0 ;
243 double* cf0 = cf + i0 ;
252 for (i=1; i<nt; i++) cf0[n3c*i] = sinth[i] * ff0[n3f*i] ;
260 double fmoins0 = 0.5 * ( cf0[0] - cf0[ n3c*nm1 ] );
264 for ( i = 1; i < nm1s2 ; i++ ) {
270 int ixsym = n3c * isym ;
272 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
274 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
279 g[0] = 0.5 * ( cf0[0] + cf0[ n3c*nm1 ] );
280 g[nm1s2] = cf0[ n3c*nm1s2 ];
285 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
294 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = 2.* g[i] ;
295 cf0[n3c*nm1] = g[nm1] ;
305 for ( i = 3; i < nt; i += 2 ) {
306 cf0[n3c*i] = cf0[n3c*(i-2)] + 4. * g[i] ;
311 double c1 = ( fmoins0 - som ) / nm1s2 ;
315 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
321 for (i=1; i<nm1; i++) {
322 cf0[n3c*i] = 2 * cf0[n3c*i] + cf0[n3c*(i-1)] ;
334 if ( (j != 1) && (j != n1f-1 ) ) {
338 for (k=0; k<n3f; k++) {
340 int i0 = n2n3f * j + k ;
341 double* ff0 = ff + i0 ;
344 double* cf0 = cf + i0 ;
353 for (i=1; i<nt; i++) cf0[n3c*i] = sinth[i] * ff0[n3f*i] ;
361 double fmoins0 = 0.5 * ( cf0[0] - cf0[ n3c*nm1 ] );
365 for ( i = 1; i < nm1s2 ; i++ ) {
371 int ixsym = n3c * isym ;
373 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
375 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
380 g[0] = 0.5 * ( cf0[0] + cf0[ n3c*nm1 ] );
381 g[nm1s2] = cf0[ n3c*nm1s2 ];
386 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
395 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = 2.* g[i] ;
396 cf0[n3c*nm1] = g[nm1] ;
406 for ( i = 3; i < nt; i += 2 ) {
407 cf0[n3c*i] = cf0[n3c*(i-2)] + 4. * g[i] ;
412 double c1 = ( fmoins0 - som ) / nm1s2 ;
416 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
422 for (i=1; i<nm1; i++) {
423 cf0[n3c*i] = 2 * cf0[n3c*i] + cf0[n3c*(i-1)] ;
456 for (k=0; k<n3f; k++) {
458 int i0 = n2n3f * j + k ;
459 double* ff0 = ff + i0 ;
462 double* cf0 = cf + i0 ;
470 double fmoins0 = 0.5 * ( ff0[0] - ff0[ n3f*nm1 ] );
474 for ( i = 1; i < nm1s2 ; i++ ) {
480 int ixsym = n3f * isym ;
482 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
484 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
489 g[0] = 0.5 * ( ff0[0] + ff0[ n3f*nm1 ] );
490 g[nm1s2] = ff0[ n3f*nm1s2 ];
495 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
504 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = 2.* g[i] ;
505 cf0[n3c*nm1] = g[nm1] ;
515 for ( i = 3; i < nt; i += 2 ) {
516 cf0[n3c*i] = cf0[n3c*(i-2)] + 4. * g[i] ;
521 double c1 = ( fmoins0 - som ) / nm1s2 ;
525 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
540 for (k=0; k<n3f; k++) {
542 int i0 = n2n3f * j + k ;
543 double* ff0 = ff + i0 ;
546 double* cf0 = cf + i0 ;
554 double fmoins0 = 0.5 * ( ff0[0] - ff0[ n3f*nm1 ] );
558 for ( i = 1; i < nm1s2 ; i++ ) {
564 int ixsym = n3f * isym ;
566 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
568 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
573 g[0] = 0.5 * ( ff0[0] + ff0[ n3f*nm1 ] );
574 g[nm1s2] = ff0[ n3f*nm1s2 ];
579 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
588 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = 2.* g[i] ;
589 cf0[n3c*nm1] = g[nm1] ;
599 for ( i = 3; i < nt; i += 2 ) {
600 cf0[n3c*i] = cf0[n3c*(i-2)] + 4. * g[i] ;
605 double c1 = ( fmoins0 - som ) / nm1s2 ;
609 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;