135 fftw_plan back_fft(
int, Tbl*&) ;
136 double* cheb_ini(
const int) ;
137 double* chebimp_ini(
const int ) ;
140 void citcosi(
const int* deg,
const int* dimc,
double* cf,
const int* dimf,
159 cout <<
"citcosi: nt > n2f : nt = " << nt <<
" , n2f = " 164 cout <<
"citcosi: nt > n2c : nt = " << nt <<
" , n2c = " 168 if ( (n1f > 1) && (n1c > n1f) ) {
169 cout <<
"citcosi: n1c > n1f : n1c = " << n1c <<
" , n1f = " 174 cout <<
"citcosi: n3c > n3f : n3c = " << n3c <<
" , n3f = " 185 fftw_plan p = back_fft(nm1, pg) ;
187 double* t1 =
new double[nt] ;
190 double* sinp = cheb_ini(nt) ;
193 double* x = chebimp_ini(nt) ;
197 int n2n3f = n2f * n3f ;
198 int n2n3c = n2c * n3c ;
206 int borne_phi = n1c-1 ;
207 if (n1f == 1) borne_phi = 1 ;
209 for (j=0; j< borne_phi; j++) {
213 for (k=0; k<n3c; k++) {
215 int i0 = n2n3c * j + k ;
216 double* cf0 = cf + i0 ;
219 double* ff0 = ff + i0 ;
224 t1[0] = .5 * cf0[0] ;
225 for (i=1; i<nm1; i++) t1[i] = .5 * ( cf0[n3c*i] + cf0[n3c*(i-1)] ) ;
226 t1[nm1] = .5 * cf0[n3c*(nt-2)] ;
244 for ( i = 3; i < nt; i += 2 ) {
245 ff0[ n3f*i ] = t1[i] - c1 ;
246 som += ff0[ n3f*i ] ;
250 double fmoins0 = nm1s2 * c1 + som ;
255 for ( i = 3; i < nt; i += 2 ) {
256 g.set(nm1-i/2) = 0.25 * ( ff0[ n3f*i ] - ff0[ n3f*(i-2) ] ) ;
268 for (i=1; i<nm1s2; i++ ) g.set(i) = 0.5 * t1[2*i] ;
269 g.set(nm1s2) = t1[nm1] ;
280 for ( i = 1; i < nm1s2 ; i++ ) {
284 double fp = 0.5 * ( g(i) + g(isym) ) ;
285 double fm = 0.5 * ( g(i) - g(isym) ) / sinp[i] ;
286 ff0[ n3f*i ] = ( fp + fm ) / x[isym] ;
287 ff0[ n3f*isym ] = ( fp - fm ) / x[i] ;
291 ff0[0] = g(0) + fmoins0 ;
293 ff0[ n3f*nm1s2 ] = g(nm1s2) / x[nm1s2] ;