134 #include "proto_f77.h" 138 int* facto_ini(
int ) ;
139 double* trigo_ini(
int ) ;
140 double* cheb_ini(
const int) ;
141 double* chebimp_ini(
const int ) ;
144 void cftcosi(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
163 cout <<
"cftcosi: nt > n2f : nt = " << nt <<
" , n2f = " 169 cout <<
"cftcosi: nt > n2c : nt = " << nt <<
" , n2c = " 175 cout <<
"cftcosi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 181 cout <<
"cftcosi: n3f > n3c : n3f = " << n3f <<
" , n3c = " 192 int* facto = facto_ini(nm1) ;
193 double* trigo = trigo_ini(nm1) ;
196 double* sinp = cheb_ini(nt);
199 double* x = chebimp_ini(nt);
202 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) );
203 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<n3f; k++) {
231 int i0 = n2n3f * j + k ;
232 double* ff0 = ff + i0 ;
235 double* cf0 = cf + i0 ;
241 for (i=0; i<nt-1; i++) cf0[n3c*i] = x[nm1-i] * ff0[n3f*i] ;
250 double fmoins0 = 0.5 * ( cf0[0] - cf0[ n3c*nm1 ] );
254 for ( i = 1; i < nm1s2 ; i++ ) {
260 int ixsym = n3c * isym ;
262 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
264 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
269 g[0] = 0.5 * ( cf0[0] + cf0[ n3c*nm1 ] );
270 g[nm1s2] = cf0[ n3c*nm1s2 ];
275 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
285 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = 2.* g[i] ;
286 cf0[n3c*nm1] = g[nm1] ;
296 for ( i = 3; i < nt; i += 2 ) {
297 cf0[n3c*i] = cf0[n3c*(i-2)] + 4. * g[i] ;
302 double c1 = ( fmoins0 - som ) / nm1s2 ;
306 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;
313 for (i=1; i<nm1; i++) {
314 cf0[n3c*i] = 2 * cf0[n3c*i] - cf0[n3c*(i-1)] ;