23char mat_leg_cossinc_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/mat_leg_cossinc.C,v 1.5 2014/10/13 08:53:13 j_novak Exp $" ;
101int loch_mat_leg_cossinc = 0 ;
106double* mat_leg_cossinc(
int np,
int nt) {
109static double* tab[NMAX] ;
110static int nb_dejafait = 0 ;
111static int np_dejafait[NMAX] ;
113static int nt_dejafait[NMAX] ;
116int i, indice, j, j2, m, l ;
122 for ( i=0 ; i < nb_dejafait ; i++ ) {
123 if ( (np_dejafait[i] == np) && (nt_dejafait[i] == nt) ) indice = i ;
129 if ( nb_dejafait >= NMAX ) {
130 cout <<
"mat_legp_cossinc: nb_dejafait >= NMAX : "
131 << nb_dejafait <<
" <-> " << NMAX << endl ;
135 indice = nb_dejafait ;
137 np_dejafait[indice] = np ;
138 nt_dejafait[indice] = nt ;
140 tab[indice] =
new double[(np/2+1)*nt*nt] ;
155 double* yy =
new double[nt2] ;
162 for (m=0; m < np/2+1 ; m++) {
166 double* leg = legendre_norm(m, nt) ;
171 for (l=m; l<nt; l++) {
173 int parite = 1 - 2*((l-m)%2) ;
175 for (j2=0; j2<nt; j2++) {
176 yy[j2] = leg[nt2* (l-m) + 2*j2] ;
179 for (j2=nt; j2<nt2; j2++) {
180 yy[j2] = parite * leg[nt2* (l-m) + 2*nt2 -2 - 2*j2] ;
185 cftcos(deg, deg, yy, deg, yy) ;
188 for (j=0; j<nt; j++) {
189 tab[indice][ nt*nt* m + nt*j + l] = yy[j] ;
201 for (l=m; l<nt; l++) {
203 int parite = 1 - 2*((l-m)%2) ;
205 for (j2=0; j2<nt; j2++) {
206 yy[j2] = leg[nt2* (l-m) + 2*j2] ;
209 for (j2=nt; j2<nt2; j2++) {
210 yy[j2] = parite * leg[nt2* (l-m) + 2*nt2 -2 - 2*j2] ;
216 cftsin(deg, deg, yy, deg, yy) ;
219 for (j=0; j<nt-1; j++) {
220 tab[indice][ nt*nt* m + nt*j + l] = yy[j] ;