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 citcossinsi(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
162 cout <<
"citcossinsi: nt > n2f : nt = " << nt <<
" , n2f = " 168 cout <<
"citcossinsi: nt > n2c : nt = " << nt <<
" , n2c = " 174 cout <<
"citcossinsi: n1c > n1f : n1c = " << n1c <<
" , n1f = " 180 cout <<
"citcossinsi: n3c > n3f : n3c = " << n3c <<
" , n3f = " 191 int* facto = facto_ini(nm1) ;
192 double* trigo = trigo_ini(nm1) ;
195 double* sinp = cheb_ini(nt);
198 double* sinth = chebimp_ini(nt);
202 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) ) ;
203 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
214 int n2n3f = n2f * n3f ;
215 int n2n3c = n2c * n3c ;
230 for (k=0; k<n3c; k++) {
232 int i0 = n2n3c * j + k ;
233 double* cf0 = cf + i0 ;
236 double* ff0 = ff + i0 ;
241 t1[0] = .5 * cf0[0] ;
242 for (i=1; i<nm1; i++) {
243 t1[i] = .5 * ( cf0[ n3c*i ] - cf0[ n3c*(i-1) ] ) ;
245 t1[nm1] = -.5 * cf0[ n3c*(nt-2) ] ;
263 for ( i = 3; i < nt; i += 2 ) {
264 ff0[ n3f*i ] = t1[i] - c1 ;
265 som += ff0[ n3f*i ] ;
269 double fmoins0 = nm1s2 * c1 + som ;
275 for ( i = 3; i < nt; i += 2 ) {
276 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
289 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
296 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
301 for ( i = 1; i < nm1s2 ; i++ ) {
305 double fp = 0.5 * ( g[i] + g[isym] ) ;
306 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
307 ff0[ n3f*i ] = ( fp + fm ) / sinth[i] ;
308 ff0[ n3f*isym ] = ( fp - fm ) / sinth[isym] ;
313 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
314 ff0[ n3f*nm1s2 ] = g[nm1s2] / sinth[nm1s2];
325 if ( (j != 1) && (j != n1f-1 ) ) {
329 for (k=0; k<n3c; k++) {
331 int i0 = n2n3c * j + k ;
332 double* cf0 = cf + i0 ;
335 double* ff0 = ff + i0 ;
340 t1[0] = .5 * cf0[0] ;
341 for (i=1; i<nm1; i++) {
342 t1[i] = .5 * ( cf0[ n3c*i ] - cf0[ n3c*(i-1) ] ) ;
344 t1[nm1] = -.5 * cf0[ n3c*(nt-2) ] ;
362 for ( i = 3; i < nt; i += 2 ) {
363 ff0[ n3f*i ] = t1[i] - c1 ;
364 som += ff0[ n3f*i ] ;
368 double fmoins0 = nm1s2 * c1 + som ;
374 for ( i = 3; i < nt; i += 2 ) {
375 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
388 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
395 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
400 for ( i = 1; i < nm1s2 ; i++ ) {
404 double fp = 0.5 * ( g[i] + g[isym] ) ;
405 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
406 ff0[ n3f*i ] = ( fp + fm ) / sinth[i] ;
407 ff0[ n3f*isym ] = ( fp - fm ) / sinth[isym] ;
412 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
413 ff0[ n3f*nm1s2 ] = g[nm1s2] / sinth[nm1s2];
446 for (k=0; k<n3c; k++) {
448 int i0 = n2n3c * j + k ;
449 double* cf0 = cf + i0 ;
452 double* ff0 = ff + i0 ;
466 double c1 = cf0[n3c] ;
470 for ( i = 3; i < nt; i += 2 ) {
471 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
472 som += ff0[ n3f*i ] ;
476 double fmoins0 = nm1s2 * c1 + som ;
482 for ( i = 3; i < nt; i += 2 ) {
483 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
496 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[ n3c*i ] ;
497 g[nm1] = cf0[ n3c*nm1 ] ;
503 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
508 for ( i = 1; i < nm1s2 ; i++ ) {
512 double fp = 0.5 * ( g[i] + g[isym] ) ;
513 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
514 ff0[ n3f*i ] = fp + fm ;
515 ff0[ n3f*isym ] = fp - fm ;
519 ff0[0] = g[0] + fmoins0 ;
520 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
521 ff0[ n3f*nm1s2 ] = g[nm1s2] ;
537 for (k=0; k<n3c; k++) {
539 int i0 = n2n3c * j + k ;
540 double* cf0 = cf + i0 ;
543 double* ff0 = ff + i0 ;
557 double c1 = cf0[n3c] ;
561 for ( i = 3; i < nt; i += 2 ) {
562 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
563 som += ff0[ n3f*i ] ;
567 double fmoins0 = nm1s2 * c1 + som ;
573 for ( i = 3; i < nt; i += 2 ) {
574 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
587 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[ n3c*i ] ;
588 g[nm1] = cf0[ n3c*nm1 ] ;
594 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
599 for ( i = 1; i < nm1s2 ; i++ ) {
603 double fp = 0.5 * ( g[i] + g[isym] ) ;
604 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
605 ff0[ n3f*i ] = fp + fm ;
606 ff0[ n3f*isym ] = fp - fm ;
610 ff0[0] = g[0] + fmoins0 ;
611 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
612 ff0[ n3f*nm1s2 ] = g[nm1s2] ;