From 1eab70e16f0e0d5531f3babfea2062c82f6362e1 Mon Sep 17 00:00:00 2001 From: graehl Date: Fri, 27 Aug 2010 19:26:31 +0000 Subject: compiles git-svn-id: https://ws10smt.googlecode.com/svn/trunk@626 ec762483-ff6d-05da-a07a-a48fb63a330f --- utils/logval.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'utils/logval.h') diff --git a/utils/logval.h b/utils/logval.h index 4605d919..da0aa2b0 100644 --- a/utils/logval.h +++ b/utils/logval.h @@ -10,11 +10,18 @@ #include #include #include "semiring.h" +#include "show.h" //TODO: template for supporting negation or not - most uses are for nonnegative "probs" only; probably some 10-20% speedup available template class LogVal { public: + void print(std::ostream &o) const { + if (s_) o<<"(-)"; + o<) + typedef LogVal Self; LogVal() : s_(), v_(LOGVAL_LOG0) {} @@ -143,6 +150,7 @@ class LogVal { bool s_; T v_; + }; template -- cgit v1.2.3