int bernstein_triangulate;
int pip_symmetry;
+
+ #define ISL_CONVEX_HULL_WRAP 0
+ #define ISL_CONVEX_HULL_FM 1
+ int convex;
};
ISL_ARG_DECL(isl_options, struct isl_options, isl_options_arg)
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)
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));
{0}
};
+static struct isl_arg_choice convex[] = {
+ {"wrap", ISL_CONVEX_HULL_WRAP},
+ {"fm", ISL_CONVEX_HULL_FM},
+ {0}
+};
+
static void print_version(void)
{
printf("%s", isl_version());
"triangulate domains during Bernstein expansion")
ISL_ARG_BOOL(struct isl_options, pip_symmetry, 0, "pip-symmetry", 1,
"detect simple symmetries in PIP input")
+ISL_ARG_CHOICE(struct isl_options, convex, 0, "convex-hull", \
+ convex, ISL_CONVEX_HULL_WRAP, "convex hull algorithm to use")
ISL_ARG_VERSION(print_version)
ISL_ARG_END
};
fclose(input);
}
-void test_convex_hull(struct isl_ctx *ctx)
+void test_convex_hull_algo(struct isl_ctx *ctx, int convex)
{
const char *str1, *str2;
isl_set *set1, *set2;
+ int orig_convex = ctx->opt->convex;
+ ctx->opt->convex = convex;
test_convex_hull_case(ctx, "convex0");
test_convex_hull_case(ctx, "convex1");
assert(isl_set_is_equal(set1, set2));
isl_set_free(set1);
isl_set_free(set2);
+
+ ctx->opt->convex = orig_convex;
+}
+
+void test_convex_hull(struct isl_ctx *ctx)
+{
+ test_convex_hull_algo(ctx, ISL_CONVEX_HULL_FM);
+ test_convex_hull_algo(ctx, ISL_CONVEX_HULL_WRAP);
}
void test_gist_case(struct isl_ctx *ctx, const char *name)