118 #include "proto_f77.h" 122 int* facto_ini(
int ) ;
123 double* trigo_ini(
int ) ;
124 double* cheb_ini(
const int) ;
125 double* chebimp_ini(
const int ) ;
129 void cfrchebpii(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
149 cout <<
"cfrchebpii: nr > n3f : nr = " << nr <<
" , n3f = " 155 cout <<
"cfrchebpii: nr > n3c : nr = " << nr <<
" , n3c = " 161 cout <<
"cfrchebpii: n1f > n1c : n1f = " << n1f <<
" , n1c = " 167 cout <<
"cfrchebpii: n2f > n2c : n2f = " << n2f <<
" , n2c = " 178 int* facto = facto_ini(nm1) ;
179 double* trigo = trigo_ini(nm1) ;
182 double* sinp = cheb_ini(nr);
185 double* x = chebimp_ini(nr);
189 double* g = (
double*)( malloc( (nm1+2)*
sizeof(
double) ) );
190 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++) {
217 for (k=1; k<n2f; k+=2) {
219 int i0 = n2n3f * j + n3f * k ;
220 double* ff0 = ff + i0 ;
222 i0 = n2n3c * j + n3c * k ;
223 double* cf0 = cf + i0 ;
227 double fmoins0 = 0.5 * ( ff0[nm1] - ff0[0] );
231 for ( i = 1; i < nm1s2 ; i++ ) {
237 int ixsym = nm1 - isym ;
240 double fp = 0.5 * ( ff0[ix] + ff0[ixsym] ) ;
242 double fms = 0.5 * ( ff0[ix] - ff0[ixsym] ) * sinp[i] ;
247 g[0] = 0.5 * ( ff0[nm1] + ff0[0] );
248 g[nm1s2] = ff0[nm1s2];
253 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
262 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
273 for ( i = 3; i < nr; i += 2 ) {
274 cf0[i] = cf0[i-2] + 4. * g[i] ;
279 double c1 = ( fmoins0 - som ) / nm1s2 ;
283 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
290 for (k=0; k<n2f; k+=2) {
291 int i0 = n2n3f * j + n3f * k ;
292 double* ff0 = ff + i0 ;
294 i0 = n2n3c * j + n3c * k ;
295 double* cf0 = cf + i0 ;
302 for (i=1; i<nr; i++) cf0[i] = x[i] * ff0[i] ;
305 double fmoins0 = 0.5 * ( cf0[nm1] - cf0[0] );
309 for ( i = 1; i < nm1s2 ; i++ ) {
315 int ixsym = nm1 - isym ;
318 double fp = 0.5 * ( cf0[ix] + cf0[ixsym] ) ;
320 double fms = 0.5 * ( cf0[ix] - cf0[ixsym] ) * sinp[i] ;
325 g[0] = 0.5 * ( cf0[nm1] + cf0[0] );
326 g[nm1s2] = cf0[nm1s2];
331 F77_fft991( g, t1, trigo, facto, &inc, &jump, &nm1, &lot, &isign) ;
341 for (i=2; i<nm1; i += 2 ) cf0[i] = 2. * g[i] ;
352 for ( i = 3; i < nr; i += 2 ) {
353 cf0[i] = cf0[i-2] + 4. * g[i] ;
358 double c1 = ( fmoins0 - som ) / nm1s2 ;
362 for ( i = 3; i < nr; i += 2 ) cf0[i] += c1 ;
368 for (i=1; i<nm1; i++) {
369 cf0[i] = 2 * cf0[i] - cf0[i-1] ;