23char mat_cosi_legip_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/mat_cosi_legip.C,v 1.6 2014/10/13 08:53:13 j_novak Exp $" ;
104int loch_mat_cosi_legip = 0 ;
109double* mat_cosi_legip(
int np,
int nt) {
112static double* tab[NMAX] ;
113static int nb_dejafait = 0 ;
114static int np_dejafait[NMAX] ;
116static int nt_dejafait[NMAX] ;
119int i, indice, j, j2, m, l ;
126 for ( i=0 ; i < nb_dejafait ; i++ ) {
127 if ( (np_dejafait[i] == np) && (nt_dejafait[i] == nt) ) indice = i ;
133 if ( nb_dejafait >= NMAX ) {
134 cout <<
"mat_cosp_legpp: nb_dejafait >= NMAX : "
135 << nb_dejafait <<
" <-> " << NMAX << endl ;
139 indice = nb_dejafait ;
141 np_dejafait[indice] = np ;
142 nt_dejafait[indice] = nt ;
144 tab[indice] =
new double[(np/2+1)*nt*nt] ;
152 int nt2m1 = nt2 - 1 ;
160 double* yy =
new double[nt2] ;
161 double* cost =
new double[nt*nt2] ;
166 double dt = M_PI / double(2*(nt2-1)) ;
167 for (j=0; j<nt-1; j++) {
168 for (j2=0; j2<nt2; j2++) {
169 double theta = j2*dt ;
170 cost[nt2*j + j2] =
cos( (2*j+1) * theta ) ;
180 if (np == 1) m_max = 0 ;
182 for (m=0; m <= m_max ; m+=2) {
186 double* leg = legendre_norm(m, nt) ;
188 for (l=m/2; l<nt-1; l++) {
192 for (j=0; j<nt-1; j++) {
196 for (j2=0; j2<nt2; j2++) {
197 yy[nt2m1-j2] = cost[nt2*j + j2] *
198 leg[nt2* (ll-m) + j2] ;
203 cfrchebp(deg, deg, yy, deg, yy) ;
204 tab[indice][ nt*nt* m/2 + nt*l + j] =
205 2.*int1d_chebp(nt2, yy) ;
Cmp cos(const Cmp &)
Cosine.