MP_boolean.hpp

Go to the documentation of this file.
00001 // ******************** FlopCpp **********************************************
00002 // File: MP_boolean.hpp
00003 // $Id$
00004 // Author: Tim Helge Hultberg (thh@mat.ua.pt)
00005 // Copyright (C) 2003 Tim Helge Hultberg
00006 // All Rights Reserved.
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 #include "MP_constant.hpp"
00017 #include "MP_utilities.hpp"
00018 
00019 namespace flopc {
00020 
00026     class Boolean_base {
00027         friend class Handle<Boolean_base*>;
00028         friend class MP_boolean;
00029     public:
00030         virtual bool evaluate() const = 0;
00031     protected:
00032         Boolean_base() : count(0) {}
00033         virtual ~Boolean_base() {}
00034 
00035         int count;
00036     };
00037 
00038     class SUBSETREF;
00039 
00048     class MP_boolean : public Handle<Boolean_base*> {
00049         friend class MP_domain_base_;
00050     public:
00051         MP_boolean() : Handle<Boolean_base*>(0) {}
00052         MP_boolean(bool b);
00053         MP_boolean(const Constant& c); 
00054         MP_boolean(SUBSETREF& c); 
00055         MP_boolean(Boolean_base* r) : Handle<Boolean_base*>(r) {}
00056 
00057     };
00058 
00066     MP_boolean operator!(const MP_boolean& b);
00067 
00076     MP_boolean operator&&(const MP_boolean& e1, const MP_boolean& e2);
00085     MP_boolean operator||(const MP_boolean& e1, const MP_boolean& e2);
00086 
00095     MP_boolean alltrue(const MP_domain& d, const MP_boolean& b);
00096 
00114     MP_boolean operator<=(const MP_index_exp& e1, const MP_index_exp& e2);
00122     MP_boolean operator<=(const Constant& e1, const Constant& e2);
00132     MP_boolean operator<(const MP_index_exp& e1, const MP_index_exp& e2);
00140     MP_boolean operator<(const Constant& e1, const Constant& e2); 
00150     MP_boolean operator>=(const MP_index_exp& e1, const MP_index_exp& e2);
00158     MP_boolean operator>=(const Constant& e1, const Constant& e2);
00168     MP_boolean operator>(const MP_index_exp& e1, const MP_index_exp& e2);
00176     MP_boolean operator>(const Constant& e1, const Constant& e2);
00186     MP_boolean operator==(const MP_index_exp& e1, const MP_index_exp& e2);
00194     MP_boolean operator==(const Constant& e1, const Constant& e2);
00204     MP_boolean operator!=(const MP_index_exp& e1, const MP_index_exp& e2);
00212     MP_boolean operator!=(const Constant& e1, const Constant& e2);
00213 
00214 } // End of namespace flopc
00215 #endif

Generated on Fri Aug 26 03:02:58 2011 for FLOPC++ by  doxygen 1.4.7