From 2c22cee1f8fa87c527449a8bdc668ea311fdaf64 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Fri, 27 Apr 2012 13:33:58 +1000 Subject: Bit more work. maxFixpoint should be working now. --- impl/Operator.hpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'impl/Operator.hpp') diff --git a/impl/Operator.hpp b/impl/Operator.hpp index d6b92f2..3e11443 100644 --- a/impl/Operator.hpp +++ b/impl/Operator.hpp @@ -34,9 +34,9 @@ struct Maximum : public Operator { } }; template -struct Minimumm : public Operator { +struct Minimum : public Operator { virtual T operator() (const std::vector< Expression* >& args, const VariableAssignment& assignment) const { - T value = -infinity(); + T value = infinity(); for (typename std::vector< Expression* >::const_iterator it = args.begin(); it != args.end(); ++it) { @@ -47,6 +47,17 @@ struct Minimumm : public Operator { } }; +template +struct Constant : public Operator { + Constant(const T& val) + : _value(val) { } + T operator() (const std::vector< Expression* >& args, const VariableAssignment& ass) const { + return _value; + } + private: + const T _value; +}; + #include "VariableAssignment.hpp" #include "Expression.hpp" -- cgit v1.2.3