Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2012-04-12 00:19:11 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2012-04-12 00:19:11 +0400
commit49a4be289922d15adda93ca051a59f6f2ea827bb (patch)
tree0f37ccc84aaecf09c40d16f86714d49de9357d17 /mert/Point.cpp
parent65dc5a391f10c078469b209063c7c683b211dde5 (diff)
Reduce the number of calling the numeric_limits constructor.
- Create a test module for Point. - Add test cases.
Diffstat (limited to 'mert/Point.cpp')
-rw-r--r--mert/Point.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/mert/Point.cpp b/mert/Point.cpp
index ae5dbc21b..6be8ef31f 100644
--- a/mert/Point.cpp
+++ b/mert/Point.cpp
@@ -3,8 +3,8 @@
#include <cmath>
#include <cstdlib>
#include "util/check.hh"
-#include <limits>
#include "FeatureStats.h"
+#include "Optimizer.h"
using namespace std;
@@ -84,7 +84,7 @@ Point Point::operator+(const Point& p2) const
Res[i] += p2[i];
}
- Res.m_score = numeric_limits<statscore_t>::max();
+ Res.m_score = kMaxFloat;
return Res;
}
@@ -94,7 +94,7 @@ void Point::operator+=(const Point& p2)
for (unsigned i = 0; i < size(); i++) {
operator[](i) += p2[i];
}
- m_score = numeric_limits<statscore_t>::max();
+ m_score = kMaxFloat;
}
Point Point::operator*(float l) const
@@ -103,7 +103,7 @@ Point Point::operator*(float l) const
for (unsigned i = 0; i < size(); i++) {
Res[i] *= l;
}
- Res.m_score = numeric_limits<statscore_t>::max();
+ Res.m_score = kMaxFloat;
return Res;
}