FlopCpp  trunk
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);
53 
54  };
55 
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 
119  MP_boolean operator<=(const Constant& e1, const Constant& e2);
137  MP_boolean operator<(const Constant& e1, const Constant& e2);
155  MP_boolean operator>=(const Constant& e1, const Constant& e2);
173  MP_boolean operator>(const Constant& e1, const Constant& e2);
191  MP_boolean operator==(const Constant& e1, const Constant& e2);
209  MP_boolean operator!=(const Constant& e1, const Constant& e2);
210 
211 } // End of namespace flopc
212 #endif
flopc::Boolean_base::~Boolean_base
virtual ~Boolean_base()
Definition: MP_boolean.hpp:30
flopc::operator||
MP_boolean operator||(const MP_boolean &e1, const MP_boolean &e2)
For computing the logical OR of two booleans.
flopc::Constant
Reference counted class for all "constant" types of data.
Definition: MP_constant.hpp:48
flopc::MP_domain
Range over which some other constuct is defined.
Definition: MP_domain.hpp:61
MP_utilities.hpp
MP_index.hpp
flopc::operator!=
MP_boolean operator!=(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloading
flopc::MP_boolean::MP_boolean
MP_boolean(SUBSETREF &c)
flopc::Handle
Utility for doing reference counted pointers.
Definition: MP_utilities.hpp:105
flopc::Boolean_base
Base class for all "boolean" types of data.
Definition: MP_boolean.hpp:23
flopc::MP_boolean
Reference counted class for all "boolean" types of data.
Definition: MP_boolean.hpp:45
flopc::operator&&
MP_boolean operator&&(const MP_boolean &e1, const MP_boolean &e2)
For computing the logical AND of two booleans.
flopc::MP_boolean::MP_boolean
MP_boolean(const Constant &c)
flopc::operator<
MP_boolean operator<(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloading
flopc::operator==
MP_boolean operator==(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloading
flopc::Boolean_base::evaluate
virtual bool evaluate() const =0
flopc::Boolean_base::Boolean_base
Boolean_base()
Definition: MP_boolean.hpp:29
flopc::operator>=
MP_boolean operator>=(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloading
flopc::operator!
MP_boolean operator!(const MP_boolean &b)
For computing the logical negation of a boolean.
flopc::MP_boolean::MP_domain_base_
friend class MP_domain_base_
Definition: MP_boolean.hpp:46
flopc::alltrue
MP_boolean alltrue(const MP_domain &d, const MP_boolean &b)
boolean which returns true if all in domain evaluate to true.
flopc::MP_boolean::MP_boolean
MP_boolean(bool b)
flopc::Boolean_base::count
int count
Definition: MP_boolean.hpp:32
flopc::operator>
MP_boolean operator>(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloading
flopc
All flopc++ code is contained within the flopc namespace.
Definition: flopc.hpp:49
flopc::operator<=
MP_boolean operator<=(const MP_index_exp &e1, const MP_index_exp &e2)
constructs a boolean evaluator using operator overloading
flopc::MP_boolean::MP_boolean
MP_boolean(Boolean_base *r)
Definition: MP_boolean.hpp:52
flopc::MP_index_exp
Representation of an expression involving an index.
Definition: MP_index.hpp:145
flopc::MP_boolean::MP_boolean
MP_boolean()
Definition: MP_boolean.hpp:48
MP_constant.hpp
flopc::SUBSETREF
Internal representation of a "set".
Definition: MP_set.hpp:273