FLOPC++
MP_boolean.hpp
Go to the documentation of this file.
1 // ******************** FlopCpp **********************************************
2 // File: MP_boolean.hpp
3 // $Id$
4 // Author: Tim Helge Hultberg (thh@mat.ua.pt)
5 // Copyright (C) 2003 Tim Helge Hultberg
6 // All Rights Reserved.
7 // ****************************************************************************
8 
9 #ifndef _MP_boolean_hpp_
10 #define _MP_boolean_hpp_
11 
12 #include "MP_index.hpp"
13 #include "MP_constant.hpp"
14 #include "MP_utilities.hpp"
15 
16 namespace flopc {
17 
23  class Boolean_base {
24  friend class Handle<Boolean_base*>;
25  friend class MP_boolean;
26  public:
27  virtual bool evaluate() const = 0;
28  protected:
29  Boolean_base() : count(0) {}
30  virtual ~Boolean_base() {}
31 
32  int count;
33  };
34 
35  class SUBSETREF;
36 
45  class MP_boolean : public Handle<Boolean_base*> {
46  friend class MP_domain_base_;
47  public:
49  MP_boolean(bool b);
50  MP_boolean(const Constant& c);
51  MP_boolean(SUBSETREF& c);
53 
54  };
55 
63  MP_boolean operator!(const MP_boolean& b);
64 
73  MP_boolean operator&&(const MP_boolean& e1, const MP_boolean& e2);
82  MP_boolean operator||(const MP_boolean& e1, const MP_boolean& e2);
83 
92  MP_boolean alltrue(const MP_domain& d, const MP_boolean& b);
93 
111  MP_boolean operator<=(const MP_index_exp& e1, const MP_index_exp& e2);
119  MP_boolean operator<=(const Constant& e1, const Constant& e2);
129  MP_boolean operator<(const MP_index_exp& e1, const MP_index_exp& e2);
137  MP_boolean operator<(const Constant& e1, const Constant& e2);
147  MP_boolean operator>=(const MP_index_exp& e1, const MP_index_exp& e2);
155  MP_boolean operator>=(const Constant& e1, const Constant& e2);
165  MP_boolean operator>(const MP_index_exp& e1, const MP_index_exp& e2);
173  MP_boolean operator>(const Constant& e1, const Constant& e2);
183  MP_boolean operator==(const MP_index_exp& e1, const MP_index_exp& e2);
191  MP_boolean operator==(const Constant& e1, const Constant& e2);
201  MP_boolean operator!=(const MP_index_exp& e1, const MP_index_exp& e2);
209  MP_boolean operator!=(const Constant& e1, const Constant& e2);
210 
211 } // End of namespace flopc
212 #endif
MP_boolean operator&&(const MP_boolean &e1, const MP_boolean &e2)
For computing the logical AND of two booleansThis is used in the normal formation of an expression...
Definition: MP_boolean.cpp:159
MP_boolean operator!=(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an e...
Definition: MP_boolean.cpp:192
MP_boolean operator>=(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an e...
Definition: MP_boolean.cpp:177
MP_boolean operator!(const MP_boolean &b)
For computing the logical negation of a booleanThis is used in the normal formation of an expression...
Definition: MP_boolean.cpp:156
Base class for all &quot;boolean&quot; types of data.
Definition: MP_boolean.hpp:23
MP_boolean operator||(const MP_boolean &e1, const MP_boolean &e2)
For computing the logical OR of two booleansThis is used in the normal formation of an expression...
Definition: MP_boolean.cpp:162
MP_boolean operator<=(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an e...
Definition: MP_boolean.cpp:165
Internal representation of a &quot;set&quot;.
Definition: MP_set.hpp:273
MP_boolean operator>(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an e...
Definition: MP_boolean.cpp:183
Utility for doing reference counted pointers.
virtual ~Boolean_base()
Definition: MP_boolean.hpp:30
friend class MP_domain_base_
Definition: MP_boolean.hpp:46
MP_boolean operator<(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an e...
Definition: MP_boolean.cpp:171
Reference counted class for all &quot;boolean&quot; types of data.This contains counters to ConstantBase pointe...
Definition: MP_boolean.hpp:45
MP_boolean(Boolean_base *r)
Definition: MP_boolean.hpp:52
Reference counted class for all &quot;constant&quot; types of data.
Definition: MP_constant.hpp:48
MP_boolean alltrue(const MP_domain &d, const MP_boolean &b)
boolean which returns true if all in domain evaluate to true.This is used in the normal formation of ...
Definition: MP_boolean.cpp:152
MP_boolean operator==(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an e...
Definition: MP_boolean.cpp:189
virtual bool evaluate() const =0