Go to the documentation of this file.
8 #ifndef _MP_domain_hpp_
9 #define _MP_domain_hpp_
44 virtual size_t size()
const ;
95 std::vector<MP_boolean> condition;
146 std::vector<int> elm(nbr);
147 for (
int i=0; i<nbr; i++) {
148 elm[i] = D->I[i]->evaluate();
166 template<
int nbr>
class MP_domain_subset :
public MP_domain_base {
170 const std::vector<MP_index*> &i) : S(s), I(i){}
176 return S->evaluate(I);
195 bool allBound =
true;
196 for (
int j=0; j<nbr; j++) {
197 if (I[j]->isInstantiated() ==
true) {
207 if (allBound ==
true) {
210 std::map<std::vector<int>,
int>::const_iterator i;
212 for (i = S->elements.begin(); i != S->elements.end(); i++) {
216 for (
int j=0; j<nbr; j++) {
217 if (isBound[j] ==
true) {
218 if (I[j]->
evaluate() != i->first[j]) {
223 I[j]->assign(i->first[j]);
231 for (
int j=0; j<nbr; j++) {
232 if (isBound[j] ==
false) {
234 I[j]->unInstantiate();
246 std::vector<MP_index*> I;
252 MP_domain
operator*(
const MP_domain& a,
const MP_domain& b);
Internal representation of a "set".
friend MP_domain operator*(const MP_domain &a, const MP_domain &b)
operator which creates a new domain as the pairwise combinations of two input domains.
Constant operator*(const Constant &a, const Constant &b)
Returns the product of two constants.
virtual Functor * makeInsertFunctor() const
Range over which some other constuct is defined.
friend MP_domain operator*(const MP_domain &a, const MP_domain &b)
operator which creates a new domain as the pairwise combinations of two input domains.
Range over which some other constuct is defined.
MP_index * getIndex() const
Getter for the index used in construction.
virtual MP_index * getIndex() const =0
MP_domain getDomain(MP_set *s) const
Functor * makeInsertFunctor() const
Utility for doing reference counted pointers.
Internal representation of a "set".
int evaluate() const
Evaluates the index within the domain.
MP_set_base * getSet() const
getter for obtaining the set used in construction
Reference counted class for all "boolean" types of data.
MP_domain getDomain(MP_set *s) const
Internal representation of a index.
Reference to a set of index values.
MP_index * getIndex() const
getter for obtaining the index used in construction
virtual const MP_set_base * getSet() const =0
static const MP_domain & getEmpty()
returns a reference to the "empty" set.
MP_domain()
@briefConstructs a set which points to nothing.
const MP_set_base * getSet() const
Getter for the set used in construction.
size_t size() const
returns number of elements in the domain.
Range over which some other constuct is defined.
Inserter for construction of a subset.
void Forall(const Functor *op) const
Special conditional operation on the domain.
All flopc++ code is contained within the flopc namespace.
MP_domain_set(const MP_set *s, MP_index *i)
Constructor taking a set pointer and an index pointer.
Representation of a set for indexing into some other construct.
Representation of an expression involving an index.
friend class insertFunctor< nbr >
Representation of an index.
virtual ~MP_domain_base()
Semantic representation of a linear constraint.
int evaluate() const
Evaluates the index within the domain.
static MP_index & getEmpty()
returns a reference to the distinct "empty" index.
virtual size_t size() const
insertFunctor(MP_domain_subset< nbr > *d)
MP_domain such_that(const MP_boolean &b)
Special conditional creation of a subset.