24 for (i = 0; i <
n; ++i)
56 GBR_type F_old, alpha, F_new;
61 GBR_type *alpha_buffer[2] = { NULL, NULL };
62 GBR_type *alpha_saved;
90 if (n_bounded <= tab->n_zero + 1)
113 alpha_saved = alpha_buffer[0];
115 if (!F || !alpha_buffer[0] || !alpha_buffer[1])
118 for (i = 0; i < n_bounded; ++i) {
120 GBR_init(alpha_buffer[0][i]);
121 GBR_init(alpha_buffer[1][i]);
139 if (GBR_lt(F[i], one)) {
140 if (!GBR_is_zero(F[i])) {
157 GBR_set_ui(alpha, 0);
158 }
else if (use_saved) {
160 GBR_set(F_new, F_saved);
162 GBR_set(alpha, alpha_saved[i]);
180 GBR_set(F[i+1], F_new);
182 GBR_floor(mu[0], alpha);
183 GBR_ceil(mu[1], alpha);
190 for (j = 0; j <= 1; ++j) {
194 tmp,
B->row[1+i]+1, dim);
205 if (GBR_lt(mu_F[0], mu_F[1]))
211 GBR_set(F_new, mu_F[j]);
213 alpha_saved = alpha_buffer[j];
216 tmp,
B->row[1+i]+1, dim);
218 if (i+1 == tab->
n_zero && fixed) {
219 if (!GBR_is_zero(F[i+1])) {
223 GBR_set_ui(F[i+1], 0);
228 GBR_set(F_old, F[i]);
232 GBR_set_ui(mu_F[0], 4);
233 GBR_mul(mu_F[0], mu_F[0], F_new);
234 GBR_set_ui(mu_F[1], 3);
235 GBR_mul(mu_F[1], mu_F[1], F_old);
236 if (GBR_lt(mu_F[0], mu_F[1])) {
240 GBR_set(F_saved, F_new);
246 GBR_set(F[tab->
n_zero], F_new);
247 if (gbr_only_first && GBR_lt(F[tab->
n_zero], two))
251 if (!GBR_is_zero(F[tab->
n_zero])) {
255 GBR_set_ui(F[tab->
n_zero], 0);
264 }
while (i < n_bounded - 1);
278 for (i = 0; i < n_bounded; ++i) {
280 GBR_clear(alpha_buffer[0][i]);
281 GBR_clear(alpha_buffer[1][i]);
284 free(alpha_buffer[0]);
285 free(alpha_buffer[1]);
#define GBR_lp_cut(lp, obj)
#define GBR_lp_is_fixed(lp)
#define GBR_lp_get_obj_val(lp, F)
#define GBR_lp_get_alpha(lp, row, alpha)
#define GBR_lp_del_row(lp)
#define GBR_lp_add_row(lp, row, dim)
#define GBR_lp_next_row(lp)
#define GBR_lp_set_obj(lp, obj, dim)
#define GBR_lp_delete(lp)
struct isl_tab * isl_tab_compute_reduced_basis(struct isl_tab *tab)
static void save_alpha(GBR_LP *lp, int first, int n, GBR_type *alpha)
__isl_give isl_mat * isl_basic_set_reduced_basis(__isl_keep isl_basic_set *bset)
#define isl_alloc_array(ctx, type, n)
#define isl_int_set(r, i)
isl_stat isl_basic_set_check_no_locals(__isl_keep isl_basic_set *bset)
isl_stat isl_basic_set_check_no_params(__isl_keep isl_basic_set *bset)
__isl_give isl_mat * isl_mat_sub_alloc6(isl_ctx *ctx, isl_int **row, unsigned first_row, unsigned n_row, unsigned first_col, unsigned n_col)
void isl_seq_combine(isl_int *dst, isl_int m1, isl_int *src1, isl_int m2, isl_int *src2, unsigned len)
void isl_tab_free(struct isl_tab *tab)
__isl_give struct isl_tab * isl_tab_from_basic_set(__isl_keep isl_basic_set *bset, int track)
struct isl_basic_set isl_basic_set
__isl_give isl_mat * isl_mat_copy(__isl_keep isl_mat *mat)
__isl_give isl_mat * isl_mat_identity(isl_ctx *ctx, unsigned n_row)
__isl_give isl_mat * isl_mat_left_hermite(__isl_take isl_mat *M, int neg, __isl_give isl_mat **U, __isl_give isl_mat **Q)
__isl_give isl_mat * isl_mat_swap_rows(__isl_take isl_mat *mat, unsigned i, unsigned j)
__isl_give isl_mat * isl_mat_lin_to_aff(__isl_take isl_mat *mat)
__isl_null isl_mat * isl_mat_free(__isl_take isl_mat *mat)
isl_size isl_basic_set_dim(__isl_keep isl_basic_set *bset, enum isl_dim_type type)
__isl_null isl_vec * isl_vec_free(__isl_take isl_vec *vec)
__isl_give isl_vec * isl_vec_alloc(isl_ctx *ctx, unsigned size)