diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2011-09-22 12:00:15 +0200 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2011-09-22 13:24:13 +0200 |
commit | 2d6726a1603607dfee8a3eacf357b91363fe2a30 (patch) | |
tree | d9770f3a24365c9be6138e545aa202db0b1ff915 | |
parent | dbb61f82cfb84f18d8df5d2aa114fd114d559d39 (diff) | |
download | isl-2d6726a1603607dfee8a3eacf357b91363fe2a30.tar.gz isl-2d6726a1603607dfee8a3eacf357b91363fe2a30.tar.bz2 isl-2d6726a1603607dfee8a3eacf357b91363fe2a30.zip |
add isl_space_set_from_params
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
-rw-r--r-- | doc/user.pod | 2 | ||||
-rw-r--r-- | include/isl/space.h | 1 | ||||
-rw-r--r-- | isl_space.c | 13 |
3 files changed, 16 insertions, 0 deletions
diff --git a/doc/user.pod b/doc/user.pod index ca813c1c..8fc61bce 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -692,6 +692,8 @@ using the following functions. __isl_give isl_space *isl_space_from_range(__isl_take isl_space *space); __isl_give isl_space *isl_space_params( __isl_take isl_space *space); + __isl_give isl_space *isl_space_set_from_params( + __isl_take isl_space *space); __isl_give isl_space *isl_space_reverse(__isl_take isl_space *space); __isl_give isl_space *isl_space_join(__isl_take isl_space *left, __isl_take isl_space *right); diff --git a/include/isl/space.h b/include/isl/space.h index 2ca7f950..77aea980 100644 --- a/include/isl/space.h +++ b/include/isl/space.h @@ -101,6 +101,7 @@ __isl_give isl_space *isl_space_from_domain(__isl_take isl_space *dim); __isl_give isl_space *isl_space_range(__isl_take isl_space *dim); __isl_give isl_space *isl_space_from_range(__isl_take isl_space *dim); __isl_give isl_space *isl_space_params(__isl_take isl_space *space); +__isl_give isl_space *isl_space_set_from_params(__isl_take isl_space *space); __isl_give isl_space *isl_space_align_params(__isl_take isl_space *dim1, __isl_take isl_space *dim2); diff --git a/isl_space.c b/isl_space.c index 7bac5784..2b092043 100644 --- a/isl_space.c +++ b/isl_space.c @@ -1246,6 +1246,19 @@ __isl_give isl_space *isl_space_params(__isl_take isl_space *space) return space; } +__isl_give isl_space *isl_space_set_from_params(__isl_take isl_space *space) +{ + if (!space) + return NULL; + if (!isl_space_is_params(space)) + isl_die(isl_space_get_ctx(space), isl_error_invalid, + "not a parameter space", goto error); + return isl_space_reset(space, isl_dim_set); +error: + isl_space_free(space); + return NULL; +} + __isl_give isl_space *isl_space_as_set_space(__isl_take isl_space *dim) { dim = isl_space_cow(dim); |