summaryrefslogtreecommitdiff
path: root/utils/max_plus.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-27 19:26:31 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-27 19:26:31 +0000
commit04590b81a7ced69de6906616ce002d2608e77e90 (patch)
treeb6e20afb5d6dba858e44922286386564bc53d0f8 /utils/max_plus.h
parent649a4ea65e78193876d7cb5f387ef775362bfea0 (diff)
compiles
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@626 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'utils/max_plus.h')
-rwxr-xr-xutils/max_plus.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/max_plus.h b/utils/max_plus.h
index 2c55b33c..2e56f85e 100755
--- a/utils/max_plus.h
+++ b/utils/max_plus.h
@@ -19,10 +19,23 @@
#include <cassert>
#include <limits>
#include "semiring.h"
+#include "show.h"
+//#include "logval.h"
template <class T>
class MaxPlus {
public:
+ void print(std::ostream &o) const {
+ o<<v_;
+ }
+ PRINT_SELF(MaxPlus<T>)
+ template <class O>
+ void operator=(O const& o) {
+ v_=o.v_;
+ }
+ template <class O>
+ MaxPlus(O const& o) : v_(o.v_) { }
+
typedef MaxPlus<T> Self;
MaxPlus() : v_(LOGVAL_LOG0) {}
explicit MaxPlus(double x) : v_(std::log(x)) {}