134 #include "proto_f77.h" 138 int* facto_ini(
int ) ;
139 double* trigo_ini(
int ) ;
140 double* cheb_ini(
const int) ;
144 void cfrcheb(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
164 cout <<
"cfrcheb: nr > n3f : nr = " << nr <<
" , n3f = " 170 cout <<
"cfrcheb: nr > n3c : nr = " << nr <<
" , n3c = " 176 cout <<
"cfrcheb: n1f > n1c : n1f = " << n1f <<
" , n1c = " 182 cout <<
"cfrcheb: n2f > n2c : n2f = " << n2f <<
" , n2c = " 194 int* facto = facto_ini(nm1) ;
195 double* trigo = trigo_ini(nm1) ;
198 double* sinp = cheb_ini(nr);
203 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) );
204 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
214 int n2n3f = n2f * n3f ;
215 int n2n3c = n2c * n3c ;
223 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
225 for (j=0; j< borne_phi; j++) {
229 for (k=0; k<n2f; k++) {
231 int i0 = n2n3f * j + n3f * k ;
232 double* ff0 = ff + i0 ;
234 i0 = n2n3c * j + n3c * k ;
235 double* cf0 = cf + i0 ;
243 double fmoins0 = 0.5 * ( ff0[0] - ff0[nm1] );
247 for ( i = 1; i < nm1s2 ; i++ ) {
251 double fp = 0.5 * ( ff0[i] + ff0[isym] ) ;
253 double fms = 0.5 * ( ff0[i] - ff0[isym] ) * sinp[i] ;
258 g[0] = 0.5 * ( ff0[0] + ff0[nm1] );
259 g[nm1s2] = ff0[nm1s2];
264 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
273 for (i=2; i<nm1; i += 2 ) cf0[i] = 2.* g[i] ;
285 for ( i = 3; i < nr; i += 2 ) {
286 cf0[i] = cf0[i-2] - 4. * g[i] ;
291 double c1 = - ( fmoins0 + som ) / nm1s2 ;
295 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;