From cd410814406c2a580812cd9c26290134dc44b35f Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 12 Mar 2014 13:40:10 +0100 Subject: [PATCH] add pet_prefix_projection We will need this function in the next commit. Signed-off-by: Sven Verdoolaege --- aff.c | 12 ++++++++++++ aff.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/aff.c b/aff.c index b019174..ca873f6 100644 --- a/aff.c +++ b/aff.c @@ -34,6 +34,18 @@ #include "aff.h" +/* Return a function that projects "space" onto its first "n" dimensions, + * with anonymous target space. + */ +__isl_give isl_multi_aff *pet_prefix_projection(__isl_take isl_space *space, + int n) +{ + int dim; + + dim = isl_space_dim(space, isl_dim_set); + return isl_multi_aff_project_out_map(space, isl_dim_set, n, dim - n); +} + /* If the isl_pw_aff on which isl_pw_aff_foreach_piece is called * has a constant expression on its only domain, then replace * the isl_val in *user by this constant. diff --git a/aff.h b/aff.h index f67d402..b4f27fc 100644 --- a/aff.h +++ b/aff.h @@ -9,6 +9,9 @@ extern "C" { #endif +__isl_give isl_multi_aff *pet_prefix_projection(__isl_take isl_space *space, + int n); + __isl_give isl_val *pet_extract_cst(__isl_keep isl_pw_aff *pa); __isl_give isl_pw_aff *pet_and(__isl_take isl_pw_aff *lhs, -- 2.11.4.GIT