add isl_pw_*_set_dim_id
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 21 Sep 2011 09:10:37 +0000 (11:10 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Oct 2011 09:03:35 +0000 (11:03 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/aff.h
isl_pw_templ.c

index f2ca7f6..f88cc61 100644 (file)
@@ -2648,6 +2648,10 @@ It can be modified using
        __isl_give isl_aff *isl_aff_set_dim_id(
                __isl_take isl_aff *aff, enum isl_dim_type type,
                unsigned pos, __isl_take isl_id *id);
+       __isl_give isl_pw_aff *isl_pw_aff_set_dim_id(
+               __isl_take isl_pw_aff *pma,
+               enum isl_dim_type type, unsigned pos,
+               __isl_take isl_id *id);
        __isl_give isl_aff *isl_aff_set_constant(
                __isl_take isl_aff *aff, isl_int v);
        __isl_give isl_aff *isl_aff_set_constant_si(
index debe308..c427643 100644 (file)
@@ -105,6 +105,9 @@ __isl_give isl_pw_aff *isl_pw_aff_empty(__isl_take isl_space *dim);
 __isl_give isl_pw_aff *isl_pw_aff_alloc(__isl_take isl_set *set,
        __isl_take isl_aff *aff);
 
+__isl_give isl_pw_aff *isl_pw_aff_set_dim_id(__isl_take isl_pw_aff *pma,
+       enum isl_dim_type type, unsigned pos, __isl_take isl_id *id);
+
 int isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff);
 int isl_pw_aff_plain_is_equal(__isl_keep isl_pw_aff *pwaff1,
        __isl_keep isl_pw_aff *pwaff2);
index 212d8a0..1292e76 100644 (file)
@@ -1100,6 +1100,16 @@ __isl_give PW *FN(PW,set_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type,
 
        return FN(PW,reset_space)(pw, space);
 }
+
+__isl_give PW *FN(PW,set_dim_id)(__isl_take PW *pw,
+       enum isl_dim_type type, unsigned pos, __isl_take isl_id *id)
+{
+       pw = FN(PW,cow)(pw);
+       if (!pw)
+               return isl_id_free(id);
+       pw->dim = isl_space_set_dim_id(pw->dim, type, pos, id);
+       return FN(PW,reset_space)(pw, isl_space_copy(pw->dim));
+}
 #endif
 
 int FN(PW,has_equal_space)(__isl_keep PW *pw1, __isl_keep PW *pw2)