148 #include "proto_f77.h" 152 int* facto_ini(
int ) ;
153 double* trigo_ini(
int ) ;
154 double* cheb_ini(
const int) ;
155 double* chebimp_ini(
const int ) ;
158 void circhebpimp(
const int* deg,
const int* dimc,
double* cf,
159 const int* dimf,
double* ff)
178 cout <<
"circhebpimp: nr > n3c : nr = " << nr <<
" , n3c = " 184 cout <<
"circhebpimp: nr > n3f : nr = " << nr <<
" , n3f = " 190 cout <<
"circhebpimp: n1c > n1f : n1c = " << n1c <<
" , n1f = " 196 cout <<
"circhebpimp: n2c > n2f : n2c = " << n2c <<
" , n2f = " 207 int* facto = facto_ini(nm1) ;
208 double* trigo = trigo_ini(nm1) ;
211 double* sinp = cheb_ini(nr);
214 double* x = chebimp_ini(nr);
218 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) ) ;
219 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
229 int n2n3f = n2f * n3f ;
230 int n2n3c = n2c * n3c ;
245 for (k=0; k<n2c; k++) {
247 int i0 = n2n3c * j + n3c * k ;
248 double* cf0 = cf + i0 ;
250 i0 = n2n3f * j + n3f * k ;
251 double* ff0 = ff + i0 ;
269 for ( i = 3; i < nr; i += 2 ) {
270 ff0[i] = cf0[i] - c1 ;
275 double fmoins0 = nm1s2 * c1 + som ;
281 for ( i = 3; i < nr; i += 2 ) {
282 g[i] = 0.25 * ( ff0[i] - ff0[i-2] ) ;
295 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[i] ;
302 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
307 for ( i = 1; i < nm1s2 ; i++ ) {
313 int ixsym = nm1 - isym ;
315 double fp = .5 * ( g[i] + g[isym] ) ;
316 double fm = .5 * ( g[i] - g[isym] ) / sinp[i] ;
319 ff0[ixsym] = fp - fm ;
323 ff0[0] = g[0] - fmoins0 ;
324 ff0[nm1] = g[0] + fmoins0 ;
325 ff0[nm1s2] = g[nm1s2] ;
335 if ( (j != 1) && (j != n1f-1) ) {
339 for (k=0; k<n2c; k++) {
341 int i0 = n2n3c * j + n3c * k ;
342 double* cf0 = cf + i0 ;
344 i0 = n2n3f * j + n3f * k ;
345 double* ff0 = ff + i0 ;
363 for ( i = 3; i < nr; i += 2 ) {
364 ff0[i] = cf0[i] - c1 ;
369 double fmoins0 = nm1s2 * c1 + som ;
375 for ( i = 3; i < nr; i += 2 ) {
376 g[i] = 0.25 * ( ff0[i] - ff0[i-2] ) ;
389 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[i] ;
396 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
401 for ( i = 1; i < nm1s2 ; i++ ) {
407 int ixsym = nm1 - isym ;
409 double fp = .5 * ( g[i] + g[isym] ) ;
410 double fm = .5 * ( g[i] - g[isym] ) / sinp[i] ;
413 ff0[ixsym] = fp - fm ;
417 ff0[0] = g[0] - fmoins0 ;
418 ff0[nm1] = g[0] + fmoins0 ;
419 ff0[nm1s2] = g[nm1s2] ;
450 for (k=0; k<n2c; k++) {
452 int i0 = n2n3c * j + n3c * k ;
453 double* cf0 = cf + i0 ;
455 i0 = n2n3f * j + n3f * k ;
456 double* ff0 = ff + i0 ;
461 t1[0] = .5 * cf0[0] ;
462 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[i] + cf0[i-1] ) ;
463 t1[nm1] = .5 * cf0[nr-2] ;
481 for ( i = 3; i < nr; i += 2 ) {
482 ff0[i] = t1[i] - c1 ;
487 double fmoins0 = nm1s2 * c1 + som ;
493 for ( i = 3; i < nr; i += 2 ) {
494 g[i] = 0.25 * ( ff0[i] - ff0[i-2] ) ;
507 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
514 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
519 for ( i = 1; i < nm1s2 ; i++ ) {
525 int ixsym = nm1 - isym ;
527 double fp = .5 * ( g[i] + g[isym] ) ;
528 double fm = .5 * ( g[i] - g[isym] ) / sinp[i] ;
530 ff0[ix] = ( fp + fm ) / x[ix];
531 ff0[ixsym] = ( fp - fm ) / x[ixsym] ;
536 ff0[nm1] = g[0] + fmoins0 ;
537 ff0[nm1s2] = g[nm1s2] / x[nm1s2] ;
551 for (k=0; k<n2c; k++) {
553 int i0 = n2n3c * j + n3c * k ;
554 double* cf0 = cf + i0 ;
556 i0 = n2n3f * j + n3f * k ;
557 double* ff0 = ff + i0 ;
562 t1[0] = .5 * cf0[0] ;
563 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[i] + cf0[i-1] ) ;
564 t1[nm1] = .5 * cf0[nr-2] ;
582 for ( i = 3; i < nr; i += 2 ) {
583 ff0[i] = t1[i] - c1 ;
588 double fmoins0 = nm1s2 * c1 + som ;
594 for ( i = 3; i < nr; i += 2 ) {
595 g[i] = 0.25 * ( ff0[i] - ff0[i-2] ) ;
608 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
615 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
620 for ( i = 1; i < nm1s2 ; i++ ) {
626 int ixsym = nm1 - isym ;
628 double fp = .5 * ( g[i] + g[isym] ) ;
629 double fm = .5 * ( g[i] - g[isym] ) / sinp[i] ;
631 ff0[ix] = ( fp + fm ) / x[ix];
632 ff0[ixsym] = ( fp - fm ) / x[ixsym] ;
637 ff0[nm1] = g[0] + fmoins0 ;
638 ff0[nm1s2] = g[nm1s2] / x[nm1s2] ;