10 #define _MP_index_hpp_
180 return left->evaluate()*int(
right->evaluate());
183 return left->getIndex();
203 return left->evaluate()+int(
right->evaluate());
206 return left->getIndex();
226 return left->evaluate()-int(
right->evaluate());
229 return left->getIndex();
virtual MP_domain getDomain(MP_set *s) const
Representation of an index.
MP_index_sum(MP_index &i, const Constant &j)
Constant operator*(const Constant &a, const Constant &b)
Returns the product of two constants.
void assign(int i)
Setter for the index.
MP_index * getIndex() const
static MP_index & getEmpty()
returns a reference to the distinct "empty" index.
MP_index()
Default constructor.
MP_index * getIndex() const
Internal representation of an index expression.
static const MP_index_exp & getEmpty()
Return the unique empty expression.
Internal representation of an index expression.
MP_index * getIndex() const
getter for MP_index * data type.
Utility for doing reference counted pointers.
void unInstantiate()
unsetter for instatiated.
virtual int evaluate() const =0
Internal representation of an index expression.
Internal representation of a index.
friend MP_index_exp operator*(MP_index &i, const Constant &j)
returns an index expression from a product between an MP_index and a Constant.
Representation of a set for indexing into some other construct.
Representation of an expression involving an index.
static MP_index_exp Empty
bool isInstantiated() const
interrogate state of instatiation of data.
virtual void display() const
virtual MP_index * getIndex() const =0
MP_index_dif(MP_index &i, const Constant &j)
MP_index_mult(MP_index &i, const Constant &j)
Reference counted class for all "constant" types of data.
MP_index * getIndex() const
Constant operator+(const Constant &a, const Constant &b)
Returns the sum of two constants.
friend MP_index_exp operator-(MP_index &i, const Constant &j)
virtual MP_domain getDomain(MP_set *s) const
Getter for domain over which this index is applied.
virtual MP_domain getDomain(MP_set *s) const =0
Range over which some other constuct is defined.
virtual MP_domain getDomain(MP_set *s) const
Internal representation of a "set".
MP_index_exp(MP_index_base *r)
For internal use.
void instantiate()
setter for instatiated.
virtual MP_domain getDomain(MP_set *s) const
friend MP_index_exp operator+(MP_index &i, const Constant &j)
returns an index expression from a sum between an MP_index and a Constant.
Constant operator-(const Constant &a, const Constant &b)
Returns the difference of two constants.