isl_printer_print_basic_set: also print invalid basic sets
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 13 Apr 2011 08:37:46 +0000 (10:37 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 21 Apr 2011 11:13:11 +0000 (13:13 +0200)
In particular, zero equality rows should not appear in a finalized
basic set, but they may appear during the construction of a basic set.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_output.c

index ffdb3e2..d62d4a4 100644 (file)
@@ -474,7 +474,12 @@ static __isl_give isl_printer *print_constraints(__isl_keep isl_basic_map *bmap,
 
        for (i = bmap->n_eq - 1; i >= 0; --i) {
                int l = isl_seq_last_non_zero(bmap->eq[i], 1 + total);
-               isl_assert(bmap->ctx, l >= 0, goto error);
+               if (l < 0) {
+                       if (i != bmap->n_eq - 1)
+                               p = isl_printer_print_str(p, s_and[latex]);
+                       p = isl_printer_print_str(p, "0 = 0");
+                       continue;
+               }
                if (isl_int_is_neg(bmap->eq[i][l]))
                        isl_seq_cpy(c->el, bmap->eq[i], 1 + total);
                else