139 #include "proto_f77.h" 143 int* facto_ini(
int ) ;
144 double* trigo_ini(
int ) ;
145 double* cheb_ini(
const int) ;
146 double* chebimp_ini(
const int ) ;
150 void cfrchebi(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
170 cout <<
"cfrchebi: nr > n3f : nr = " << nr <<
" , n3f = " 176 cout <<
"cfrchebi: nr > n3c : nr = " << nr <<
" , n3c = " 182 cout <<
"cfrchebi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 188 cout <<
"cfrchebi: n2f > n2c : n2f = " << n2f <<
" , n2c = " 199 int* facto = facto_ini(nm1) ;
200 double* trigo = trigo_ini(nm1) ;
203 double* sinp = cheb_ini(nr);
206 double* x = chebimp_ini(nr);
210 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) );
211 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
221 int n2n3f = n2f * n3f ;
222 int n2n3c = n2c * n3c ;
230 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
232 for (j=0; j< borne_phi; j++) {
236 for (k=0; k<n2f; k++) {
238 int i0 = n2n3f * j + n3f * k ;
239 double* ff0 = ff + i0 ;
241 i0 = n2n3c * j + n3c * k ;
242 double* cf0 = cf + i0 ;
249 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
257 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
261 for ( i = 1; i < nm1s2 ; i++ ) {
267 int ixsym = nm1 - isym ;
270 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
272 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
277 g[0] = 0.5 * ( cf0[nm1] + cf0[0] );
278 g[nm1s2] = cf0[nm1s2];
283 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
293 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
304 for ( i = 3; i < nr; i += 2 ) {
305 cf0[i] = cf0[i-2] + 4. * g[i] ;
310 double c1 = ( fmoins0 - som ) / nm1s2 ;
314 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
320 for (i=1; i<nm1; i++) {
321 cf0[i] = 2 * cf0[i] - cf0[i-1] ;