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