return tab->con[r].index;
}
+#define CUT_ALL 1
+#define CUT_ONE 0
+
/* Given a non-parametric tableau, add cuts until an integer
* sample point is obtained or until the tableau is determined
* to be integer infeasible.
* combination of variables/constraints plus a non-integral constant,
* then there is no way to obtain an integer point and we return
* a tableau that is marked empty.
+ * The parameter cutting_strategy controls the strategy used when adding cuts
+ * to remove non-integer points. CUT_ALL adds all possible cuts
+ * before continuing the search. CUT_ONE adds only one cut at a time.
*/
-static struct isl_tab *cut_to_integer_lexmin(struct isl_tab *tab)
+static struct isl_tab *cut_to_integer_lexmin(struct isl_tab *tab,
+ int cutting_strategy)
{
int var;
int row;
row = add_cut(tab, row);
if (row < 0)
goto error;
+ if (cutting_strategy == CUT_ONE)
+ break;
} while ((var = next_non_integer_var(tab, var, &flags)) != -1);
if (restore_lexmin(tab) < 0)
goto error;
if (isl_tab_push_basis(tab) < 0)
goto error;
- tab = cut_to_integer_lexmin(tab);
+ tab = cut_to_integer_lexmin(tab, CUT_ALL);
if (!tab)
goto error;
int side, base;
if (init) {
- tab = cut_to_integer_lexmin(tab);
+ tab = cut_to_integer_lexmin(tab, CUT_ONE);
if (!tab)
goto error;
if (tab->empty)
return -1;
ctx->opt->schedule_outer_zero_distance = 0;
+ D = "{Stmt_for_body24[i0, i1, i2, i3]:"
+ "i0 >= 0 and i0 <= 1 and i1 >= 0 and i1 <= 6 and i2 >= 2 and "
+ "i2 <= 6 - i1 and i3 >= 0 and i3 <= -1 + i2;"
+ "Stmt_for_body24[i0, i1, 1, 0]:"
+ "i0 >= 0 and i0 <= 1 and i1 >= 0 and i1 <= 5;"
+ "Stmt_for_body7[i0, i1, i2]:"
+ "i0 >= 0 and i0 <= 1 and i1 >= 0 and i1 <= 7 and i2 >= 0 and "
+ "i2 <= 7 }";
+
+ V = "{Stmt_for_body24[0, i1, i2, i3] -> "
+ "Stmt_for_body24[1, i1, i2, i3]:"
+ "i3 >= 0 and i3 <= -1 + i2 and i1 >= 0 and i2 <= 6 - i1 and "
+ "i2 >= 1;"
+ "Stmt_for_body24[0, i1, i2, i3] -> "
+ "Stmt_for_body7[1, 1 + i1 + i3, 1 + i1 + i2]:"
+ "i3 <= -1 + i2 and i2 <= 6 - i1 and i2 >= 1 and i1 >= 0 and "
+ "i3 >= 0;"
+ "Stmt_for_body24[0, i1, i2, i3] ->"
+ "Stmt_for_body7[1, i1, 1 + i1 + i3]:"
+ "i3 >= 0 and i2 <= 6 - i1 and i1 >= 0 and i3 <= -1 + i2;"
+ "Stmt_for_body7[0, i1, i2] -> Stmt_for_body7[1, i1, i2]:"
+ "(i2 >= 1 + i1 and i2 <= 6 and i1 >= 0 and i1 <= 4) or "
+ "(i2 >= 3 and i2 <= 7 and i1 >= 1 and i2 >= 1 + i1) or "
+ "(i2 >= 0 and i2 <= i1 and i2 >= -7 + i1 and i1 <= 7);"
+ "Stmt_for_body7[0, i1, 1 + i1] -> Stmt_for_body7[1, i1, 1 + i1]:"
+ "i1 <= 6 and i1 >= 0;"
+ "Stmt_for_body7[0, 0, 7] -> Stmt_for_body7[1, 0, 7];"
+ "Stmt_for_body7[i0, i1, i2] -> "
+ "Stmt_for_body24[i0, o1, -1 + i2 - o1, -1 + i1 - o1]:"
+ "i0 >= 0 and i0 <= 1 and o1 >= 0 and i2 >= 1 + i1 and "
+ "o1 <= -2 + i2 and i2 <= 7 and o1 <= -1 + i1;"
+ "Stmt_for_body7[i0, i1, i2] -> "
+ "Stmt_for_body24[i0, i1, o2, -1 - i1 + i2]:"
+ "i0 >= 0 and i0 <= 1 and i1 >= 0 and o2 >= -i1 + i2 and "
+ "o2 >= 1 and o2 <= 6 - i1 and i2 >= 1 + i1 }";
+ P = V;
+ S = "{ Stmt_for_body24[i0, i1, i2, i3] -> "
+ "[i0, 5i0 + i1, 6i0 + i1 + i2, 1 + 6i0 + i1 + i2 + i3, 1];"
+ "Stmt_for_body7[i0, i1, i2] -> [0, 5i0, 6i0 + i1, 6i0 + i2, 0] }";
+
+ if (test_special_schedule(ctx, D, V, P, S) < 0)
+ return -1;
+
D = "{ S_0[i, j] : i >= 1 and i <= 10 and j >= 1 and j <= 8 }";
V = "{ S_0[i, j] -> S_0[i, 1 + j] : i >= 1 and i <= 10 and "
"j >= 1 and j <= 7;"