• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiona06f6a703c951e409bb7e0faa5a177224765cf83 (tree)
Time2013-02-28 14:40:47
AuthorMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

0-divide is avoided in mathematically exact way.#30045

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1305 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

Incremental Difference

--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -5136,6 +5136,10 @@ void Cndo2::CalcRotatingMatrix1stDerivatives(double*** rotMat1stDerivatives,
51365136 double r = sqrt( pow(x,2.0) + pow(y,2.0) );
51375137 double R = sqrt( pow(x,2.0) + pow(y,2.0) + pow(z,2.0) );
51385138
5139+ if(r==0e0){
5140+ return;
5141+ }
5142+
51395143 // for s-function
51405144 rotMat1stDerivatives[s][s][XAxis] = 0.0;
51415145 rotMat1stDerivatives[s][s][YAxis] = 0.0;
@@ -5206,6 +5210,11 @@ void Cndo2::CalcRotatingMatrix2ndDerivatives(double**** rotMat2ndDerivatives,
52065210 double z = atomB.GetXyz()[2] - atomA.GetXyz()[2];
52075211 double r = sqrt( pow(x,2.0) + pow(y,2.0) );
52085212 double R = sqrt( pow(x,2.0) + pow(y,2.0) + pow(z,2.0) );
5213+
5214+ if(r==0e0){
5215+ return;
5216+ }
5217+
52095218 double temp1 = 1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0));
52105219 double temp2 = 2.0*pow(r*R,-3.0) + 3.0/(pow(r,5.0)*R) + 3.0/(r*pow(R,5.0));
52115220 double temp3 = pow(r*R,-3.0) + 3.0/(r*pow(R,5.0));