isl_tab_basic_map_partial_lexopt: add all equalities before pivoting
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 17 Nov 2010 15:03:15 +0000 (16:03 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 17 Nov 2010 16:07:15 +0000 (17:07 +0100)
During the construction of the initial tableau in tab_for_lexmin,
restore_lexmin would get called after the addition of each equality.
However, restore_lexmin performs some pivoting operations that could
invalidate the assumptions of last_var_col_or_int_par_col during
the addition of the next equality.
We therefore postpone the call to restore_lexmin until after
all equalities have been added.

Problem reported by Tobias Grosser <grosser@fim.uni-passau.de>

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_tab_pip.c
pip_test.sh
test_inputs/tobi.pip [new file with mode: 0644]

index 1cbc013..f677da0 100644 (file)
@@ -1223,8 +1223,6 @@ static struct isl_tab *add_lexmin_valid_eq(struct isl_tab *tab, isl_int *eq)
                if (isl_tab_kill_col(tab, i) < 0)
                        goto error;
                tab->n_eq++;
-
-               tab = restore_lexmin(tab);
        }
 
        return tab;
@@ -1991,6 +1989,8 @@ static struct isl_tab *tab_for_lexmin(struct isl_basic_map *bmap,
                if (!tab || tab->empty)
                        return tab;
        }
+       if (bmap->n_eq)
+               tab = restore_lexmin(tab);
        for (i = 0; i < bmap->n_ineq; ++i) {
                if (max)
                        isl_seq_neg(bmap->ineq[i] + 1 + tab->n_param,
index 2d97a35..caba3ef 100755 (executable)
@@ -13,7 +13,8 @@ PIP_TESTS="\
        small.pip \
        sor1d.pip \
        square.pip \
-       sven.pip"
+       sven.pip \
+       tobi.pip"
 
 for i in $PIP_TESTS; do
        echo $i;
diff --git a/test_inputs/tobi.pip b/test_inputs/tobi.pip
new file mode 100644 (file)
index 0000000..c31beae
--- /dev/null
@@ -0,0 +1,15 @@
+2 3
+1 1 -281
+1 -1 14000
+
+-1
+
+6 6
+0  -392     0     8    -1     0
+0   392     8     0     1     0
+1    -1     0     0     0     0
+1     1     0     0     0    35
+1   392     0     0     1     0
+1  -392     0     0    -1   280
+
+Urs_unknowns