+/*
+ * Copyright 2008-2009 Katholieke Universiteit Leuven
+ *
+ * Use of this software is governed by the GNU LGPLv2.1 license
+ *
+ * Written by Sven Verdoolaege, K.U.Leuven, Departement
+ * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
+ */
+
#ifndef ISL_TAB_H
#define ISL_TAB_H
isl_tab_undo_empty,
isl_tab_undo_nonneg,
isl_tab_undo_redundant,
+ isl_tab_undo_freeze,
isl_tab_undo_zero,
isl_tab_undo_allocate,
isl_tab_undo_relax,
- isl_tab_undo_bset_ineq,
- isl_tab_undo_bset_eq,
- isl_tab_undo_bset_div,
+ isl_tab_undo_bmap_ineq,
+ isl_tab_undo_bmap_eq,
+ isl_tab_undo_bmap_div,
isl_tab_undo_saved_basis,
isl_tab_undo_drop_sample,
isl_tab_undo_saved_samples,
+ isl_tab_undo_callback,
+};
+
+struct isl_tab_callback {
+ int (*run)(struct isl_tab_callback *cb);
};
union isl_tab_undo_val {
int var_index;
int *col_var;
int n;
+ struct isl_tab_callback *callback;
};
struct isl_tab_undo {
struct isl_tab_undo *top;
struct isl_vec *dual;
- struct isl_basic_set *bset;
+ struct isl_basic_map *bmap;
unsigned n_sample;
unsigned n_outside;
int n_unbounded;
struct isl_mat *basis;
+ unsigned strict_redundant : 1;
unsigned need_undo : 1;
unsigned rational : 1;
unsigned empty : 1;
struct isl_tab *isl_tab_from_basic_map(struct isl_basic_map *bmap);
struct isl_tab *isl_tab_from_basic_set(struct isl_basic_set *bset);
-struct isl_tab *isl_tab_from_recession_cone(struct isl_basic_set *bset);
+struct isl_tab *isl_tab_from_recession_cone(struct isl_basic_set *bset,
+ int parametric);
int isl_tab_cone_is_bounded(struct isl_tab *tab);
struct isl_basic_map *isl_basic_map_update_from_tab(struct isl_basic_map *bmap,
struct isl_tab *tab);
struct isl_basic_set *isl_basic_set_update_from_tab(struct isl_basic_set *bset,
struct isl_tab *tab);
-struct isl_tab *isl_tab_detect_implicit_equalities(struct isl_tab *tab) WARN_UNUSED;
-struct isl_tab *isl_tab_detect_redundant(struct isl_tab *tab) WARN_UNUSED;
+int isl_tab_detect_implicit_equalities(struct isl_tab *tab) WARN_UNUSED;
+int isl_tab_detect_redundant(struct isl_tab *tab) WARN_UNUSED;
#define ISL_TAB_SAVE_DUAL (1 << 0)
enum isl_lp_result isl_tab_min(struct isl_tab *tab,
isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom,
unsigned flags) WARN_UNUSED;
struct isl_tab *isl_tab_extend(struct isl_tab *tab, unsigned n_new) WARN_UNUSED;
-struct isl_tab *isl_tab_add_ineq(struct isl_tab *tab, isl_int *ineq) WARN_UNUSED;
-struct isl_tab *isl_tab_add_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED;
-struct isl_tab *isl_tab_add_valid_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED;
+int isl_tab_add_ineq(struct isl_tab *tab, isl_int *ineq) WARN_UNUSED;
+int isl_tab_add_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED;
+int isl_tab_add_valid_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED;
+
+int isl_tab_freeze_constraint(struct isl_tab *tab, int con) WARN_UNUSED;
+
+int isl_tab_track_bmap(struct isl_tab *tab, __isl_take isl_basic_map *bmap) WARN_UNUSED;
+int isl_tab_track_bset(struct isl_tab *tab, __isl_take isl_basic_set *bset) WARN_UNUSED;
+__isl_keep isl_basic_set *isl_tab_peek_bset(struct isl_tab *tab);
int isl_tab_is_equality(struct isl_tab *tab, int con);
int isl_tab_is_redundant(struct isl_tab *tab, int con);
int isl_tab_rollback(struct isl_tab *tab, struct isl_tab_undo *snap) WARN_UNUSED;
struct isl_tab *isl_tab_relax(struct isl_tab *tab, int con) WARN_UNUSED;
-struct isl_tab *isl_tab_select_facet(struct isl_tab *tab, int con) WARN_UNUSED;
+int isl_tab_select_facet(struct isl_tab *tab, int con) WARN_UNUSED;
void isl_tab_dump(struct isl_tab *tab, FILE *out, int indent);
struct isl_tab_var *isl_tab_var_from_row(struct isl_tab *tab, int i);
int isl_tab_mark_redundant(struct isl_tab *tab, int row) WARN_UNUSED;
-struct isl_tab *isl_tab_mark_empty(struct isl_tab *tab);
+int isl_tab_mark_empty(struct isl_tab *tab) WARN_UNUSED;
struct isl_tab *isl_tab_dup(struct isl_tab *tab);
struct isl_tab *isl_tab_product(struct isl_tab *tab1, struct isl_tab *tab2);
int isl_tab_extend_cons(struct isl_tab *tab, unsigned n_new) WARN_UNUSED;
int isl_tab_add_row(struct isl_tab *tab, isl_int *line) WARN_UNUSED;
int isl_tab_row_is_redundant(struct isl_tab *tab, int row);
int isl_tab_min_at_most_neg_one(struct isl_tab *tab, struct isl_tab_var *var);
+int isl_tab_sign_of_max(struct isl_tab *tab, int con);
int isl_tab_kill_col(struct isl_tab *tab, int col) WARN_UNUSED;
int isl_tab_push(struct isl_tab *tab, enum isl_tab_undo_type type) WARN_UNUSED;
struct isl_tab *isl_tab_detect_equalities(struct isl_tab *tab,
struct isl_tab *tab_cone) WARN_UNUSED;
+int isl_tab_push_callback(struct isl_tab *tab,
+ struct isl_tab_callback *callback) WARN_UNUSED;
+
+int isl_tab_add_div(struct isl_tab *tab, __isl_keep isl_vec *div,
+ int (*add_ineq)(void *user, isl_int *), void *user);
+
#endif