23char mat_cossinci_legi_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/mat_cossinci_legi.C,v 1.5 2014/10/13 08:53:13 j_novak Exp $" ;
105int loch_mat_cossinci_legi = 0 ;
110double* mat_cossinci_legi(
int np,
int nt) {
113static double* tab[NMAX] ;
114static int nb_dejafait = 0 ;
115static int np_dejafait[NMAX] ;
117static int nt_dejafait[NMAX] ;
120int i, indice, j, j2, m, l ;
127 for ( i=0 ; i < nb_dejafait ; i++ ) {
128 if ( (np_dejafait[i] == np) && (nt_dejafait[i] == nt) ) indice = i ;
134 if ( nb_dejafait >= NMAX ) {
135 cout <<
"mat_cossinci_legi: nb_dejafait >= NMAX : "
136 << nb_dejafait <<
" <-> " << NMAX << endl ;
140 indice = nb_dejafait ;
142 np_dejafait[indice] = np ;
143 nt_dejafait[indice] = nt ;
145 tab[indice] =
new double[(np/2+1)*nt*nt] ;
153 int nt2m1 = nt2 - 1 ;
161 double* yy =
new double[nt2] ;
162 double* cost =
new double[nt*nt2] ;
163 double* sint =
new double[nt*nt2] ;
168 double dt = M_PI / double(2*(nt2-1)) ;
169 for (j=0; j<nt-1; j++) {
170 for (j2=0; j2<nt2; j2++) {
171 double theta = j2*dt ;
172 cost[nt2*j + j2] =
cos( (2*j+1) * theta ) ;
173 sint[nt2*j + j2] =
sin( 2*j * theta ) ;
182 for (m=0; m < np/2+1 ; m++) {
186 double* leg = legendre_norm(m, nt) ;
191 for (l=m/2; l<nt-1; l++) {
195 for (j=0; j<nt-1; j++) {
199 for (j2=0; j2<nt2; j2++) {
200 yy[nt2m1-j2] = cost[nt2*j + j2] *
201 leg[nt2* (ll-m) + j2] ;
206 cfrchebp(deg, deg, yy, deg, yy) ;
207 tab[indice][ nt*nt* m + nt*l + j] =
208 2.*int1d_chebp(nt2, yy) ;
221 for (l=(m+1)/2; l<nt-1; l++) {
225 for (j=0; j<nt-1; j++) {
229 for (j2=0; j2<nt2; j2++) {
230 yy[nt2m1-j2] = sint[nt2*j + j2] *
231 leg[nt2* (ll-m) + j2] ;
236 cfrchebp(deg, deg, yy, deg, yy) ;
237 tab[indice][ nt*nt* m + nt*l + j] =
238 2.*int1d_chebp(nt2, yy) ;
Cmp sin(const Cmp &)
Sine.
Cmp cos(const Cmp &)
Cosine.