diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-23 19:17:22 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-23 19:17:22 +0000 |
commit | a2d9d0f96502c7d3c04303f3db36a8602d992287 (patch) | |
tree | f627e30f0005f1cec4d234d814cd7c6a3f060acf /decoder/logval.h | |
parent | c57c05d19fb306f7f50cc02516a8a2901c920cca (diff) |
sparse_vector use google::dense_hash_map, fsa scan logging
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@383 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/logval.h')
-rw-r--r-- | decoder/logval.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/decoder/logval.h b/decoder/logval.h index c8c342a3..37f14ae5 100644 --- a/decoder/logval.h +++ b/decoder/logval.h @@ -13,6 +13,8 @@ class LogVal { public: LogVal() : s_(), v_(-std::numeric_limits<T>::infinity()) {} explicit LogVal(double x) : s_(std::signbit(x)), v_(s_ ? std::log(-x) : std::log(x)) {} + LogVal(int x) : s_(x<0), v_(s_ ? std::log(-x) : std::log(x)) {} + LogVal(unsigned x) : s_(0), v_(std::log(x)) { } LogVal(double lnx,bool sign) : s_(sign),v_(lnx) {} static LogVal<T> exp(T lnx) { return LogVal(lnx,false); } |