From: Sven Verdoolaege Date: Sun, 14 Apr 2013 16:23:34 +0000 (+0200) Subject: add isl_set_plain_get_val_if_fixed X-Git-Tag: isl-0.12~58 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fisl.git;a=commitdiff_plain;h=bebe6a21ae5f0d8eed204ad491154d3dfb916091 add isl_set_plain_get_val_if_fixed Signed-off-by: Sven Verdoolaege --- diff --git a/doc/user.pod b/doc/user.pod index d5814fd..f208de3 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2064,11 +2064,14 @@ has a fixed value and if so, return that value in C<*val>. isl_basic_map_plain_get_val_if_fixed( __isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); + __isl_give isl_val *isl_set_plain_get_val_if_fixed( + __isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); __isl_give isl_val *isl_map_plain_get_val_if_fixed( __isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); -If the relation obviously lies on a hyperplane where the given dimension +If the set or relation obviously lies on a hyperplane where the given dimension has a fixed value, then return that value. Otherwise return NaN. diff --git a/include/isl/set.h b/include/isl/set.h index 31d4e35..78c6811 100644 --- a/include/isl/set.h +++ b/include/isl/set.h @@ -433,6 +433,8 @@ int isl_set_plain_dim_is_fixed(__isl_keep isl_set *set, unsigned dim, isl_int *val); int isl_set_fast_dim_is_fixed(__isl_keep isl_set *set, unsigned dim, isl_int *val); +__isl_give isl_val *isl_set_plain_get_val_if_fixed(__isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos); int isl_set_plain_dim_has_fixed_lower_bound(__isl_keep isl_set *set, unsigned dim, isl_int *val); int isl_set_dim_is_bounded(__isl_keep isl_set *set, diff --git a/isl_map.c b/isl_map.c index 3505edf..f1d02bf 100644 --- a/isl_map.c +++ b/isl_map.c @@ -8509,6 +8509,16 @@ __isl_give isl_val *isl_map_plain_get_val_if_fixed(__isl_keep isl_map *map, return isl_val_nan(ctx); } +/* If "set" obviously lies on a hyperplane where the given dimension + * has a fixed value, then return that value. + * Otherwise return NaN. + */ +__isl_give isl_val *isl_set_plain_get_val_if_fixed(__isl_keep isl_set *set, + enum isl_dim_type type, unsigned pos) +{ + return isl_map_plain_get_val_if_fixed(set, type, pos); +} + int isl_set_plain_is_fixed(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos, isl_int *val) {