00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _MP_boolean_hpp_
00010 #define _MP_boolean_hpp_
00011
00012 #include <vector>
00013 using std::vector;
00014
00015 #include "MP_index.hpp"
00016
00017 namespace flopc {
00018
00024 class Boolean_base {
00025 friend class Handle<Boolean_base*>;
00026 friend class MP_boolean;
00027 public:
00028 virtual bool evaluate() const = 0;
00029 protected:
00030 Boolean_base() : count(0) {}
00031 virtual ~Boolean_base() {}
00032
00033 int count;
00034 };
00035
00036 class SUBSETREF;
00037
00046 class MP_boolean : public Handle<Boolean_base*> {
00047 friend class MP_domain_base_;
00048 public:
00049 MP_boolean() : Handle<Boolean_base*>(0) {}
00050 MP_boolean(bool b);
00051 MP_boolean(const Constant& c);
00052 MP_boolean(SUBSETREF& c);
00053 MP_boolean(Boolean_base* r) : Handle<Boolean_base*>(r) {};
00054
00055 };
00056
00064 MP_boolean operator!(const MP_boolean& b);
00065
00074 MP_boolean operator&&(const MP_boolean& e1, const MP_boolean& e2);
00083 MP_boolean operator||(const MP_boolean& e1, const MP_boolean& e2);
00084
00093 MP_boolean alltrue(const MP_domain& d, const MP_boolean& b);
00094
00112 MP_boolean operator<=(const MP_index_exp& e1, const MP_index_exp& e2);
00120 MP_boolean operator<=(const Constant& e1, const Constant& e2);
00130 MP_boolean operator<(const MP_index_exp& e1, const MP_index_exp& e2);
00138 MP_boolean operator<(const Constant& e1, const Constant& e2);
00148 MP_boolean operator>=(const MP_index_exp& e1, const MP_index_exp& e2);
00156 MP_boolean operator>=(const Constant& e1, const Constant& e2);
00166 MP_boolean operator>(const MP_index_exp& e1, const MP_index_exp& e2);
00174 MP_boolean operator>(const Constant& e1, const Constant& e2);
00184 MP_boolean operator==(const MP_index_exp& e1, const MP_index_exp& e2);
00192 MP_boolean operator==(const Constant& e1, const Constant& e2);
00202 MP_boolean operator!=(const MP_index_exp& e1, const MP_index_exp& e2);
00210 MP_boolean operator!=(const Constant& e1, const Constant& e2);
00211
00212 }
00213 #endif