__isl_take isl_pw_aff *pwaff,
__isl_take isl_space *model);
+ __isl_give isl_aff *isl_aff_project_domain_on_params(
+ __isl_take isl_aff *aff);
+
__isl_give isl_aff *isl_aff_gist_params(
__isl_take isl_aff *aff,
__isl_take isl_set *context);
enum isl_dim_type type, unsigned n);
__isl_give isl_aff *isl_aff_drop_dims(__isl_take isl_aff *aff,
enum isl_dim_type type, unsigned first, unsigned n);
+__isl_give isl_aff *isl_aff_project_domain_on_params(__isl_take isl_aff *aff);
__isl_give isl_aff *isl_aff_align_params(__isl_take isl_aff *aff,
__isl_take isl_space *model);
return aff;
}
+/* Project the domain of the affine expression onto its parameter space.
+ * The affine expression may not involve any of the domain dimensions.
+ */
+__isl_give isl_aff *isl_aff_project_domain_on_params(__isl_take isl_aff *aff)
+{
+ isl_space *space;
+ unsigned n;
+ int involves;
+
+ n = isl_aff_dim(aff, isl_dim_in);
+ involves = isl_aff_involves_dims(aff, isl_dim_in, 0, n);
+ if (involves < 0)
+ return isl_aff_free(aff);
+ if (involves)
+ isl_die(isl_aff_get_ctx(aff), isl_error_invalid,
+ "affine expression involves some of the domain dimensions",
+ return isl_aff_free(aff));
+ aff = isl_aff_drop_dims(aff, isl_dim_in, 0, n);
+ space = isl_aff_get_domain_space(aff);
+ space = isl_space_params(space);
+ aff = isl_aff_reset_domain_space(aff, space);
+ return aff;
+}
+
__isl_give isl_aff *isl_aff_insert_dims(__isl_take isl_aff *aff,
enum isl_dim_type type, unsigned first, unsigned n)
{