add isl_set_from_point
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 7 Mar 2010 17:57:57 +0000 (18:57 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 9 Mar 2010 14:26:51 +0000 (15:26 +0100)
doc/user.pod
include/isl_set.h
isl_point.c

index b8fe52f..3f9129d 100644 (file)
@@ -1070,7 +1070,12 @@ Points can be copied or freed using
                __isl_keep isl_point *pnt);
        void isl_point_free(__isl_take isl_point *pnt);
 
-A box can be created from two opposite extremal points using
+A singleton set can be created from a point using
+
+       __isl_give isl_set *isl_set_from_point(
+               __isl_take isl_point *pnt);
+
+and a box can be created from two opposite extremal points using
 
        __isl_give isl_set *isl_set_box_from_points(
                __isl_take isl_point *pnt1,
index 772839e..1f71275 100644 (file)
@@ -308,6 +308,7 @@ int isl_set_foreach_point(__isl_keep isl_set *set,
        int (*fn)(__isl_take isl_point *pnt, void *user), void *user);
 int isl_set_count(__isl_keep isl_set *set, isl_int *count);
 
+__isl_give isl_set *isl_set_from_point(__isl_take isl_point *pnt);
 __isl_give isl_set *isl_set_box_from_points(__isl_take isl_point *pnt1,
        __isl_take isl_point *pnt2);
 
index a8f278e..9177c34 100644 (file)
@@ -319,6 +319,19 @@ int isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point)
        return isl_map_contains_point((isl_map *)set, point);
 }
 
+__isl_give isl_set *isl_set_from_point(__isl_take isl_point *pnt)
+{
+       isl_basic_set *bset;
+       isl_basic_set *model;
+
+       model = isl_basic_set_empty(isl_dim_copy(pnt->dim));
+       bset = isl_basic_set_from_vec(isl_vec_copy(pnt->vec));
+       bset = isl_basic_set_from_underlying_set(bset, model);
+       isl_point_free(pnt);
+
+       return isl_set_from_basic_set(bset);
+}
+
 __isl_give isl_set *isl_set_box_from_points(__isl_take isl_point *pnt1,
        __isl_take isl_point *pnt2)
 {
@@ -344,24 +357,14 @@ __isl_give isl_set *isl_set_box_from_points(__isl_take isl_point *pnt1,
                return isl_set_empty(dim);
        }
        if (isl_point_is_void(pnt1)) {
-               isl_basic_set *model;
-               model = isl_basic_set_empty(isl_dim_copy(pnt2->dim));
-               bset = isl_basic_set_from_vec(isl_vec_copy(pnt2->vec));
-               bset = isl_basic_set_from_underlying_set(bset, model);
                isl_point_free(pnt1);
-               isl_point_free(pnt2);
                isl_int_clear(t);
-               return isl_set_from_basic_set(bset);
+               return isl_set_from_point(pnt2);
        }
        if (isl_point_is_void(pnt2)) {
-               isl_basic_set *model;
-               model = isl_basic_set_empty(isl_dim_copy(pnt1->dim));
-               bset = isl_basic_set_from_vec(isl_vec_copy(pnt1->vec));
-               bset = isl_basic_set_from_underlying_set(bset, model);
-               isl_point_free(pnt1);
                isl_point_free(pnt2);
                isl_int_clear(t);
-               return isl_set_from_basic_set(bset);
+               return isl_set_from_point(pnt1);
        }
 
        total = isl_dim_total(pnt1->dim);