133 #include "proto_f77.h" 137 int* facto_ini(
int ) ;
138 double* trigo_ini(
int ) ;
139 double* cheb_ini(
const int) ;
140 double* chebimp_ini(
const int ) ;
143 void citcossinci(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
162 cout <<
"citcossinci: nt > n2f : nt = " << nt <<
" , n2f = " 167 cout <<
"citcossinci: nt > n2c : nt = " << nt <<
" , n2c = " 172 cout <<
"citcossinci: n1c > n1f : n1c = " << n1c <<
" , n1f = " 177 cout <<
"citcossinci: n3c > n3f : n3c = " << n3c <<
" , n3f = " 187 int* facto = facto_ini(nm1) ;
188 double* trigo = trigo_ini(nm1) ;
191 double* sinp = cheb_ini(nt);
194 double* x = chebimp_ini(nt) ;
198 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) ) ;
199 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
210 int n2n3f = n2f * n3f ;
211 int n2n3c = n2c * n3c ;
226 for (k=0; k<n3c; k++) {
228 int i0 = n2n3c * j + k ;
229 double* cf0 = cf + i0 ;
232 double* ff0 = ff + i0 ;
237 t1[0] = .5 * cf0[0] ;
238 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[n3c*i] + cf0[n3c*(i-1)] ) ;
239 t1[nm1] = .5 * cf0[n3c*(nt-2)] ;
257 for ( i = 3; i < nt; i += 2 ) {
258 ff0[ n3f*i ] = t1[i] - c1 ;
259 som += ff0[ n3f*i ] ;
263 double fmoins0 = nm1s2 * c1 + som ;
269 for ( i = 3; i < nt; i += 2 ) {
270 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
283 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
290 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
295 for ( i = 1; i < nm1s2 ; i++ ) {
299 double fp = 0.5 * ( g[i] + g[isym] ) ;
300 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
301 ff0[ n3f*i ] = ( fp + fm ) / x[isym] ;
302 ff0[ n3f*isym ] = ( fp - fm ) / x[i] ;
306 ff0[0] = g[0] + fmoins0 ;
308 ff0[ n3f*nm1s2 ] = g[nm1s2] / x[nm1s2] ;
319 if ( (j != 1) && (j != n1f-1 ) ) {
323 for (k=0; k<n3c; k++) {
325 int i0 = n2n3c * j + k ;
326 double* cf0 = cf + i0 ;
329 double* ff0 = ff + i0 ;
334 t1[0] = .5 * cf0[0] ;
335 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[n3c*i] + cf0[n3c*(i-1)] ) ;
336 t1[nm1] = .5 * cf0[n3c*(nt-2)] ;
354 for ( i = 3; i < nt; i += 2 ) {
355 ff0[ n3f*i ] = t1[i] - c1 ;
356 som += ff0[ n3f*i ] ;
360 double fmoins0 = nm1s2 * c1 + som ;
366 for ( i = 3; i < nt; i += 2 ) {
367 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
380 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
387 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
392 for ( i = 1; i < nm1s2 ; i++ ) {
396 double fp = 0.5 * ( g[i] + g[isym] ) ;
397 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
398 ff0[ n3f*i ] = ( fp + fm ) / x[isym] ;
399 ff0[ n3f*isym ] = ( fp - fm ) / x[i] ;
403 ff0[0] = g[0] + fmoins0 ;
405 ff0[ n3f*nm1s2 ] = g[nm1s2] / x[nm1s2] ;
438 for (k=0; k<n3c; k++) {
440 int i0 = n2n3c * j + k ;
441 double* cf0 = cf + i0 ;
444 double* ff0 = ff + i0 ;
465 for (i=2; i<nm1; i += 2 ) g[i+1] = - .5 * cf0[n3c*i] ;
476 g[0] = .5 * cf0[n3c] ;
477 for ( i = 3; i < nt; i += 2 ) {
478 g[i-1] = .25 * ( cf0[ n3c*i ] - cf0[ n3c*(i-2) ] ) ;
480 g[nm1] = - .5 * cf0[ n3c*(nt-2) ] ;
487 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
492 for ( i = 1; i < nm1s2 ; i++ ) {
496 double fp = 0.5 * ( g[i] + g[isym] ) / sinp[i] ;
497 double fm = 0.5 * ( g[i] - g[isym] ) ;
498 ff0[ n3f*i ] = fp + fm ;
499 ff0[ n3f*isym ] = fp - fm ;
504 ff0[ n3f*nm1 ] = -2. * g[0] ;
505 ff0[ n3f*nm1s2 ] = g[nm1s2] ;
521 for (k=0; k<n3c; k++) {
523 int i0 = n2n3c * j + k ;
524 double* cf0 = cf + i0 ;
527 double* ff0 = ff + i0 ;
548 for (i=2; i<nm1; i += 2 ) g[i+1] = - .5 * cf0[n3c*i] ;
559 g[0] = .5 * cf0[n3c] ;
560 for ( i = 3; i < nt; i += 2 ) {
561 g[i-1] = .25 * ( cf0[ n3c*i ] - cf0[ n3c*(i-2) ] ) ;
563 g[nm1] = - .5 * cf0[ n3c*(nt-2) ] ;
570 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
575 for ( i = 1; i < nm1s2 ; i++ ) {
579 double fp = 0.5 * ( g[i] + g[isym] ) / sinp[i] ;
580 double fm = 0.5 * ( g[i] - g[isym] ) ;
581 ff0[ n3f*i ] = fp + fm ;
582 ff0[ n3f*isym ] = fp - fm ;
587 ff0[ n3f*nm1 ] = -2. * g[0] ;
588 ff0[ n3f*nm1s2 ] = g[nm1s2] ;