136 #include "proto_f77.h" 140 int* facto_ini(
int ) ;
141 double* trigo_ini(
int ) ;
142 double* cheb_ini(
const int) ;
146 void cfrchebp(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
166 cout <<
"cfrchebp: nr > n3f : nr = " << nr <<
" , n3f = " 172 cout <<
"cfrchebp: nr > n3c : nr = " << nr <<
" , n3c = " 178 cout <<
"cfrchebp: n1f > n1c : n1f = " << n1f <<
" , n1c = " 184 cout <<
"cfrchebp: n2f > n2c : n2f = " << n2f <<
" , n2c = " 195 int* facto = facto_ini(nm1) ;
196 double* trigo = trigo_ini(nm1) ;
199 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[nm1] - ff0[0] );
247 for ( i = 1; i < nm1s2 ; i++ ) {
253 int ixsym = nm1 - isym ;
256 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
258 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
263 g[0] = 0.5 * ( ff0[nm1] + ff0[0] );
264 g[nm1s2] = ff0[nm1s2];
269 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
278 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
289 for ( i = 3; i < nr; i += 2 ) {
290 cf0[i] = cf0[i-2] + 4. * g[i] ;
295 double c1 = ( fmoins0 - som ) / nm1s2 ;
299 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;