projects
/
platform
/
upstream
/
isl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
isl_convex_hull.c: remove unused swap_ineq
[platform/upstream/isl.git]
/
isl_convex_hull.c
diff --git
a/isl_convex_hull.c
b/isl_convex_hull.c
index
1552492
..
b848ede
100644
(file)
--- a/
isl_convex_hull.c
+++ b/
isl_convex_hull.c
@@
-7,28
+7,18
@@
* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
*/
* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
*/
-#include "isl_lp.h"
-#include "isl_map.h"
-#include "isl_map_private.h"
+#include <isl_ctx_private.h>
+#include <isl_map_private.h>
+#include <isl/lp.h>
+#include <isl/map.h>
#include <isl_mat_private.h>
#include <isl_mat_private.h>
-#include
"isl_set.h"
-#include
"isl_seq.h"
+#include
<isl/set.h>
+#include
<isl/seq.h>
#include "isl_equalities.h"
#include "isl_tab.h"
static struct isl_basic_set *uset_convex_hull_wrap_bounded(struct isl_set *set);
#include "isl_equalities.h"
#include "isl_tab.h"
static struct isl_basic_set *uset_convex_hull_wrap_bounded(struct isl_set *set);
-static void swap_ineq(struct isl_basic_map *bmap, unsigned i, unsigned j)
-{
- isl_int *t;
-
- if (i != j) {
- t = bmap->ineq[i];
- bmap->ineq[i] = bmap->ineq[j];
- bmap->ineq[j] = t;
- }
-}
-
/* Return 1 if constraint c is redundant with respect to the constraints
* in bmap. If c is a lower [upper] bound in some variable and bmap
* does not have a lower [upper] bound in that variable, then c cannot
/* Return 1 if constraint c is redundant with respect to the constraints
* in bmap. If c is a lower [upper] bound in some variable and bmap
* does not have a lower [upper] bound in that variable, then c cannot
@@
-174,21
+164,28
@@
error:
return -1;
}
return -1;
}
-struct isl_basic_set *isl_basic_set_set_rational(struct isl_basic_set *bset)
+__isl_give isl_basic_map *isl_basic_map_set_rational(
+ __isl_take isl_basic_set *bmap)
{
{
- if (!b
set
)
+ if (!b
map
)
return NULL;
return NULL;
- if (ISL_F_ISSET(b
set
, ISL_BASIC_MAP_RATIONAL))
- return b
set
;
+ if (ISL_F_ISSET(b
map
, ISL_BASIC_MAP_RATIONAL))
+ return b
map
;
- b
set = isl_basic_set_cow(bset
);
- if (!b
set
)
+ b
map = isl_basic_map_cow(bmap
);
+ if (!b
map
)
return NULL;
return NULL;
- ISL_F_SET(b
set
, ISL_BASIC_MAP_RATIONAL);
+ ISL_F_SET(b
map
, ISL_BASIC_MAP_RATIONAL);
- return isl_basic_set_finalize(bset);
+ return isl_basic_map_finalize(bmap);
+}
+
+__isl_give isl_basic_set *isl_basic_set_set_rational(
+ __isl_take isl_basic_set *bset)
+{
+ return isl_basic_map_set_rational(bset);
}
static struct isl_set *isl_set_set_rational(struct isl_set *set)
}
static struct isl_set *isl_set_set_rational(struct isl_set *set)
@@
-290,6
+287,7
@@
static struct isl_basic_set *wrap_constraints(struct isl_set *set)
n_ineq += set->p[i]->n_ineq;
}
lp = isl_basic_set_alloc(set->ctx, 0, dim * set->n, 0, n_eq, n_ineq);
n_ineq += set->p[i]->n_ineq;
}
lp = isl_basic_set_alloc(set->ctx, 0, dim * set->n, 0, n_eq, n_ineq);
+ lp = isl_basic_set_set_rational(lp);
if (!lp)
return NULL;
lp_dim = isl_basic_set_n_dim(lp);
if (!lp)
return NULL;
lp_dim = isl_basic_set_n_dim(lp);
@@
-890,7
+888,7
@@
int isl_basic_set_is_bounded(__isl_keep isl_basic_set *bset)
if (!bset)
return -1;
if (!bset)
return -1;
- if (isl_basic_set_
fast
_is_empty(bset))
+ if (isl_basic_set_
plain
_is_empty(bset))
return 1;
tab = isl_tab_from_recession_cone(bset, 1);
return 1;
tab = isl_tab_from_recession_cone(bset, 1);
@@
-1030,7
+1028,7
@@
static struct isl_basic_set *modulo_lineality(struct isl_set *set,
if (!set || !lin)
goto error;
lin_dim = total - lin->n_eq;
if (!set || !lin)
goto error;
lin_dim = total - lin->n_eq;
- M = isl_mat_sub_alloc(set->ctx, lin->eq, 0, lin->n_eq, 1, total);
+ M = isl_mat_sub_alloc
6
(set->ctx, lin->eq, 0, lin->n_eq, 1, total);
M = isl_mat_left_hermite(M, 0, &U, &Q);
if (!M)
goto error;
M = isl_mat_left_hermite(M, 0, &U, &Q);
if (!M)
goto error;
@@
-1352,6
+1350,9
@@
static struct isl_basic_set *convex_hull_pair(struct isl_basic_set *bset1,
isl_basic_set *lin, *aff;
int bounded1, bounded2;
isl_basic_set *lin, *aff;
int bounded1, bounded2;
+ if (bset1->ctx->opt->convex == ISL_CONVEX_HULL_FM)
+ return convex_hull_pair_elim(bset1, bset2);
+
aff = isl_set_affine_hull(isl_basic_set_union(isl_basic_set_copy(bset1),
isl_basic_set_copy(bset2)));
if (!aff)
aff = isl_set_affine_hull(isl_basic_set_union(isl_basic_set_copy(bset1),
isl_basic_set_copy(bset2)));
if (!aff)
@@
-1660,7
+1661,7
@@
static struct isl_basic_set *common_constraints(struct isl_basic_set *hull,
total = isl_dim_total(set->dim);
for (i = 0; i < set->p[best]->n_ineq; ++i) {
total = isl_dim_total(set->dim);
for (i = 0; i < set->p[best]->n_ineq; ++i) {
- constraints[i].c = isl_mat_sub_alloc(hull->ctx,
+ constraints[i].c = isl_mat_sub_alloc
6
(hull->ctx,
set->p[best]->ineq + i, 0, 1, 0, 1 + total);
if (!constraints[i].c)
goto error;
set->p[best]->ineq + i, 0, 1, 0, 1 + total);
if (!constraints[i].c)
goto error;
@@
-1807,7
+1808,8
@@
static struct isl_basic_set *uset_convex_hull(struct isl_set *set)
if (isl_set_n_dim(set) == 1)
return convex_hull_1d(set);
if (isl_set_n_dim(set) == 1)
return convex_hull_1d(set);
- if (isl_set_is_bounded(set))
+ if (isl_set_is_bounded(set) &&
+ set->ctx->opt->convex == ISL_CONVEX_HULL_WRAP)
return uset_convex_hull_wrap(set);
lin = uset_combined_lineality_space(isl_set_copy(set));
return uset_convex_hull_wrap(set);
lin = uset_combined_lineality_space(isl_set_copy(set));