Skip to content

Commit 3974030

Browse files
committed
<fix>[SBG Map]: debugged Map::minAdj
1 parent bb159af commit 3974030

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sbg/map.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,17 @@ Set Map::lessImage(const Map& other) const
171171

172172
Map Map::minAdj(const Map& other) const
173173
{
174-
Set result_domain = image(_domain.intersection(other._domain));
174+
Set this_other_dom = _domain.intersection(other._domain);
175+
if (this_other_dom.isEmpty()) {
176+
return Map{};
177+
}
175178

179+
Set result_domain = image(this_other_dom);
176180
Expression result_expr;
177-
Set image2 = other.image(result_domain);
178181
if (_law.isInjective()) {
179182
result_expr = other._law.composition(_law.inverse());
180183
} else {
184+
Set image2 = other.image(this_other_dom);
181185
result_expr = Expression{image2.minElem()};
182186
}
183187

0 commit comments

Comments
 (0)