149 #include "proto_f77.h" 154 int* facto_ini(
int ) ;
155 double* trigo_ini(
int ) ;
156 double* cheb_ini(
const int) ;
157 double* chebimp_ini(
const int ) ;
160 void circhebpimi(
const int* deg,
const int* dimc,
double* cf,
161 const int* dimf,
double* ff)
180 cout <<
"circhebpimi: nr > n3c : nr = " << nr <<
" , n3c = " 186 cout <<
"circhebpimi: nr > n3f : nr = " << nr <<
" , n3f = " 192 cout <<
"circhebpimi: n1c > n1f : n1c = " << n1c <<
" , n1f = " 198 cout <<
"circhebpimi: n2c > n2f : n2c = " << n2c <<
" , n2f = " 209 int* facto = facto_ini(nm1) ;
210 double* trigo = trigo_ini(nm1) ;
213 double* sinp = cheb_ini(nr);
216 double* x = chebimp_ini(nr);
220 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) ) ;
221 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
231 int n2n3f = n2f * n3f ;
232 int n2n3c = n2c * n3c ;
248 for (k=0; k<n2c; k++) {
250 int i0 = n2n3c * j + n3c * k ;
251 double* cf0 = cf + i0 ;
253 i0 = n2n3f * j + n3f * k ;
254 double* ff0 = ff + i0 ;
259 t1[0] = .5 * cf0[0] ;
260 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[i] + cf0[i-1] ) ;
261 t1[nm1] = .5 * cf0[nr-2] ;
279 for ( i = 3; i < nr; i += 2 ) {
280 ff0[i] = t1[i] - c1 ;
285 double fmoins0 = nm1s2 * c1 + som ;
291 for ( i = 3; i < nr; i += 2 ) {
292 g[i] = 0.25 * ( ff0[i] - ff0[i-2] ) ;
305 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
312 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
317 for ( i = 1; i < nm1s2 ; i++ ) {
323 int ixsym = nm1 - isym ;
325 double fp = .5 * ( g[i] + g[isym] ) ;
326 double fm = .5 * ( g[i] - g[isym] ) / sinp[i] ;
328 ff0[ix] = ( fp + fm ) / x[ix];
329 ff0[ixsym] = ( fp - fm ) / x[ixsym] ;
334 ff0[nm1] = g[0] + fmoins0 ;
335 ff0[nm1s2] = g[nm1s2] / x[nm1s2] ;
345 if ( (j != 1) && (j != n1f-1) ) {
349 for (k=0; k<n2c; k++) {
351 int i0 = n2n3c * j + n3c * k ;
352 double* cf0 = cf + i0 ;
354 i0 = n2n3f * j + n3f * k ;
355 double* ff0 = ff + i0 ;
360 t1[0] = .5 * cf0[0] ;
361 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[i] + cf0[i-1] ) ;
362 t1[nm1] = .5 * cf0[nr-2] ;
380 for ( i = 3; i < nr; i += 2 ) {
381 ff0[i] = t1[i] - c1 ;
386 double fmoins0 = nm1s2 * c1 + som ;
392 for ( i = 3; i < nr; i += 2 ) {
393 g[i] = 0.25 * ( ff0[i] - ff0[i-2] ) ;
406 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * t1[i] ;
413 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
418 for ( i = 1; i < nm1s2 ; i++ ) {
424 int ixsym = nm1 - isym ;
426 double fp = .5 * ( g[i] + g[isym] ) ;
427 double fm = .5 * ( g[i] - g[isym] ) / sinp[i] ;
429 ff0[ix] = ( fp + fm ) / x[ix];
430 ff0[ixsym] = ( fp - fm ) / x[ixsym] ;
435 ff0[nm1] = g[0] + fmoins0 ;
436 ff0[nm1s2] = g[nm1s2] / x[nm1s2] ;
466 for (k=0; k<n2c; k++) {
468 int i0 = n2n3c * j + n3c * k ;
469 double* cf0 = cf + i0 ;
471 i0 = n2n3f * j + n3f * k ;
472 double* ff0 = ff + i0 ;
490 for ( i = 3; i < nr; i += 2 ) {
491 ff0[i] = cf0[i] - c1 ;
496 double fmoins0 = nm1s2 * c1 + som ;
502 for ( i = 3; i < nr; i += 2 ) {
503 g[i] = 0.25 * ( ff0[i] - ff0[i-2] ) ;
516 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[i] ;
523 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
528 for ( i = 1; i < nm1s2 ; i++ ) {
534 int ixsym = nm1 - isym ;
536 double fp = .5 * ( g[i] + g[isym] ) ;
537 double fm = .5 * ( g[i] - g[isym] ) / sinp[i] ;
540 ff0[ixsym] = fp - fm ;
544 ff0[0] = g[0] - fmoins0 ;
545 ff0[nm1] = g[0] + fmoins0 ;
546 ff0[nm1s2] = g[nm1s2] ;
561 for (k=0; k<n2c; k++) {
563 int i0 = n2n3c * j + n3c * k ;
564 double* cf0 = cf + i0 ;
566 i0 = n2n3f * j + n3f * k ;
567 double* ff0 = ff + i0 ;
585 for ( i = 3; i < nr; i += 2 ) {
586 ff0[i] = cf0[i] - c1 ;
591 double fmoins0 = nm1s2 * c1 + som ;
597 for ( i = 3; i < nr; i += 2 ) {
598 g[i] = 0.25 * ( ff0[i] - ff0[i-2] ) ;
611 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[i] ;
618 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
623 for ( i = 1; i < nm1s2 ; i++ ) {
629 int ixsym = nm1 - isym ;
631 double fp = .5 * ( g[i] + g[isym] ) ;
632 double fm = .5 * ( g[i] - g[isym] ) / sinp[i] ;
635 ff0[ixsym] = fp - fm ;
639 ff0[0] = g[0] - fmoins0 ;
640 ff0[nm1] = g[0] + fmoins0 ;
641 ff0[nm1s2] = g[nm1s2] ;