Skip to content

Commit 6f1855b

Browse files
committed
Debugged OrdPWMap
1 parent 1a6a7c1 commit 6f1855b

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

sbg/ord_pwmap.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ CoreOperation OrdPWMap::traverse(const OrdPWMap& other, CoreOperation core_op)
164164
{
165165
OrdMapCollection short_pw = _pieces;
166166
OrdMapCollection long_pw = other._pieces;
167-
if (other._pieces.size() < _pieces.size()) {
167+
if (!core_op.orderMatters() && other._pieces.size() < _pieces.size()) {
168168
short_pw = other._pieces;
169169
long_pw = _pieces;
170170
}
@@ -247,6 +247,8 @@ class EqualCore {
247247
return true;
248248
}
249249

250+
bool orderMatters() const { return false; }
251+
250252
bool result() const { return _are_equal; }
251253

252254
private:
@@ -280,6 +282,8 @@ class AddCore {
280282
return true;
281283
}
282284

285+
bool orderMatters() const { return false; }
286+
283287
OrdPWMap result() const { return _result; }
284288

285289
private:
@@ -586,7 +590,7 @@ OrdPWMap OrdPWMap::reduce() const
586590
for (const MapEntry& entry : _pieces) {
587591
std::vector<Map> reduced = entry.map().reduce();
588592
for(Map& reduced_map : reduced) {
589-
result.pushBack(std::move(reduced_map));
593+
result.insert(std::move(reduced_map));
590594
}
591595
}
592596

@@ -628,6 +632,8 @@ class MinAdjCore {
628632
return true;
629633
}
630634

635+
bool orderMatters() const { return true; }
636+
631637
OrdPWMap result() const { return _result; }
632638

633639
private:
@@ -678,6 +684,8 @@ class EqualImageCore {
678684
return true;
679685
}
680686

687+
bool orderMatters() const { return false; }
688+
681689
Set result() const { return _result; }
682690

683691
private:
@@ -706,6 +714,8 @@ class LessImageCore {
706714
return true;
707715
}
708716

717+
bool orderMatters() const { return true; }
718+
709719
Set result() const { return _result; }
710720

711721
private:
@@ -719,7 +729,7 @@ Set OrdPWMap::lessImage(const OrdPWMap& other) const
719729
}
720730

721731
if (_pieces == other._pieces) {
722-
return domain();
732+
return SET_FACT.createSet();
723733
}
724734

725735
return traverse(other, LessImageCore{}).result();

0 commit comments

Comments
 (0)