From ca0d6cb8ef5e7ad9ada495fb38892e2d6562ec81 Mon Sep 17 00:00:00 2001 From: Franz Zotter Date: Mon, 12 Jan 2009 19:14:05 +0000 Subject: corrected some misbehavior of the spherical harmoncis mathematical functions svn path=/trunk/externals/iem/iemmatrix/; revision=10518 --- src/mtx_sh/legendre_a.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/mtx_sh/legendre_a.c') diff --git a/src/mtx_sh/legendre_a.c b/src/mtx_sh/legendre_a.c index 687cb41..d4e53f4 100644 --- a/src/mtx_sh/legendre_a.c +++ b/src/mtx_sh/legendre_a.c @@ -25,15 +25,8 @@ static void legendre_first_recurrence (double *sintheta, LegendreWorkSpace *wl) // computes the legendre functions P_n^m(costheta) for m=n // from P_0^0 for (n=1; n<=wl->nmax; n++) { - if ((n%2)==1) { - for (l=0,l0=0; ll; l++,l0+=incr) { - wl->p[l0+n0+n] = -(2*n-1) * wl->p[l0+nmo0+n-1] * sintheta[l]; - } - } - else { - for (l=0,l0=0; ll; l++,l0+=incr) { - wl->p[l0+n0+n] = -(2*n-1) * wl->p[l0+nmo0+n-1]; - } + for (l=0,l0=0; ll; l++,l0+=incr) { + wl->p[l0+n0+n] = -(2*n-1) * wl->p[l0+nmo0+n-1] * sintheta[l]; } nmo0=n0; n0+=n+1; -- cgit v1.2.1