Revision: 10518 http://pure-data.svn.sourceforge.net/pure-data/?rev=10518&view=rev Author: fzotter Date: 2009-01-12 19:14:05 +0000 (Mon, 12 Jan 2009)
Log Message: ----------- corrected some misbehavior of the spherical harmoncis mathematical functions
Modified Paths: -------------- trunk/externals/iem/iemmatrix/src/mtx_sh/legendre_a.c trunk/externals/iem/iemmatrix/src/mtx_sh/sharmonics.c
Modified: trunk/externals/iem/iemmatrix/src/mtx_sh/legendre_a.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_sh/legendre_a.c 2009-01-12 18:19:54 UTC (rev 10517) +++ trunk/externals/iem/iemmatrix/src/mtx_sh/legendre_a.c 2009-01-12 19:14:05 UTC (rev 10518) @@ -25,16 +25,9 @@ // 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; l<wl->l; l++,l0+=incr) { - wl->p[l0+n0+n] = -(2*n-1) * wl->p[l0+nmo0+n-1] * sintheta[l]; - } + for (l=0,l0=0; l<wl->l; 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; l<wl->l; l++,l0+=incr) { - wl->p[l0+n0+n] = -(2*n-1) * wl->p[l0+nmo0+n-1]; - } - } nmo0=n0; n0+=n+1; }
Modified: trunk/externals/iem/iemmatrix/src/mtx_sh/sharmonics.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_sh/sharmonics.c 2009-01-12 18:19:54 UTC (rev 10517) +++ trunk/externals/iem/iemmatrix/src/mtx_sh/sharmonics.c 2009-01-12 19:14:05 UTC (rev 10518) @@ -56,7 +56,15 @@ const int yincr=(ws->nmax+1)*(ws->nmax+1);
for (n=0,ny0=0; n<=ws->nmax; n++) { - for (m=0; m<=n; m++) { + m=0; + ly0=0; + lt0=nt0; + for (l=0; l<ws->l; l++) { + ws->y[ly0+ny0+m]*= ws->wc->t[lt0+m]; + ly0+=yincr; + lt0+=tincr; + } + for (m=1; m<=n; m++) { ly0=0; lt0=nt0; for (l=0; l<ws->l; l++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.