23char mat_sini_legpi_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/mat_sini_legpi.C,v 1.6 2014/10/13 08:53:14 j_novak Exp $" ;
107int loch_mat_sini_legpi = 0 ;
112double* mat_sini_legpi(
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_cosp_legpp: 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* sint =
new double[nt*nt2] ;
169 double dt = M_PI / double(2*(nt2-1)) ;
170 for (j=0; j<nt-1; j++) {
171 for (j2=0; j2<nt2; j2++) {
172 double theta = j2*dt ;
173 sint[nt2*j + j2] =
sin( (2*j+1) * theta ) ;
182 int m_max = (np == 1) ? 1 : np-1 ;
184 for (m=1; m <= m_max ; m+=2) {
188 double* leg = legendre_norm(m, nt) ;
190 for (l=(m-1)/2; l<nt-1; l++) {
194 for (j=0; j<nt-1; j++) {
199 for (j2=0; j2<nt2; j2++) {
200 yy[nt2m1-j2] = sint[nt2*j + j2]
201 * leg[nt2* (ll-m) + j2] ;
206 cfrchebp(deg, deg, yy, deg, yy) ;
207 tab[indice][ nt*nt* ((m-1)/2) + nt*l + j] =
208 2.*int1d_chebp(nt2, yy) ;
Cmp sin(const Cmp &)
Sine.