136 #include "proto_f77.h" 140 int* facto_ini(
int ) ;
141 double* trigo_ini(
int ) ;
142 double* cheb_ini(
const int) ;
145 void citcosp(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
164 cout <<
"citcosp: nt > n2f : nt = " << nt <<
" , n2f = " 170 cout <<
"citcosp: nt > n2c : nt = " << nt <<
" , n2c = " 175 if ( (n1f > 1) && (n1c > n1f) ) {
176 cout <<
"citcosp: n1c > n1f : n1c = " << n1c <<
" , n1f = " 182 cout <<
"citcosp: n3c > n3f : n3c = " << n3c <<
" , n3f = " 193 int* facto = facto_ini(nm1) ;
194 double* trigo = trigo_ini(nm1) ;
197 double* sinp = cheb_ini(nt);
201 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) ) ;
202 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
213 int n2n3f = n2f * n3f ;
214 int n2n3c = n2c * n3c ;
222 int borne_phi = n1c-1 ;
223 if (n1f == 1) borne_phi = 1 ;
225 for (j=0; j< borne_phi; j++) {
229 for (k=0; k<n3c; k++) {
231 int i0 = n2n3c * j + k ;
232 double* cf0 = cf + i0 ;
235 double* ff0 = ff + i0 ;
249 double c1 = cf0[n3c] ;
253 for ( i = 3; i < nt; i += 2 ) {
254 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
255 som += ff0[ n3f*i ] ;
259 double fmoins0 = nm1s2 * c1 + som ;
265 for ( i = 3; i < nt; i += 2 ) {
266 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
279 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[ n3c*i ] ;
280 g[nm1] = cf0[ n3c*nm1 ] ;
286 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
291 for ( i = 1; i < nm1s2 ; i++ ) {
295 double fp = 0.5 * ( g[i] + g[isym] ) ;
296 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
297 ff0[ n3f*i ] = fp + fm ;
298 ff0[ n3f*isym ] = fp - fm ;
302 ff0[0] = g[0] + fmoins0 ;
303 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
304 ff0[ n3f*nm1s2 ] = g[nm1s2] ;