add isl_multi_aff_from_aff
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 16 Jul 2012 13:00:42 +0000 (15:00 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 18 Sep 2012 12:59:43 +0000 (14:59 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/aff.h
isl_multi_templ.c

index 688507a..7e00955 100644 (file)
@@ -3579,10 +3579,13 @@ An expression can be printed using
 An C<isl_multi_aff> object represents a sequence of
 zero or more affine expressions, all defined on the same domain space.
 
-An C<isl_multi_aff> can be constructed from a C<isl_aff_list> using the
-following function.
+An C<isl_multi_aff> can be constructed from a single
+C<isl_aff> or an C<isl_aff_list> using the
+following functions.
 
        #include <isl/aff.h>
+       __isl_give isl_multi_aff *isl_multi_aff_from_aff(
+               __isl_take isl_aff *aff);
        __isl_give isl_multi_aff *isl_multi_aff_from_aff_list(
                __isl_take isl_space *space,
                __isl_take isl_aff_list *list);
index be07550..08b75b9 100644 (file)
@@ -262,6 +262,7 @@ __isl_give isl_set *isl_pw_aff_list_ge_set(__isl_take isl_pw_aff_list *list1,
 __isl_give isl_set *isl_pw_aff_list_gt_set(__isl_take isl_pw_aff_list *list1,
        __isl_take isl_pw_aff_list *list2);
 
+__isl_give isl_multi_aff *isl_multi_aff_from_aff(__isl_take isl_aff *aff);
 __isl_give isl_multi_aff *isl_multi_aff_zero(__isl_take isl_space *space);
 __isl_give isl_multi_aff *isl_multi_aff_identity(__isl_take isl_space *space);
 
index aceb6c6..1776b20 100644 (file)
@@ -521,6 +521,16 @@ __isl_give MULTI(BASE) *FN(MULTI(BASE),zero)(__isl_take isl_space *space)
        return multi;
 }
 
+__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),BASE)(__isl_take EL *el)
+{
+       MULTI(BASE) *multi;
+
+       multi = FN(MULTI(BASE),alloc)(FN(EL,get_space)(el));
+       multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
+
+       return multi;
+}
+
 __isl_give MULTI(BASE) *FN(MULTI(BASE),drop_dims)(
        __isl_take MULTI(BASE) *multi,
        enum isl_dim_type type, unsigned first, unsigned n)