105 double* legendre_norm(
int m,
int nt) {
109 int lmax = 2*nt - 2 ;
113 int nt2m1 = nt2 - 1 ;
121 double* yy =
new double[nt2] ;
127 double* leg = legendre(m, nt2) ;
131 for (l=m; l<lmax+1; l++) {
133 int ml = (m+1)*(l+1) ;
138 for (j=0; j<nt2; j++) {
139 leg[nt2*(l-m)+j] /= ml ;
143 for (j=0; j<nt2; j++) {
144 double w = leg[nt2*(l-m)+j] ;
145 yy[nt2m1-j] = w * w ;
151 cfrchebp(deg, deg, yy, deg, yy) ;
154 double integ = 2.*int1d_chebp(nt2, yy) ;
157 double fact = 1. /
sqrt(integ) ;
169 for (j=0; j<nt2; j++) {
170 leg[nt2*(l-m)+j] *= fact ;
Cmp sqrt(const Cmp &)
Square root.