- if (1)
- B = isl_basic_set_reduced_basis(bset);
- else
- B = isl_mat_identity(bset->ctx, dim);
- B = isl_mat_lin_to_aff(B);
- if (!B)
- goto error;
-
- tab = isl_tab_from_basic_set(bset);
-
- level = 0;
- init = 1;
-
- while (level >= 0) {
- int empty = 0;
- if (init) {
- res = isl_tab_min(tab, B->row[1 + level],
- bset->ctx->one, &min->el[level], NULL, 0);
- if (res == isl_lp_empty)
- empty = 1;
- if (res == isl_lp_error || res == isl_lp_unbounded)
- goto error;
- isl_seq_neg(B->row[1 + level] + 1,
- B->row[1 + level] + 1, dim);
- res = isl_tab_min(tab, B->row[1 + level],
- bset->ctx->one, &max->el[level], NULL, 0);
- isl_seq_neg(B->row[1 + level] + 1,
- B->row[1 + level] + 1, dim);
- isl_int_neg(max->el[level], max->el[level]);
- if (res == isl_lp_empty)
- empty = 1;
- if (res == isl_lp_error || res == isl_lp_unbounded)
- goto error;
- snap[level] = isl_tab_snap(tab);
- } else
- isl_int_add_ui(min->el[level], min->el[level], 1);
-
- if (empty || isl_int_gt(min->el[level], max->el[level])) {
- level--;
- init = 0;
- if (level >= 0)
- isl_tab_rollback(tab, snap[level]);
- continue;
- }
- isl_int_neg(B->row[1 + level][0], min->el[level]);
- tab = isl_tab_add_valid_eq(tab, B->row[1 + level]);
- isl_int_set_si(B->row[1 + level][0], 0);
- if (level < dim - 1) {
- ++level;
- init = 1;
- continue;
- }
- samples = add_solution(samples, tab);
- init = 0;
- isl_tab_rollback(tab, snap[level]);