isl_tab: introduce parameters and divs
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Aug 2009 08:08:04 +0000 (10:08 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 7 Aug 2009 09:43:24 +0000 (11:43 +0200)
isl_tab.c
isl_tab.h

index 885c308..377d0b7 100644 (file)
--- a/isl_tab.c
+++ b/isl_tab.c
@@ -47,6 +47,8 @@ struct isl_tab *isl_tab_alloc(struct isl_ctx *ctx,
        tab->max_con = n_row;
        tab->n_col = n_var;
        tab->n_var = n_var;
+       tab->n_param = 0;
+       tab->n_div = 0;
        tab->n_dead = 0;
        tab->n_redundant = 0;
        tab->need_undo = 0;
@@ -164,6 +166,8 @@ struct isl_tab *isl_tab_dup(struct isl_tab *tab)
        dup->max_con = tab->max_con;
        dup->n_col = tab->n_col;
        dup->n_var = tab->n_var;
+       dup->n_param = tab->n_param;
+       dup->n_div = tab->n_div;
        dup->n_dead = tab->n_dead;
        dup->n_redundant = tab->n_redundant;
        dup->rational = tab->rational;
@@ -2000,7 +2004,9 @@ void isl_tab_dump(struct isl_tab *tab, FILE *out, int indent)
        fprintf(out, "%*s[", indent, "");
        for (i = 0; i < tab->n_var; ++i) {
                if (i)
-                       fprintf(out, ", ");
+                       fprintf(out, (i == tab->n_param ||
+                                     i == tab->n_var - tab->n_div) ? "; "
+                                                                   : ", ");
                fprintf(out, "%c%d%s", tab->var[i].is_row ? 'r' : 'c',
                                        tab->var[i].index,
                                        tab->var[i].is_zero ? " [=0]" :
index df1b455..a74d590 100644 (file)
--- a/isl_tab.h
+++ b/isl_tab.h
@@ -68,6 +68,11 @@ struct isl_tab_undo {
  * since the constraint has been reduced to 0 = 0 and is therefore always
  * satisfied.
  *
+ * There are "n_var" variables in total.  The first "n_param" of these
+ * are called parameters and the last "n_div" of these are called divs.
+ * The basic tableau operations makes no distinction between different
+ * kinds of variables.
+ *
  * Dead columns and redundant rows are detected on the fly.
  * However, the basic operations do not ensure that all dead columns
  * or all redundant rows are detected.
@@ -83,6 +88,8 @@ struct isl_tab {
        unsigned n_redundant;
 
        unsigned n_var;
+       unsigned n_param;
+       unsigned n_div;
        unsigned n_con;
        unsigned n_eq;
        unsigned max_con;