isl_tab_basic_map_partial_lexopt: remove samples that are no longer useful
[platform/upstream/isl.git] / isl_tab.h
index e76b0f0..34535d3 100644 (file)
--- a/isl_tab.h
+++ b/isl_tab.h
@@ -30,11 +30,13 @@ enum isl_tab_undo_type {
        isl_tab_undo_bset_div,
        isl_tab_undo_saved_basis,
        isl_tab_undo_drop_sample,
+       isl_tab_undo_saved_samples,
 };
 
 union isl_tab_undo_val {
        int             var_index;
        int             *col_var;
+       int             n;
 };
 
 struct isl_tab_undo {
@@ -91,7 +93,7 @@ struct isl_tab_undo {
  * 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.
- * isl_tab_detect_equalities and isl_tab_detect_redundant can be used
+ * isl_tab_detect_implicit_equalities and isl_tab_detect_redundant can be used
  * to perform and exhaustive search for dead columns and redundant rows.
  *
  * The samples matrix contains "n_sample" integer points that have at some
@@ -136,8 +138,13 @@ struct isl_tab {
 
        unsigned n_sample;
        unsigned n_outside;
+       int *sample_index;
        struct isl_mat *samples;
 
+       int n_zero;
+       int n_unbounded;
+       struct isl_mat *basis;
+
        unsigned need_undo : 1;
        unsigned rational : 1;
        unsigned empty : 1;
@@ -157,7 +164,7 @@ 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_equalities(struct isl_tab *tab);
+struct isl_tab *isl_tab_detect_implicit_equalities(struct isl_tab *tab);
 struct isl_tab *isl_tab_detect_redundant(struct isl_tab *tab);
 #define ISL_TAB_SAVE_DUAL      (1 << 0)
 enum isl_lp_result isl_tab_min(struct isl_tab *tab,
@@ -166,6 +173,7 @@ enum isl_lp_result isl_tab_min(struct isl_tab *tab,
 
 struct isl_tab *isl_tab_extend(struct isl_tab *tab, unsigned n_new);
 struct isl_tab *isl_tab_add_ineq(struct isl_tab *tab, isl_int *ineq);
+struct isl_tab *isl_tab_add_eq(struct isl_tab *tab, isl_int *eq);
 struct isl_tab *isl_tab_add_valid_eq(struct isl_tab *tab, isl_int *eq);
 
 int isl_tab_is_equality(struct isl_tab *tab, int con);
@@ -203,6 +211,7 @@ 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);
 struct isl_tab *isl_tab_mark_empty(struct isl_tab *tab);
 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);
 int isl_tab_allocate_con(struct isl_tab *tab);
 int isl_tab_extend_vars(struct isl_tab *tab, unsigned n_new);
@@ -218,4 +227,10 @@ void isl_tab_push_var(struct isl_tab *tab,
        enum isl_tab_undo_type type, struct isl_tab_var *var);
 void isl_tab_push_basis(struct isl_tab *tab);
 
+struct isl_tab *isl_tab_init_samples(struct isl_tab *tab);
+struct isl_tab *isl_tab_add_sample(struct isl_tab *tab,
+       __isl_take isl_vec *sample);
+struct isl_tab *isl_tab_drop_sample(struct isl_tab *tab, int s);
+void isl_tab_save_samples(struct isl_tab *tab);
+
 #endif