• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修訂0549fc71553ca86e99d4cd43bfbe571d4a0433a1 (tree)
時間2012-11-27 13:54:29
作者Katsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Log Message

Use std::numeric_limits::infinity instead of 1.0/0.0. #28915

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/branches/gdiis@1138 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

差異

--- a/src/optimization/GDIIS.cpp
+++ b/src/optimization/GDIIS.cpp
@@ -255,7 +255,8 @@ bool GDIIS::DoGDIIS(double *vectorError, Molecule& molecule, double const* vecto
255255 }
256256
257257 double GDIIS::MinCosine(){
258- static const double mincos[] = {1.0/0.0, 1.0/0.0, 0.97, 0.84, 0.71, 0.67, 0.62, 0.56, 0.49, 0.41};
258+ static const double inf = std::numeric_limits<double>::infinity();
259+ static const double mincos[] = {inf, inf, 0.97, 0.84, 0.71, 0.67, 0.62, 0.56, 0.49, 0.41};
259260 static const int nummincos = sizeof(mincos)/sizeof(mincos[0]);
260261 int numErrors = listErrors.size();
261262 return numErrors >= nummincos ? 0.0 : mincos[numErrors];