127 #include "proto_f77.h" 131 int* facto_ini(
int ) ;
132 double* trigo_ini(
int ) ;
133 double* cheb_ini(
const int) ;
136 void citcos(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
155 cout <<
"citcos: nt > n2f : nt = " << nt <<
" , n2f = " 161 cout <<
"citcos: nt > n2c : nt = " << nt <<
" , n2c = " 166 if ( (n1f > 1) && (n1c > n1f) ) {
167 cout <<
"citcos: n1c > n1f : n1c = " << n1c <<
" , n1f = " 173 cout <<
"citcos: n3c > n3f : n3c = " << n3c <<
" , n3f = " 184 int* facto = facto_ini(nm1) ;
185 double* trigo = trigo_ini(nm1) ;
188 double* sinp = cheb_ini(nt);
192 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) ) ;
193 double* t1 = (
double*)( malloc( (nm1+2)*
sizeof(double) ) ) ;
204 int n2n3f = n2f * n3f ;
205 int n2n3c = n2c * n3c ;
213 int borne_phi = n1c-1 ;
214 if (n1f == 1) borne_phi = 1 ;
216 for (j=0; j< borne_phi; j++) {
220 for (k=0; k<n3c; k++) {
222 int i0 = n2n3c * j + k ;
223 double* cf0 = cf + i0 ;
226 double* ff0 = ff + i0 ;
231 double c1 = cf0[n3c] ;
235 for ( i = 3; i < nt; i += 2 ) {
236 ff0[ n3f*i ] = cf0[ n3c*i ] - c1 ;
237 som += ff0[ n3f*i ] ;
241 double fmoins0 = nm1s2 * c1 + som ;
244 for ( i = 3; i < nt; i += 2 ) {
245 g[i] = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
254 for (i=2; i<nm1; i += 2 ) g[i] = 0.5 * cf0[ n3c*i ] ;
255 g[nm1] = cf0[ n3c*nm1 ] ;
261 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
266 for ( i = 1; i < nm1s2 ; i++ ) {
270 double fp = 0.5 * ( g[i] + g[isym] ) ;
271 double fm = 0.5 * ( g[i] - g[isym] ) / sinp[i] ;
272 ff0[ n3f*i ] = fp + fm ;
273 ff0[ n3f*isym ] = fp - fm ;
277 ff0[0] = g[0] + fmoins0 ;
278 ff0[ n3f*nm1 ] = g[0] - fmoins0 ;
279 ff0[ n3f*nm1s2 ] = g[nm1s2] ;