summaryrefslogtreecommitdiff
path: root/utils/max_plus.h
diff options
context:
space:
mode:
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)) {}