add isl_div_div
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 23 Oct 2010 12:33:19 +0000 (14:33 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 26 Oct 2010 15:02:58 +0000 (17:02 +0200)
include/isl_div.h
isl_div.c

index f9b590f..175ed67 100644 (file)
@@ -42,6 +42,7 @@ void isl_div_set_coefficient(struct isl_div *div,
        enum isl_dim_type type, int pos, isl_int v);
 
 unsigned isl_div_dim(__isl_keep isl_div *div, enum isl_dim_type type);
+__isl_give isl_div *isl_div_div(__isl_take isl_div *div, int pos);
 
 #if defined(__cplusplus)
 }
index 3db5ad2..5b9f324 100644 (file)
--- a/isl_div.c
+++ b/isl_div.c
@@ -72,6 +72,16 @@ struct isl_div *isl_basic_set_div(struct isl_basic_set *bset, int pos)
        return isl_basic_map_div((struct isl_basic_map *)bset, pos);
 }
 
+__isl_give isl_div *isl_div_div(__isl_take isl_div *div, int pos)
+{
+       isl_basic_map *bmap;
+       if (!div)
+               return NULL;
+       bmap = isl_basic_map_copy(div->bmap);
+       isl_div_free(div);
+       return isl_basic_map_div(bmap, pos);
+}
+
 struct isl_div *isl_div_alloc(struct isl_dim *dim)
 {
        struct isl_basic_map *bmap;