123 #include "proto_f77.h" 127 int* facto_ini(
int ) ;
128 double* trigo_ini(
int ) ;
129 double* cheb_ini(
const int) ;
132 void cftcos(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
151 cout <<
"cftcos: nt > n2f : nt = " << nt <<
" , n2f = " 157 cout <<
"cftcos: nt > n2c : nt = " << nt <<
" , n2c = " 163 cout <<
"cftcos: n1f > n1c : n1f = " << n1f <<
" , n1c = " 169 cout <<
"cftcos: n3f > n3c : n3f = " << n3f <<
" , n3c = " 180 int* facto = facto_ini(nm1) ;
181 double* trigo = trigo_ini(nm1) ;
184 double* sinp = cheb_ini(nt);
188 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) );
189 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
200 int n2n3f = n2f * n3f ;
201 int n2n3c = n2c * n3c ;
209 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
211 for (j=0; j< borne_phi; j++) {
215 for (k=0; k<n3f; k++) {
217 int i0 = n2n3f * j + k ;
218 double* ff0 = ff + i0 ;
221 double* cf0 = cf + i0 ;
225 double fmoins0 = 0.5 * ( ff0[0] - ff0[ n3f*nm1 ] );
229 for ( i = 1; i < nm1s2 ; i++ ) {
235 int ixsym = n3f * isym ;
237 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
239 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
244 g[0] = 0.5 * ( ff0[0] + ff0[ n3f*nm1 ] );
245 g[nm1s2] = ff0[ n3f*nm1s2 ];
250 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
259 for (i=2; i<nm1; i += 2 ) cf0[n3c*i] = 2.* g[i] ;
260 cf0[n3c*nm1] = g[nm1] ;
270 for ( i = 3; i < nt; i += 2 ) {
271 cf0[n3c*i] = cf0[n3c*(i-2)] + 4. * g[i] ;
276 double c1 = ( fmoins0 - som ) / nm1s2 ;
280 for ( i = 3; i < nt; i += 2 ) cf0[n3c*i] += c1 ;