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 <vector>
13 using std::vector;
14 
15 #include "MP_index.hpp"
16 
17 namespace flopc {
18  class SUBSETREF;
19 
21  class Boolean_base {
22  friend class Handle<Boolean_base*>;
23  friend class MP_boolean;
24  public:
25  virtual bool evaluate() const = 0;
26  protected:
27  Boolean_base() : count(0) {}
28  virtual ~Boolean_base() {}
29  int count;
30  };
31 
40  class MP_boolean : public Handle<Boolean_base*> {
41  public:
43  MP_boolean(bool b);
44  MP_boolean(const Constant& c);
45  MP_boolean(SUBSETREF& c);
47  };
48 
50 
59 
68  MP_boolean operator&&(const MP_boolean& e1, const MP_boolean& e2);
69 
78  MP_boolean operator||(const MP_boolean& e1, const MP_boolean& e2);
79 
80 // /** @brief boolean which returns true if all in domain evaluate to true.
81 // @ingroup PublicInterface
82 // This is used in the normal formation of an expression.
83 // @param d MP_domain to evaluate with
84 // @param b boolean expression to evaluate.
85 // @returns A boolean which evaluates to true all domain evaluations of the boolean
86 // evaluate to true.
87 // */
88 // MP_boolean alltrue(const MP_domain& d, const MP_boolean& b);
89 
107  MP_boolean operator<=(const MP_index_exp& e1, const MP_index_exp& e2);
108 
116  MP_boolean operator<=(const Constant& e1, const Constant& e2);
117 
127  MP_boolean operator<(const MP_index_exp& e1, const MP_index_exp& e2);
128 
136  MP_boolean operator<(const Constant& e1, const Constant& e2);
137 
147  MP_boolean operator>=(const MP_index_exp& e1, const MP_index_exp& e2);
148 
156  MP_boolean operator>=(const Constant& e1, const Constant& e2);
157 
167  MP_boolean operator>(const MP_index_exp& e1, const MP_index_exp& e2);
168 
176  MP_boolean operator>(const Constant& e1, const Constant& e2);
177 
187  MP_boolean operator==(const MP_index_exp& e1, const MP_index_exp& e2);
188 
196  MP_boolean operator==(const Constant& e1, const Constant& e2);
197 
207  MP_boolean operator!=(const MP_index_exp& e1, const MP_index_exp& e2);
208 
216  MP_boolean operator!=(const Constant& e1, const Constant& e2);
217 
218 } // End of namespace flopc
219 #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:169
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:202
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:187
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:166
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:172
MP_boolean operator<=(const MP_index_exp &e1, const MP_index_exp &e2)
boolean which returns true if all in domain evaluate to true.This is used in the normal formation of ...
Definition: MP_boolean.cpp:175
Internal representation of a "set".
Definition: MP_set.hpp:269
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:193
Utility for doing reference counted pointers.
virtual ~Boolean_base()
Definition: MP_boolean.hpp:28
Representation of an expression involving an index.This is one of the main public interface classes...
Definition: MP_index.hpp:141
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:181
All flopc++ code is contained within the flopc namespace.
Definition: flopc.cpp:11
Reference counted class for all "boolean" types of data.This contains counters to ConstantBase pointe...
Definition: MP_boolean.hpp:40
MP_boolean(Boolean_base *r)
Definition: MP_boolean.hpp:46
Reference counted class for all "constant" types of data.
Definition: MP_constant.hpp:49
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:199
virtual bool evaluate() const =0
friend class MP_boolean
Definition: MP_boolean.hpp:23