__isl_give isl_set *isl_pw_qpolynomial_domain(
__isl_take isl_pw_qpolynomial *pwqp);
+ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_domain(
+ __isl_take isl_pw_qpolynomial *pwpq,
+ __isl_take isl_set *set);
=head2 Dependence Analysis
enum isl_dim_type type);
__isl_give isl_set *isl_pw_qpolynomial_domain(__isl_take isl_pw_qpolynomial *pwqp);
+__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_domain(
+ __isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add(
__isl_take isl_pw_qpolynomial *pwqp1,
__isl_give isl_set *isl_pw_qpolynomial_fold_domain(
__isl_take isl_pw_qpolynomial_fold *pwf);
+__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_intersect_domain(
+ __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add(
__isl_take isl_pw_qpolynomial_fold *pwf1,
return isl_qpolynomial_is_one(pwqp->p[0].qp);
}
-__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_cow(
- __isl_take isl_pw_qpolynomial *pwqp)
-{
- if (!pwqp)
- return NULL;
-
- if (pwqp->ref == 1)
- return pwqp;
- pwqp->ref--;
- return isl_pw_qpolynomial_dup(pwqp);
-}
-
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul(
__isl_take isl_pw_qpolynomial *pwqp1,
__isl_take isl_pw_qpolynomial *pwqp2)
int isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp);
int isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp);
+__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_cow(
+ __isl_take isl_pw_qpolynomial *pwqp);
+
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_piece(
__isl_take isl_pw_qpolynomial *pwqp,
__isl_take isl_set *set, __isl_take isl_qpolynomial *qp);
int isl_pw_qpolynomial_is_zero(__isl_keep isl_pw_qpolynomial *pwqp);
int isl_pw_qpolynomial_is_one(__isl_keep isl_pw_qpolynomial *pwqp);
+
+__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_cow(
+ __isl_take isl_pw_qpolynomial_fold *pwf);
return NULL;
}
+__isl_give PW *FN(PW,cow)(__isl_take PW *pw)
+{
+ if (!pw)
+ return NULL;
+
+ if (pw->ref == 1)
+ return pw;
+ pw->ref--;
+ return FN(PW,dup)(pw);
+}
+
__isl_give PW *FN(PW,copy)(__isl_keep PW *pw)
{
if (!pw)
return dom;
}
+
+__isl_give PW *FN(PW,intersect_domain)(__isl_take PW *pw, __isl_take isl_set *set)
+{
+ int i;
+
+ if (!pw || !set)
+ goto error;
+
+ if (pw->n == 0) {
+ isl_set_free(set);
+ return pw;
+ }
+
+ pw = FN(PW,cow)(pw);
+ if (!pw)
+ goto error;
+
+ for (i = 0; i < pw->n; ++i) {
+ pw->p[i].set = isl_set_intersect(pw->p[i].set, isl_set_copy(set));
+ if (!pw->p[i].set)
+ goto error;
+ }
+
+ isl_set_free(set);
+ return pw;
+error:
+ isl_set_free(set);
+ FN(PW,free)(pw);
+ return NULL;
+}