117 #include "proto_f77.h" 121 int* facto_ini(
int ) ;
122 double* trigo_ini(
int ) ;
123 double* cheb_ini(
const int) ;
124 double* chebimp_ini(
const int ) ;
127 void citcossincp(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
146 cout <<
"citcossincp: nt > n2f : nt = " << nt <<
" , n2f = " 152 cout <<
"citcossincp: nt > n2c : nt = " << nt <<
" , n2c = " 158 cout <<
"citcossincp: n1c > n1f : n1c = " << n1c <<
" , n1f = " 164 cout <<
"citcossincp: n3c > n3f : n3c = " << n3c <<
" , n3f = " 175 int* facto = facto_ini(nm1) ;
176 double* trigo = trigo_ini(nm1) ;
179 double* sinp = cheb_ini(nt);
182 double* sinth = chebimp_ini(nt);
186 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) ) ;
187 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
198 int n2n3f = n2f * n3f ;
199 int n2n3c = n2c * n3c ;
214 for (k=0; k<n3c; k++) {
216 int i0 = n2n3c * j + k ;
217 double* cf0 = cf + i0 ;
220 double* ff0 = ff + i0 ;
234 double c1 = cf0[n3c] ;
238 for ( i = 3; i < nt; i += 2 ) {
239 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
240 som += ff0[ n3f*i ] ;
244 double fmoins0 = nm1s2 * c1 + som ;
250 for ( i = 3; i < nt; i += 2 ) {
251 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
264 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[ n3c*i ] ;
265 g[nm1] = cf0[ n3c*nm1 ] ;
271 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
276 for ( i = 1; i < nm1s2 ; i++ ) {
280 double fp = 0.5 * ( g[i] + g[isym] ) ;
281 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
282 ff0[ n3f*i ] = fp + fm ;
283 ff0[ n3f*isym ] = fp - fm ;
287 ff0[0] = g[0] + fmoins0 ;
288 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
289 ff0[ n3f*nm1s2 ] = g[nm1s2] ;
300 if ( (j != 1) && (j != n1f-1 ) ) {
304 for (k=0; k<n3c; k++) {
306 int i0 = n2n3c * j + k ;
307 double* cf0 = cf + i0 ;
310 double* ff0 = ff + i0 ;
324 double c1 = cf0[n3c] ;
328 for ( i = 3; i < nt; i += 2 ) {
329 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
330 som += ff0[ n3f*i ] ;
334 double fmoins0 = nm1s2 * c1 + som ;
340 for ( i = 3; i < nt; i += 2 ) {
341 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
354 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[ n3c*i ] ;
355 g[nm1] = cf0[ n3c*nm1 ] ;
361 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
366 for ( i = 1; i < nm1s2 ; i++ ) {
370 double fp = 0.5 * ( g[i] + g[isym] ) ;
371 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
372 ff0[ n3f*i ] = fp + fm ;
373 ff0[ n3f*isym ] = fp - fm ;
377 ff0[0] = g[0] + fmoins0 ;
378 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
379 ff0[ n3f*nm1s2 ] = g[nm1s2] ;
412 for (k=0; k<n3c; k++) {
414 int i0 = n2n3c * j + k ;
415 double* cf0 = cf + i0 ;
418 double* ff0 = ff + i0 ;
423 t1[0] = .5 * cf0[0] ;
424 for (i=1; i<nm1; i++) {
425 t1[i] = .5 * ( cf0[ n3c*i ] - cf0[ n3c*(i-1) ] ) ;
427 t1[nm1] = -.5 * cf0[ n3c*(nt-2) ] ;
445 for ( i = 3; i < nt; i += 2 ) {
446 ff0[ n3f*i ] = t1[i] - c1 ;
447 som += ff0[ n3f*i ] ;
451 double fmoins0 = nm1s2 * c1 + som ;
457 for ( i = 3; i < nt; i += 2 ) {
458 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
471 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
478 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
483 for ( i = 1; i < nm1s2 ; i++ ) {
487 double fp = 0.5 * ( g[i] + g[isym] ) ;
488 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
489 ff0[ n3f*i ] = ( fp + fm ) / sinth[i] ;
490 ff0[ n3f*isym ] = ( fp - fm ) / sinth[isym] ;
495 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
496 ff0[ n3f*nm1s2 ] = g[nm1s2] / sinth[nm1s2];
511 for (k=0; k<n3c; k++) {
513 int i0 = n2n3c * j + k ;
514 double* cf0 = cf + i0 ;
517 double* ff0 = ff + i0 ;
522 t1[0] = .5 * cf0[0] ;
523 for (i=1; i<nm1; i++) {
524 t1[i] = .5 * ( cf0[ n3c*i ] - cf0[ n3c*(i-1) ] ) ;
526 t1[nm1] = -.5 * cf0[ n3c*(nt-2) ] ;
544 for ( i = 3; i < nt; i += 2 ) {
545 ff0[ n3f*i ] = t1[i] - c1 ;
546 som += ff0[ n3f*i ] ;
550 double fmoins0 = nm1s2 * c1 + som ;
556 for ( i = 3; i < nt; i += 2 ) {
557 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
570 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
577 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
582 for ( i = 1; i < nm1s2 ; i++ ) {
586 double fp = 0.5 * ( g[i] + g[isym] ) ;
587 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
588 ff0[ n3f*i ] = ( fp + fm ) / sinth[i] ;
589 ff0[ n3f*isym ] = ( fp - fm ) / sinth[isym] ;
594 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
595 ff0[ n3f*nm1s2 ] = g[nm1s2] / sinth[nm1s2];