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 citcossinc(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
146 cout <<
"citcossinc: nt > n2f : nt = " << nt <<
" , n2f = " 152 cout <<
"citcossinc: nt > n2c : nt = " << nt <<
" , n2c = " 158 cout <<
"citcossinc: n1c > n1f : n1c = " << n1c <<
" , n1f = " 164 cout <<
"citcossinc: 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 ;
226 double c1 = cf0[n3c] ;
230 for ( i = 3; i < nt; i += 2 ) {
231 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
232 som += ff0[ n3f*i ] ;
236 double fmoins0 = nm1s2 * c1 + som ;
242 for ( i = 3; i < nt; i += 2 ) {
243 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
256 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[ n3c*i ] ;
257 g[nm1] = cf0[ n3c*nm1 ] ;
263 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
268 for ( i = 1; i < nm1s2 ; i++ ) {
272 double fp = 0.5 * ( g[i] + g[isym] ) ;
273 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
274 ff0[ n3f*i ] = fp + fm ;
275 ff0[ n3f*isym ] = fp - fm ;
279 ff0[0] = g[0] + fmoins0 ;
280 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
281 ff0[ n3f*nm1s2 ] = g[nm1s2] ;
292 if ( (j != 1) && (j != n1f-1 ) ) {
296 for (k=0; k<n3c; k++) {
298 int i0 = n2n3c * j + k ;
299 double* cf0 = cf + i0 ;
302 double* ff0 = ff + i0 ;
307 double c1 = cf0[n3c] ;
311 for ( i = 3; i < nt; i += 2 ) {
312 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
313 som += ff0[ n3f*i ] ;
317 double fmoins0 = nm1s2 * c1 + som ;
323 for ( i = 3; i < nt; i += 2 ) {
324 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
337 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[ n3c*i ] ;
338 g[nm1] = cf0[ n3c*nm1 ] ;
344 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
349 for ( i = 1; i < nm1s2 ; i++ ) {
353 double fp = 0.5 * ( g[i] + g[isym] ) ;
354 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
355 ff0[ n3f*i ] = fp + fm ;
356 ff0[ n3f*isym ] = fp - fm ;
360 ff0[0] = g[0] + fmoins0 ;
361 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
362 ff0[ n3f*nm1s2 ] = g[nm1s2] ;
395 for (k=0; k<n3c; k++) {
397 int i0 = n2n3c * j + k ;
398 double* cf0 = cf + i0 ;
401 double* ff0 = ff + i0 ;
407 for (i=2; i<nm1; i += 2 ) g[i+1] = -0.5 * cf0[ n3c*i ] ;
414 g[0] = .5 * cf0[n3c] ;
415 for ( i = 3; i < nt; i += 2 ) {
416 g[i-1] = .25 * ( cf0[ n3c*i ] - cf0[ n3c*(i-2) ] ) ;
418 g[nm1] = - .5 * cf0[ n3c*(nt-2) ] ;
424 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
429 for ( i = 1; i < nm1s2 ; i++ ) {
433 double fp = 0.5 * ( g[i] + g[isym] ) / sinp[i] ;
434 double fm = 0.5 * ( g[i] - g[isym] ) ;
435 ff0[ n3f*i ] = fp + fm ;
436 ff0[ n3f*isym ] = fp - fm ;
441 ff0[ n3f*nm1 ] = -2*g[0] ;
442 ff0[ n3f*nm1s2 ] = g[nm1s2] ;
457 for (k=0; k<n3c; k++) {
459 int i0 = n2n3c * j + k ;
460 double* cf0 = cf + i0 ;
463 double* ff0 = ff + i0 ;
469 for (i=2; i<nm1; i += 2 ) g[i+1] = -0.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) ] ;
486 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
491 for ( i = 1; i < nm1s2 ; i++ ) {
495 double fp = 0.5 * ( g[i] + g[isym] ) / sinp[i] ;
496 double fm = 0.5 * ( g[i] - g[isym] ) ;
497 ff0[ n3f*i ] = fp + fm ;
498 ff0[ n3f*isym ] = fp - fm ;
503 ff0[ n3f*nm1 ] = -2*g[0] ;
504 ff0[ n3f*nm1s2 ] = g[nm1s2] ;