139 #include "proto_f77.h" 143 int* facto_ini(
int ) ;
144 double* trigo_ini(
int ) ;
145 double* cheb_ini(
const int) ;
148 void circheb(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
168 cout <<
"circheb: nr > n3c : nr = " << nr <<
" , n3c = " 174 cout <<
"circheb: nr > n3f : nr = " << nr <<
" , n3f = " 180 cout <<
"circheb: n1c > n1f : n1c = " << n1c <<
" , n1f = " 186 cout <<
"circheb: n2c > n2f : n2c = " << n2c <<
" , n2f = " 197 int* facto = facto_ini(nm1) ;
198 double* trigo = trigo_ini(nm1) ;
201 double* sinp = cheb_ini(nr);
205 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) ) ;
206 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
216 int n2n3f = n2f * n3f ;
217 int n2n3c = n2c * n3c ;
225 int borne_phi = ( n1c > 1 ) ? n1c-1 : 1 ;
227 for (j=0; j< borne_phi; j++) {
231 for (k=0; k<n2c; k++) {
233 int i0 = n2n3c * j + n3c * k ;
234 double* cf0 = cf + i0 ;
236 i0 = n2n3f * j + n3f * k ;
237 double* ff0 = ff + i0 ;
255 for ( i = 3; i < nr; i += 2 ) {
256 ff0[i] = cf0[i] - c1 ;
260 double fmoins0 = - nm1s2 * c1 - som ;
266 for ( i = 3; i < nr; i += 2 ) {
267 g[i] = -0.25 * ( ff0[i] - ff0[i-2] ) ;
279 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[i] ;
286 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
291 for ( i = 1; i < nm1s2 ; i++ ) {
295 double fp = .5 * ( g[i] + g[isym] ) ;
296 double fm = .5 * ( g[i] - g[isym] ) / sinp[i] ;
298 ff0[isym] = fp - fm ;
302 ff0[0] = g[0] + fmoins0 ;
303 ff0[nm1] = g[0] - fmoins0 ;
304 ff0[nm1s2] = g[nm1s2] ;