134 #include "proto_f77.h" 138 int* facto_ini(
int ) ;
139 double* trigo_ini(
int ) ;
140 double* cheb_ini(
const int) ;
141 double* chebimp_ini(
const int ) ;
144 void citcossinsp(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
163 cout <<
"citcossinsp: nt > n2f : nt = " << nt <<
" , n2f = " 169 cout <<
"citcossinsp: nt > n2c : nt = " << nt <<
" , n2c = " 175 cout <<
"citcossinsp: n1c > n1f : n1c = " << n1c <<
" , n1f = " 181 cout <<
"citcossinsp: n3c > n3f : n3c = " << n3c <<
" , n3f = " 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<n3c; k++) {
233 int i0 = n2n3c * j + k ;
234 double* cf0 = cf + i0 ;
237 double* ff0 = ff + i0 ;
258 for (i=2; i<nm1; i += 2 ) g[i+1] = - .5 * cf0[n3c*i] ;
269 g[0] = .5 * cf0[n3c] ;
270 for ( i = 3; i < nt; i += 2 ) {
271 g[i-1] = .25 * ( cf0[ n3c*i ] - cf0[ n3c*(i-2) ] ) ;
273 g[nm1] = - .5 * cf0[ n3c*(nt-2) ] ;
280 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
285 for ( i = 1; i < nm1s2 ; i++ ) {
289 double fp = 0.5 * ( g[i] + g[isym] ) / sinp[i] ;
290 double fm = 0.5 * ( g[i] - g[isym] ) ;
291 ff0[ n3f*i ] = fp + fm ;
292 ff0[ n3f*isym ] = fp - fm ;
297 ff0[ n3f*nm1 ] = -2. * g[0] ;
298 ff0[ n3f*nm1s2 ] = g[nm1s2] ;
309 if ( (j != 1) && (j != n1f-1 ) ) {
313 for (k=0; k<n3c; k++) {
315 int i0 = n2n3c * j + k ;
316 double* cf0 = cf + i0 ;
319 double* ff0 = ff + i0 ;
340 for (i=2; i<nm1; i += 2 ) g[i+1] = - .5 * cf0[n3c*i] ;
351 g[0] = .5 * cf0[n3c] ;
352 for ( i = 3; i < nt; i += 2 ) {
353 g[i-1] = .25 * ( cf0[ n3c*i ] - cf0[ n3c*(i-2) ] ) ;
355 g[nm1] = - .5 * cf0[ n3c*(nt-2) ] ;
362 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
367 for ( i = 1; i < nm1s2 ; i++ ) {
371 double fp = 0.5 * ( g[i] + g[isym] ) / sinp[i] ;
372 double fm = 0.5 * ( g[i] - g[isym] ) ;
373 ff0[ n3f*i ] = fp + fm ;
374 ff0[ n3f*isym ] = fp - fm ;
379 ff0[ n3f*nm1 ] = -2. * g[0] ;
380 ff0[ n3f*nm1s2 ] = g[nm1s2] ;
413 for (k=0; k<n3c; k++) {
415 int i0 = n2n3c * j + k ;
416 double* cf0 = cf + i0 ;
419 double* ff0 = ff + i0 ;
424 t1[0] = .5 * cf0[0] ;
425 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[n3c*i] + cf0[n3c*(i-1)] ) ;
426 t1[nm1] = .5 * cf0[n3c*(nt-2)] ;
444 for ( i = 3; i < nt; i += 2 ) {
445 ff0[ n3f*i ] = t1[i] - c1 ;
446 som += ff0[ n3f*i ] ;
450 double fmoins0 = nm1s2 * c1 + som ;
456 for ( i = 3; i < nt; i += 2 ) {
457 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
470 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
477 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
482 for ( i = 1; i < nm1s2 ; i++ ) {
486 double fp = 0.5 * ( g[i] + g[isym] ) ;
487 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
488 ff0[ n3f*i ] = ( fp + fm ) / x[isym] ;
489 ff0[ n3f*isym ] = ( fp - fm ) / x[i] ;
493 ff0[0] = g[0] + fmoins0 ;
495 ff0[ n3f*nm1s2 ] = g[nm1s2] / x[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++) t1[i] = .5 * ( cf0[n3c*i] + cf0[n3c*(i-1)] ) ;
524 t1[nm1] = .5 * cf0[n3c*(nt-2)] ;
542 for ( i = 3; i < nt; i += 2 ) {
543 ff0[ n3f*i ] = t1[i] - c1 ;
544 som += ff0[ n3f*i ] ;
548 double fmoins0 = nm1s2 * c1 + som ;
554 for ( i = 3; i < nt; i += 2 ) {
555 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
568 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
575 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
580 for ( i = 1; i < nm1s2 ; i++ ) {
584 double fp = 0.5 * ( g[i] + g[isym] ) ;
585 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
586 ff0[ n3f*i ] = ( fp + fm ) / x[isym] ;
587 ff0[ n3f*isym ] = ( fp - fm ) / x[i] ;
591 ff0[0] = g[0] + fmoins0 ;
593 ff0[ n3f*nm1s2 ] = g[nm1s2] / x[nm1s2] ;