修訂 | 0549fc71553ca86e99d4cd43bfbe571d4a0433a1 (tree) |
---|---|
時間 | 2012-11-27 13:54:29 |
作者 | Katsuhiko Nishimra <ktns.87@gmai...> |
Commiter | Katsuhiko Nishimra |
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
@@ -255,7 +255,8 @@ bool GDIIS::DoGDIIS(double *vectorError, Molecule& molecule, double const* vecto | ||
255 | 255 | } |
256 | 256 | |
257 | 257 | 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}; | |
259 | 260 | static const int nummincos = sizeof(mincos)/sizeof(mincos[0]); |
260 | 261 | int numErrors = listErrors.size(); |
261 | 262 | return numErrors >= nummincos ? 0.0 : mincos[numErrors]; |