From 50b5b9366726f5f6563d80209f5234e433de5564 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 2 Sep 2016 12:25:36 +0200 Subject: [PATCH] add isl_basic_set_from_multi_aff In analogy with isl_basic_map_from_multi_aff. Signed-off-by: Sven Verdoolaege --- doc/user.pod | 4 ++++ include/isl/set.h | 3 +++ isl_aff_map.c | 13 +++++++++++++ 3 files changed, 20 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index f3fa88bf..786ded8a 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2096,6 +2096,10 @@ or a list of affine expressions (See L), provided these affine expressions do not involve any NaN. + #include + __isl_give isl_basic_set *isl_basic_set_from_multi_aff( + __isl_take isl_multi_aff *ma); + #include __isl_give isl_basic_map *isl_basic_map_from_aff( __isl_take isl_aff *aff); diff --git a/include/isl/set.h b/include/isl/set.h index 29fb84e9..03da8711 100644 --- a/include/isl/set.h +++ b/include/isl/set.h @@ -498,6 +498,9 @@ __isl_give isl_basic_set *isl_basic_set_from_constraint_matrices( __isl_take isl_mat *eq, __isl_take isl_mat *ineq, enum isl_dim_type c1, enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4); +__isl_give isl_basic_set *isl_basic_set_from_multi_aff( + __isl_take isl_multi_aff *ma); + __isl_give isl_mat *isl_basic_set_reduced_basis(__isl_keep isl_basic_set *bset); __isl_give isl_basic_set *isl_basic_set_coefficients( diff --git a/isl_aff_map.c b/isl_aff_map.c index 82eff702..ecc44cdc 100644 --- a/isl_aff_map.c +++ b/isl_aff_map.c @@ -20,6 +20,7 @@ #include #include +#include #include /* Check that the input living in "space" lives in a map space. @@ -188,6 +189,18 @@ __isl_give isl_basic_map *isl_basic_map_from_multi_aff( return basic_map_from_multi_aff(ma); } +/* Construct a basic set mapping the parameter domain + * of the multi-affine expression to its space, with each dimension + * in the space equated to the corresponding affine expression. + */ +__isl_give isl_basic_set *isl_basic_set_from_multi_aff( + __isl_take isl_multi_aff *ma) +{ + if (check_input_is_set(isl_multi_aff_peek_space(ma)) < 0) + ma = isl_multi_aff_free(ma); + return bset_from_bmap(isl_basic_map_from_multi_aff(ma)); +} + /* Construct a map mapping the domain of the multi-affine expression * to its range, with each dimension in the range equated to the * corresponding affine expression. -- 2.11.4.GIT