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