23char mat_legmi_sin_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/mat_legmi_sin.C,v 1.3 2014/10/13 08:53:14 j_novak Exp $" ;
90double* mat_legmi_sin(
int np,
int nt) {
93 static double* tab[NMAX] ;
94 static int nb_dejafait = 0 ;
95 static int np_dejafait[NMAX] ;
97 static int nt_dejafait[NMAX] ;
99 int i, indice, j, j2, m, l ;
104 for ( i=0 ; i < nb_dejafait ; i++ ) {
105 if ( (np_dejafait[i] == np) && (nt_dejafait[i] == nt) ) indice = i ;
111 if ( nb_dejafait >= NMAX ) {
112 cout <<
"mat_legii_sinp: nb_dejafait >= NMAX : "
113 << nb_dejafait <<
" <-> " << NMAX << endl ;
117 indice = nb_dejafait ;
119 np_dejafait[indice] = np ;
120 nt_dejafait[indice] = nt ;
122 tab[indice] =
new double[(np/2+1)*nt*nt] ;
137 double* yy =
new double[nt2] ;
144 int m_max = (np == 1) ? 1 : np-1 ;
146 for (m=1; m <= m_max ; m+=2) {
150 double* leg = legendre_norm(m, nt) ;
153 for (l=m; l<nt-1; l++) {
155 int parite = 1 - 2*((l-m)%2) ;
157 for (j2=0; j2<nt; j2++) {
158 yy[j2] = leg[nt2* (l-m) + 2*j2] ;
161 for (j2=nt; j2<nt2; j2++) {
162 yy[j2] = parite * leg[nt2* (l-m) + 2*nt2 -2 - 2*j2] ;
167 cftsin(deg, deg, yy, deg, yy) ;
170 for (j=0; j<nt-1; j++) {
171 tab[indice][ nt*nt*((m-1)/2) + nt*j + l] = yy[j] ;