__isl_take isl_val *mod);
__isl_give isl_pw_aff *isl_pw_aff_mod(
__isl_take isl_pw_aff *pwaff, isl_int mod);
+ __isl_give isl_pw_aff *isl_pw_aff_mod_val(
+ __isl_take isl_pw_aff *pa,
+ __isl_take isl_val *mod);
__isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff,
isl_int f);
__isl_give isl_aff *isl_aff_scale_val(__isl_take isl_aff *aff,
__isl_give isl_pw_aff *isl_pw_aff_floor(__isl_take isl_pw_aff *pwaff);
__isl_give isl_pw_aff *isl_pw_aff_mod(__isl_take isl_pw_aff *pwaff,
isl_int mod);
+__isl_give isl_pw_aff *isl_pw_aff_mod_val(__isl_take isl_pw_aff *pa,
+ __isl_take isl_val *mod);
__isl_give isl_pw_aff *isl_pw_aff_tdiv_q(__isl_take isl_pw_aff *pa1,
__isl_take isl_pw_aff *pa2);
__isl_give isl_pw_aff *isl_pw_aff_tdiv_r(__isl_take isl_pw_aff *pa1,
return res;
}
+/* Compute
+ *
+ * pa mod m = pa - m * floor(pa/m)
+ *
+ * with m an integer value.
+ */
+__isl_give isl_pw_aff *isl_pw_aff_mod_val(__isl_take isl_pw_aff *pa,
+ __isl_take isl_val *m)
+{
+ if (!pa || !m)
+ goto error;
+ if (!isl_val_is_int(m))
+ isl_die(isl_pw_aff_get_ctx(pa), isl_error_invalid,
+ "expecting integer modulo", goto error);
+ pa = isl_pw_aff_mod(pa, m->n);
+ isl_val_free(m);
+ return pa;
+error:
+ isl_pw_aff_free(pa);
+ isl_val_free(m);
+ return NULL;
+}
+
/* Given f, return ceil(f).
* If f is an integer expression, then just return f.
* Otherwise, let f be the expression