__isl_take isl_basic_map *bmap,
__isl_take isl_basic_set *dom,
__isl_give isl_set **empty);
+ __isl_give isl_pw_multi_aff *isl_set_lexmin_pw_multi_aff(
+ __isl_take isl_set *set);
+ __isl_give isl_pw_multi_aff *isl_set_lexmax_pw_multi_aff(
+ __isl_take isl_set *set);
__isl_give isl_pw_multi_aff *isl_map_lexmin_pw_multi_aff(
__isl_take isl_map *map);
__isl_give isl_pw_multi_aff *isl_map_lexmax_pw_multi_aff(
__isl_give isl_pw_multi_aff *isl_basic_set_partial_lexmax_pw_multi_aff(
__isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
__isl_give isl_set **empty);
+__isl_give isl_pw_multi_aff *isl_set_lexmin_pw_multi_aff(
+ __isl_take isl_set *set);
+__isl_give isl_pw_multi_aff *isl_set_lexmax_pw_multi_aff(
+ __isl_take isl_set *set);
__isl_export
__isl_give isl_set *isl_basic_set_union(
return (isl_set *)isl_basic_map_lexmax((isl_basic_map *)bset);
}
-__isl_give isl_set *isl_set_lexmin(__isl_take isl_set *set)
-{
- return (isl_set *)isl_map_lexmin((isl_map *)set);
-}
-
-__isl_give isl_set *isl_set_lexmax(__isl_take isl_set *set)
-{
- return (isl_set *)isl_map_lexmax((isl_map *)set);
-}
-
/* Extract the first and only affine expression from list
* and then add it to *pwaff with the given dom.
* This domain is known to be disjoint from other domains
{
return SF(isl_map_lexopt,SUFFIX)(map, 1);
}
+
+__isl_give TYPE *SF(isl_set_lexmin,SUFFIX)(__isl_take isl_set *set)
+{
+ return SF(isl_map_lexmin,SUFFIX)(set);
+}
+
+__isl_give TYPE *SF(isl_set_lexmax,SUFFIX)(__isl_take isl_set *set)
+{
+ return SF(isl_map_lexmax,SUFFIX)(set);
+}
isl_map_free(map);
}
-void test_lexmin(struct isl_ctx *ctx)
+static int test_lexmin(struct isl_ctx *ctx)
{
+ int equal;
const char *str;
isl_basic_map *bmap;
isl_map *map, *map2;
assert(isl_map_is_equal(map, map2));
isl_map_free(map);
isl_map_free(map2);
+
+ str = "[i] -> { [i', j] : j = i - 8i' and i' >= 0 and i' <= 7 and "
+ " 8i' <= i and 8i' >= -7 + i }";
+ set = isl_set_read_from_str(ctx, str);
+ pma = isl_set_lexmin_pw_multi_aff(isl_set_copy(set));
+ set2 = isl_set_from_pw_multi_aff(pma);
+ equal = isl_set_is_equal(set, set2);
+ isl_set_free(set);
+ isl_set_free(set2);
+ if (equal < 0)
+ return -1;
+ if (!equal)
+ isl_die(ctx, isl_error_unknown,
+ "unexpected difference between set and "
+ "piecewise affine expression", return -1);
+
+ return 0;
}
struct must_may {
{ "factorize", &test_factorize },
{ "subset", &test_subset },
{ "subtract", &test_subtract },
+ { "lexmin", &test_lexmin },
};
int main()
test_convex_hull(ctx);
test_gist(ctx);
test_closure(ctx);
- test_lexmin(ctx);
isl_ctx_free(ctx);
return 0;
error: