Skip to content

Commit

Permalink
Debugged map operations
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalashnikovni committed May 16, 2024
1 parent 7e1c699 commit 8a3d510
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions sbg/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ namespace LIB {

void compatible(Interval i, LExp le)
{
if (i.begin() == i.end())
return;

Util::RATIONAL rat_inf(Util::INT_Inf, 1);
if (le.slope() == rat_inf || le.slope() > rat_inf)
return;
Expand Down Expand Up @@ -70,6 +73,11 @@ Interval image(Interval i, LExp le) {
if (m == rat_inf || m > rat_inf)
return Interval(0, 1, Util::Inf);

if (i.begin() == i.end()) {
Util::NAT x = (m * i.begin() + h).toNat();
return Interval(x, 1, x);
}

// Increasing expression
if (m > 0) {
new_begin = (m * i.minElem() + h).toNat();
Expand Down
3 changes: 2 additions & 1 deletion sbg/pw_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
******************************************************************************/

#include "sbg/pw_map.hpp"
#include <iostream>

namespace SBG {

Expand Down Expand Up @@ -713,7 +714,7 @@ PWMap<Set> PWMap<Set>::minAdjMap(
Set again = dom_res.intersection(visited);
if (!again.isEmpty()) {
PWMap r_res = res.restrict(again), r_map = ith_pw.restrict(again);
res = res.minMap(ith_pw).combine(res);
res = other3.minMap(res, ith_pw, other3).combine(res);
res = res.combine(ith_pw);
}
else
Expand Down

0 comments on commit 8a3d510

Please sign in to comment.