34 virtual int size()
const = 0;
39 if ((i>=0) && (i<
size())) {
50 if ((i>=0) && (i<
size())) {
88 return i->getDomain(const_cast<MP_set*>(
this));
128 template <
int nbr>
class MP_subset;
140 vector<int> elm(nbr);
141 for (
int i=0; i<nbr; i++) {
142 elm[i] =
I[i]->evaluate();
148 vector<MP_index_exp>
I;
171 S = makeVector<nbr,const MP_set*>(&s1,&s2,&s3,&s4,&s5);
174 void display(
const std::string& s =
"")
const {
175 std::map<std::vector<int>,
int>::const_iterator i;
178 for (
int j=0; j<nbr; j++) {
179 cout<<(*i).first[j]<<
" ";
189 int operator()(
int i1,
int i2=0,
int i3=0,
int i4=0,
int i5=0) {
190 std::map<vector<int>,
int>::const_iterator
pos;
191 pos =
elements.find(makeVector<nbr>(i1, i2, i3, i4, i5));
213 for (
int k=0; k<nbr; k++) {
214 int temp = I[k]->evaluate();
217 std::map<vector<int>,
int>::const_iterator
pos;
228 for (
int i=0; i<nbr; i++) {
234 std::map<vector<int>,
int>::const_iterator
pos;
242 void insert(
int i1,
int i2=0,
int i3=0,
int i4=0,
int i5=0) {
243 insert(makeVector<nbr>(i1, i2, i3, i4, i5));
257 vector<const MP_set*>
S;
290 class SubsetRef :
public SUBSETREF {
309 makeVector<nbr>(
I1->getIndex(),
I2->getIndex(),
310 I3->getIndex(),
I4->getIndex(),
316 makeVector<nbr>(
I1->getIndex(),
I2->getIndex(),
317 I3->getIndex(),
I4->getIndex(),
331 vector<MP_index_exp> I = makeVector<nbr>(
I1,
I2,
I3,
I4,
I5);
333 for (
int k=0; k<nbr; k++) {
334 int temp = I[k]->evaluate();
337 std::map<vector<int>,
int>::const_iterator
pos;
338 pos =
S->elements.find(vi);
339 if (pos==
S->elements.end()) {
SubsetRef(MP_subset< nbr > *s, const MP_index_exp &i1, const MP_index_exp &i2, const MP_index_exp &i3, const MP_index_exp &i4, const MP_index_exp &i5)
int checkStage(int i) const
MP_index * getIndex() const
static MP_set & getEmpty()
gets the distinct 'empty' MP_set.
MP_domain such_that(const MP_boolean &b)
Special conditional creation of a subset.
Internal representation of a "set".
MP_domain operator()(const MP_index_exp &i) const
Constructs an MP_domain on the stack given an index expression into the set.
int evaluate(const vector< MP_index * > &I) const
static MP_index & getEmpty()
returns a reference to the distinct "empty" index.
friend class MP_domain_set
MP_subset(vector< const MP_set * > s)
Representation of an index.This is one of the main public interface classes. It is used to iterate th...
Internal representation of a "set".
virtual MP_domain operator()(const MP_index_exp &i) const =0
virtual MP_index * getIndex() const
MP_domain & operator()(const SUBSETREF &s)
MP_domain such_that(const MP_boolean &b)
constructs a domain by subsetting this MP_set where the MP_boolean evaluates to 'true' ...
virtual int size() const
getter for the cardinality of this MP_set.
Utility interface class for adding a string name onto a structure.
Representation of an expression involving an index.This is one of the main public interface classes...
static const MP_index_exp & getEmpty()
Return the unique empty expression.
const int outOfBound
Distinct return value on conditions where an index goes out of bounds.
virtual MP_domain getDomain(MP_set *s) const
Range over which some other constuct is defined. Uses subsetting.This is one of the main public inter...
InsertFunctor(MP_subset< nbr > *s, vector< MP_index_exp > i)
SubsetRef< nbr > & operator()(const MP_index_exp &i1, const MP_index_exp &i2=MP_index::getEmpty(), const MP_index_exp &i3=MP_index::getEmpty(), const MP_index_exp &i4=MP_index::getEmpty(), const MP_index_exp &i5=MP_index::getEmpty())
All flopc++ code is contained within the flopc namespace.
virtual MP_domain getDomain(MP_set *s) const
void display(const std::string &s="") const
Reference counted class for all "boolean" types of data.This contains counters to ConstantBase pointe...
virtual int isStage() const
virtual int size() const =0
int operator()(int i1, int i2=0, int i3=0, int i4=0, int i5=0)
Range over which some other constuct is defined.This is one of the main public interface classes...
void insert(const vector< int > &args)
MP_subset(const MP_set &s1, const MP_set &s2=MP_set::getEmpty(), const MP_set &s3=MP_set::getEmpty(), const MP_set &s4=MP_set::getEmpty(), const MP_set &s5=MP_set::getEmpty())
static const MP_domain & getEmpty()
returns a reference to the "empty" set.
virtual int size() const
getter for the cardinality of this MP_set.
Function object. Often used.
Constant pos(const Constant &c)
for returning non-negative value of the constant.This is used in the formation of an expression...
Representation of a set for indexing into some other construct.This is one of the main public interfa...
SubsetRef & such_that(const MP_boolean &b)
Internal representation of a "set".
const InsertFunctor< nbr > & insert(MP_index_exp i1, MP_index_exp i2=MP_index_exp::getEmpty(), MP_index_exp i3=MP_index_exp::getEmpty(), MP_index_exp i4=MP_index_exp::getEmpty(), MP_index_exp i5=MP_index_exp::getEmpty())
vector< const MP_set * > S
Internal representation of a "set".
Internal representation of a index.
int mod(int a, int b)
return the strictly positive modulus of two integers
MP_set(int i=0)
constructs a set with specific cardinality.
virtual int isStage() const
std::map< std::vector< int >, int > elements
Internal representation of a "set".
void insert(int i1, int i2=0, int i3=0, int i4=0, int i5=0)