23char mat_cossincp_legp_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/mat_cossincp_legp.C,v 1.6 2014/10/13 08:53:13 j_novak Exp $" ;
107int loch_mat_cossincp_legp = 0 ;
112double* mat_cossincp_legp(
int np,
int nt) {
115static double* tab[NMAX] ;
116static int nb_dejafait = 0 ;
117static int np_dejafait[NMAX] ;
119static int nt_dejafait[NMAX] ;
122int i, indice, j, j2, m, l ;
129 for ( i=0 ; i < nb_dejafait ; i++ ) {
130 if ( (np_dejafait[i] == np) && (nt_dejafait[i] == nt) ) indice = i ;
136 if ( nb_dejafait >= NMAX ) {
137 cout <<
"mat_cossincp_legp: nb_dejafait >= NMAX : "
138 << nb_dejafait <<
" <-> " << NMAX << endl ;
142 indice = nb_dejafait ;
144 np_dejafait[indice] = np ;
145 nt_dejafait[indice] = nt ;
147 tab[indice] =
new double[(np/2+1)*nt*nt] ;
155 int nt2m1 = nt2 - 1 ;
163 double* yy =
new double[nt2] ;
164 double* cost =
new double[nt*nt2] ;
165 double* sint =
new double[nt*nt2] ;
170 double dt = M_PI / double(2*(nt2-1)) ;
171 for (j=0; j<nt; j++) {
172 for (j2=0; j2<nt2; j2++) {
173 double theta = j2*dt ;
174 cost[nt2*j + j2] =
cos( 2*j * theta ) ;
175 sint[nt2*j + j2] =
sin( (2*j+1) * theta ) ;
184 for (m=0; m < np/2+1 ; m++) {
188 double* leg = legendre_norm(m, nt) ;
193 for (l=m/2; l<nt; l++) {
197 for (j=0; j<nt; j++) {
201 for (j2=0; j2<nt2; j2++) {
202 yy[nt2m1-j2] = cost[nt2*j + j2] *
203 leg[nt2* (ll-m) + j2] ;
208 cfrchebp(deg, deg, yy, deg, yy) ;
209 tab[indice][ nt*nt* m + nt*l + j] =
210 2.*int1d_chebp(nt2, yy) ;
223 for (l=(m-1)/2; l<nt-1; l++) {
227 for (j=0; j<nt-1; j++) {
231 for (j2=0; j2<nt2; j2++) {
232 yy[nt2m1-j2] = sint[nt2*j + j2] *
233 leg[nt2* (ll-m) + j2] ;
238 cfrchebp(deg, deg, yy, deg, yy) ;
239 tab[indice][ nt*nt* m + nt*l + j] =
240 2.*int1d_chebp(nt2, yy) ;
Cmp sin(const Cmp &)
Sine.
Cmp cos(const Cmp &)
Cosine.