diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-21 02:50:10 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-21 02:50:10 +0000 |
commit | b221b61ae27b7a9acb2d3dc5acfc5463ee87f995 (patch) | |
tree | f6ab780f422e608bb16c7b04d698d97d15bc9ff8 /utils/logval.h | |
parent | 524e40dc9ccd03aa8d8115a606b75a25228bb8d5 (diff) |
semiring
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@609 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'utils/logval.h')
-rw-r--r-- | utils/logval.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/logval.h b/utils/logval.h index 868146de..833da7b8 100644 --- a/utils/logval.h +++ b/utils/logval.h @@ -110,10 +110,10 @@ class LogVal { //remember, s_ means negative. inline bool lt(Self const& o) const { - return s_ ? (!o.s_ || o.v_<v_) : (o.s_ || v_<o.v_); + return s_==o.s_ ? v_ < o.v_ : s_ > o.s_; } inline bool gt(Self const& o) const { - return s_ ? (o.s_ && v_<o.v_) : (!o.s_ && o.v_<v_); + return s_==o.s_ ? o.v_ < v_ : s_ < o.s_; } Self operator-() const { @@ -148,6 +148,7 @@ template <class T> struct semiring_traits<LogVal<T> > : default_semiring_traits<LogVal<T> > { static const bool has_logplus=true; static const bool has_besteq=true; + static const bool has_order=true; static const bool has_subtract=true; static const bool has_negative=true; }; |