summaryrefslogtreecommitdiff
path: root/isl_pw_templ.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2011-11-02 11:16:27 +0100
committerSven Verdoolaege <skimo@kotnet.org>2011-11-02 16:35:36 +0100
commitff92580f1acb24424de00e9e33e3e5317e202e7a (patch)
tree83632ac1d6697609c610bdb62a2f5cf01db1760e /isl_pw_templ.c
parentb14e553764d306ce2a4782c28cf03b0892fb1955 (diff)
downloadisl-ff92580f1acb24424de00e9e33e3e5317e202e7a.tar.gz
isl-ff92580f1acb24424de00e9e33e3e5317e202e7a.tar.bz2
isl-ff92580f1acb24424de00e9e33e3e5317e202e7a.zip
add isl_pw_*_intersect_params
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Diffstat (limited to 'isl_pw_templ.c')
-rw-r--r--isl_pw_templ.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/isl_pw_templ.c b/isl_pw_templ.c
index 8e5d15f7..f254b0c3 100644
--- a/isl_pw_templ.c
+++ b/isl_pw_templ.c
@@ -645,8 +645,14 @@ __isl_give isl_set *FN(PW,domain)(__isl_take PW *pw)
return dom;
}
-static __isl_give PW *FN(PW,intersect_domain_aligned)(__isl_take PW *pw,
- __isl_take isl_set *set)
+/* Restrict the domain of "pw" by combining each cell
+ * with "set" through a call to "fn", where "fn" may be
+ * isl_set_intersect or isl_set_intersect_params.
+ */
+static __isl_give PW *FN(PW,intersect_aligned)(__isl_take PW *pw,
+ __isl_take isl_set *set,
+ __isl_give isl_set *(*fn)(__isl_take isl_set *set1,
+ __isl_take isl_set *set2))
{
int i;
@@ -664,7 +670,7 @@ static __isl_give PW *FN(PW,intersect_domain_aligned)(__isl_take PW *pw,
for (i = pw->n - 1; i >= 0; --i) {
isl_basic_set *aff;
- pw->p[i].set = isl_set_intersect(pw->p[i].set, isl_set_copy(set));
+ pw->p[i].set = fn(pw->p[i].set, isl_set_copy(set));
if (!pw->p[i].set)
goto error;
aff = isl_set_affine_hull(isl_set_copy(pw->p[i].set));
@@ -689,6 +695,12 @@ error:
return NULL;
}
+static __isl_give PW *FN(PW,intersect_domain_aligned)(__isl_take PW *pw,
+ __isl_take isl_set *set)
+{
+ return FN(PW,intersect_aligned)(pw, set, &isl_set_intersect);
+}
+
__isl_give PW *FN(PW,intersect_domain)(__isl_take PW *pw,
__isl_take isl_set *context)
{
@@ -696,6 +708,21 @@ __isl_give PW *FN(PW,intersect_domain)(__isl_take PW *pw,
&FN(PW,intersect_domain_aligned));
}
+static __isl_give PW *FN(PW,intersect_params_aligned)(__isl_take PW *pw,
+ __isl_take isl_set *set)
+{
+ return FN(PW,intersect_aligned)(pw, set, &isl_set_intersect_params);
+}
+
+/* Intersect the domain of "pw" with the parameter domain "context".
+ */
+__isl_give PW *FN(PW,intersect_params)(__isl_take PW *pw,
+ __isl_take isl_set *context)
+{
+ return FN(PW,align_params_pw_set_and)(pw, context,
+ &FN(PW,intersect_params_aligned));
+}
+
static __isl_give PW *FN(PW,gist_aligned)(__isl_take PW *pw,
__isl_take isl_set *context)
{