--- branches/development/src/math/SphericalHarmonic.cpp 2012/07/06 22:01:58 1767 +++ branches/development/src/math/SphericalHarmonic.cpp 2013/05/17 14:41:42 1875 @@ -35,7 +35,7 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -68,9 +68,7 @@ RealType SphericalHarmonic::LegendreP(int l,int m, Rea // RealType SphericalHarmonic::LegendreP(int l,int m, RealType x) { - RealType temp1, temp2, temp3, temp4, result; - RealType temp5; - int i, ll; + RealType result; if (fabs(x) > 1.0) { printf("LegendreP: x out of range: l = %d\tm = %d\tx = %lf\n", l, m, x); @@ -86,12 +84,13 @@ RealType SphericalHarmonic::LegendreP(int l,int m, Rea printf("LegendreP: m < 0: l = %d\tm = %d\tx = %lf\n", l, m, x); return std::numeric_limits :: quiet_NaN(); } else { + RealType temp1, temp2, temp3, temp4, temp5; temp3=1.0; if (m>0) { temp1=sqrt(1.0-pow(x,2)); temp5 = 1.0; - for (i=1;i<=m;++i) { + for (int i=1;i<=m;++i) { temp3 *= -temp5*temp1; temp5 += 2.0; } @@ -103,7 +102,7 @@ RealType SphericalHarmonic::LegendreP(int l,int m, Rea if (l==(m+1)) { result = temp4; } else { - for (ll=(m+2);ll<=l;++ll) { + for (int ll=(m+2);ll<=l;++ll) { temp2 = (x*(2.*ll-1.)*temp4-(ll+m-1.)*temp3)/(RealType)(ll-m); temp3=temp4; temp4=temp2;