summaryrefslogtreecommitdiff
path: root/utils/weights.cc
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-10-22 12:07:20 +0100
committerKenneth Heafield <github@kheafield.com>2012-10-22 12:07:20 +0100
commit5f98fe5c4f2a2090eeb9d30c030305a70a8347d1 (patch)
tree9b6002f850e6dea1e3400c6b19bb31a9cdf3067f /utils/weights.cc
parentcf9994131993b40be62e90e213b1e11e6b550143 (diff)
parent21825a09d97c2e0afd20512f306fb25fed55e529 (diff)
Merge remote branch 'upstream/master'
Conflicts: Jamroot bjam decoder/Jamfile decoder/cdec.cc dpmert/Jamfile jam-files/sanity.jam klm/lm/Jamfile klm/util/Jamfile mira/Jamfile
Diffstat (limited to 'utils/weights.cc')
-rw-r--r--utils/weights.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/weights.cc b/utils/weights.cc
index f56e2a20..575877b6 100644
--- a/utils/weights.cc
+++ b/utils/weights.cc
@@ -34,7 +34,7 @@ void Weights::InitFromFile(const string& filename,
int weight_count = 0;
bool fl = false;
string buf;
- weight_t val = 0;
+ double val = 0;
while (in) {
getline(in, buf);
if (buf.size() == 0) continue;
@@ -53,7 +53,7 @@ void Weights::InitFromFile(const string& filename,
if (feature_list) { feature_list->push_back(buf.substr(start, end - start)); }
while(end < buf.size() && buf[end] == ' ') ++end;
val = strtod(&buf.c_str()[end], NULL);
- if (isnan(val)) {
+ if (std::isnan(val)) {
cerr << FD::Convert(fid) << " has weight NaN!\n";
abort();
}
@@ -127,8 +127,8 @@ void Weights::InitSparseVector(const vector<weight_t>& dv,
void Weights::SanityCheck(const vector<weight_t>& w) {
for (unsigned i = 0; i < w.size(); ++i) {
- assert(!isnan(w[i]));
- assert(!isinf(w[i]));
+ assert(!std::isnan(w[i]));
+ assert(!std::isinf(w[i]));
}
}