@@ -76,57 +76,27 @@ SetPiece image(SetPiece mdi, Exp mdle)
7676}
7777
7878
79- std::pair<MD_NAT , MD_NAT > calcularMinMaxPer (const Set dom) {
80- MD_NAT maximo (dom.arity (), 0 );
81- MD_NAT minimo (dom.arity (), Inf);
82-
83- for (const SetPiece &mdi : dom) {
84- MD_NAT candidatoMax = mdi.maxElem ();
85- MD_NAT candidatoMin = mdi.minElem ();
86-
87- for (std::size_t i = 0 ; i < maximo.arity (); ++i) {
88- maximo[i] = std::max (maximo[i], candidatoMax[i]);
89- minimo[i] = std::min (minimo[i], candidatoMin[i]);
90- }
91- }
92-
93- return { minimo, maximo };
94- }
95-
9679
9780// //////////////////////////////////////////////////////////////////////////////
9881// Map Implementation ----------------------------------------------------------
9982// //////////////////////////////////////////////////////////////////////////////
10083
10184member_move_imp (Map, Set, dom);
10285member_move_imp (Map, Exp, exp);
103- member_move_imp (Map, MD_NAT , minPer);
104- member_move_imp (Map, MD_NAT , maxPer);
86+
10587
10688
10789
10890Map::~Map () {}
109- Map::Map (const SetAF &fact) : fact_(fact), dom_(fact.createSet()) {}
91+ Map::Map (const SetAF &fact) : fact_(fact), dom_(fact.createSet()){}
11092Map::Map (const SetAF &fact, MD_NAT x, Exp exp)
111- : fact_(fact), dom_(fact.createSet(x)), exp_(exp), minPer_(), maxPer_()
112- {
113- std::tie (minPer_, maxPer_) = calcularMinMaxPer (dom_);
114- }
93+ : fact_(fact), dom_(fact.createSet(x)), exp_(exp){}
11594Map::Map (const SetAF &fact, Interval i, LExp le)
116- : fact_(fact), dom_(fact.createSet(i)), exp_(Exp(le)), minPer_(), maxPer_()
117- {
118- std::tie (minPer_, maxPer_) = calcularMinMaxPer (dom_);
119- }
95+ : fact_(fact), dom_(fact.createSet(i)), exp_(Exp(le)){}
12096Map::Map (const SetAF &fact, SetPiece mdi, Exp exp)
121- : fact_(fact), dom_(fact.createSet(mdi)), exp_(exp), minPer_(), maxPer_()
122- {
123- std::tie (minPer_, maxPer_) = calcularMinMaxPer (dom_);
124- }
97+ : fact_(fact), dom_(fact.createSet(mdi)), exp_(exp){}
12598Map::Map (const SetAF &fact, Set s, Exp exp)
126- : fact_(fact), dom_(std::move(s)), exp_(exp), minPer_(), maxPer_()
127- {
128- std::tie (minPer_, maxPer_) = calcularMinMaxPer (dom_);
129- }
99+ : fact_(fact), dom_(std::move(s)), exp_(exp){}
130100
131101bool Map::operator ==(const Map &other) const
132102{
@@ -150,28 +120,24 @@ Map &Map::operator=(const Map &other)
150120{
151121 dom_ = other.dom_ ;
152122 exp_ = other.exp_ ;
153- minPer_ = other.minPer_ ;
154- maxPer_ = other.maxPer_ ;
155123
156124 return *this ;
157125}
158126
159127bool Map::operator <(const Map &other) const
160128{
161129
162- return minPer_ < other.minPer_ ;
130+ return minPer () < other.minPer () ;
163131}
164132
165- /*
166- MD_NAT Map::minPerimeter() const
133+
134+
135+ MD_NAT Map::minPer () const
167136{
168137 MD_NAT minimo (dom_.arity (), Inf);
169-
170138
171-
172139 if (dom_.isEmpty ())
173140 return minimo;
174-
175141
176142 for (const SetPiece &mdi : dom_) {
177143 MD_NAT candidato = mdi.minElem ();
@@ -180,16 +146,17 @@ MD_NAT Map::minPerimeter() const
180146 minimo[i] = std::min (minimo[i], candidato[i]);
181147 }
182148 }
183-
149+
184150 return minimo;
185151}
186152
187- MD_NAT Map::maxPerimeter () const
153+ MD_NAT Map::maxPer () const
188154{
189155 MD_NAT maximo (dom_.arity (), 0 );
190156
191157 if (dom_.isEmpty ())
192158 return maximo;
159+
193160
194161 for (const SetPiece &mdi : dom_) {
195162 MD_NAT candidato = mdi.maxElem ();
@@ -198,10 +165,10 @@ MD_NAT Map::maxPerimeter() const
198165 maximo[i] = std::max (maximo[i], candidato[i]);
199166 }
200167 }
201-
168+
202169 return maximo;
203170}
204- */
171+
205172
206173Map Map::operator +(const Map &other) const
207174{
@@ -333,6 +300,25 @@ MaybeMap Map::compact(const Map &other) const
333300 return {};
334301}
335302
303+ /*
304+ void Map::calcularMinMaxPer() {
305+ MD_NAT maximo(dom_.arity(), 0);
306+ MD_NAT minimo(dom_.arity(), Inf);
307+
308+ for (const SetPiece &mdi : dom_) {
309+ MD_NAT candidatoMax = mdi.maxElem();
310+ MD_NAT candidatoMin = mdi.minElem();
311+
312+ for (std::size_t i = 0; i < maximo.arity(); ++i) {
313+ maximo[i] = std::max(maximo[i], candidatoMax[i]);
314+ minimo[i] = std::min(minimo[i], candidatoMin[i]);
315+ }
316+ }
317+
318+ minPer_ = minimo;
319+ maxPer_ = maximo;
320+ }*/
321+
336322} // namespace LIB
337323
338324} // namespace SBG
0 commit comments