24char mat_legmp_cos_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/mat_legmp_cos.C,v 1.3 2014/10/13 08:53:14 j_novak Exp $" ;
93double* mat_legmp_cos(
int np,
int nt) {
96 static double* tab[NMAX] ;
97 static int nb_dejafait = 0 ;
98 static int np_dejafait[NMAX] ;
100 static int nt_dejafait[NMAX] ;
103 int i, indice, j, j2, m, l ;
108 for ( i=0 ; i < nb_dejafait ; i++ ) {
109 if ( (np_dejafait[i] == np) && (nt_dejafait[i] == nt) ) indice = i ;
115 if ( nb_dejafait >= NMAX ) {
116 cout <<
"mat_legpp_cosp: nb_dejafait >= NMAX : "
117 << nb_dejafait <<
" <-> " << NMAX << endl ;
121 indice = nb_dejafait ;
123 np_dejafait[indice] = np ;
124 nt_dejafait[indice] = nt ;
126 tab[indice] =
new double[(np/2+1)*nt*nt] ;
141 double* yy =
new double[nt2] ;
149 if (np == 1) m_max = 0 ;
151 for (m=0; m <= m_max ; m+=2) {
155 double* leg = legendre_norm(m, nt) ;
157 for (l=m; l<nt; l++) {
159 int parite = 1 - 2*((l-m)%2) ;
161 for (j2=0; j2<nt; j2++) {
162 yy[j2] = leg[nt2* (l-m) + 2*j2] ;
165 for (j2=nt; j2<nt2; j2++) {
166 yy[j2] = parite * leg[nt2* (l-m) + 2*nt2 -2 - 2*j2] ;
171 cftcos(deg, deg, yy, deg, yy) ;
174 for (j=0; j<nt; j++) {
175 tab[indice][ nt*nt* m/2 + nt*j + l] = yy[j] ;