Expose isl_term_copy
[platform/upstream/isl.git] / isl_dim_map.c
index 20dca99..ab3d303 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright 2008-2009 Katholieke Universiteit Leuven
- * Copyright 2010      INRIA Saclay
+ * Copyright 2010-2011 INRIA Saclay
  *
  * Use of this software is governed by the GNU LGPLv2.1 license
  *
@@ -42,6 +42,24 @@ __isl_give isl_dim_map *isl_dim_map_alloc(isl_ctx *ctx, unsigned len)
        return dim_map;
 }
 
+void isl_dim_map_range(__isl_keep isl_dim_map *dim_map,
+       unsigned dst_pos, unsigned dst_stride,
+       unsigned src_pos, unsigned src_stride,
+       unsigned n, int sign)
+{
+       int i;
+
+       if (!dim_map)
+               return;
+
+       for (i = 0; i < n; ++i) {
+               unsigned d = 1 + dst_pos + dst_stride * i;
+               unsigned s = 1 + src_pos + src_stride * i;
+               dim_map->m[d].pos = s;
+               dim_map->m[d].sgn = sign;
+       }
+}
+
 void isl_dim_map_dim_range(__isl_keep isl_dim_map *dim_map,
        struct isl_dim *dim, enum isl_dim_type type,
        unsigned first, unsigned n, unsigned dst_pos)
@@ -155,6 +173,13 @@ error:
        return NULL;
 }
 
+__isl_give isl_basic_set *isl_basic_set_add_constraints_dim_map(
+       __isl_take isl_basic_set *dst, __isl_take isl_basic_set *src,
+       __isl_take isl_dim_map *dim_map)
+{
+       return isl_basic_map_add_constraints_dim_map(dst, src, dim_map);
+}
+
 /* Extend the given dim_map with mappings for the divs in bmap.
  */
 __isl_give isl_dim_map *isl_dim_map_extend(__isl_keep isl_dim_map *dim_map,