Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
__isl_take isl_pw_aff *pwaff);
__isl_give isl_aff *isl_aff_ceil(__isl_take isl_aff *aff);
__isl_give isl_aff *isl_aff_floor(__isl_take isl_aff *aff);
+ __isl_give isl_pw_aff *isl_pw_aff_floor(
+ __isl_take isl_pw_aff *pwaff);
__isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff,
isl_int f);
__isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff,
__isl_give isl_pw_aff *isl_pw_aff_add(__isl_take isl_pw_aff *pwaff1,
__isl_take isl_pw_aff *pwaff2);
__isl_give isl_pw_aff *isl_pw_aff_neg(__isl_take isl_pw_aff *pwaff);
+__isl_give isl_pw_aff *isl_pw_aff_floor(__isl_take isl_pw_aff *pwaff);
__isl_give isl_pw_aff *isl_pw_aff_scale_down(__isl_take isl_pw_aff *pwaff,
isl_int f);
return pwaff;
}
+
+__isl_give isl_pw_aff *isl_pw_aff_floor(__isl_take isl_pw_aff *pwaff)
+{
+ int i;
+
+ pwaff = isl_pw_aff_cow(pwaff);
+ if (!pwaff)
+ return NULL;
+ if (pwaff->n == 0)
+ return pwaff;
+
+ for (i = 0; i < pwaff->n; ++i) {
+ pwaff->p[i].aff = isl_aff_floor(pwaff->p[i].aff);
+ if (!pwaff->p[i].aff)
+ return isl_pw_aff_free(pwaff);
+ }
+
+ return pwaff;
+}