__isl_give isl_map *isl_map_read_from_str(isl_ctx *ctx,
const char *str, int nparam);
+ #include <isl_union_set.h>
+ __isl_give isl_union_set *isl_union_set_read_from_str(
+ struct isl_ctx *ctx, const char *str);
+
+ #include <isl_union_map.h>
+ __isl_give isl_union_map *isl_union_map_read_from_str(
+ struct isl_ctx *ctx, const char *str);
+
The input format is autodetected and may be either the C<PolyLib> format
or the C<isl> format.
C<nparam> specifies how many of the final columns in
__isl_give isl_set *isl_stream_read_set(struct isl_stream *s, int nparam);
__isl_give isl_pw_qpolynomial *isl_stream_read_pw_qpolynomial(
struct isl_stream *s);
+__isl_give isl_union_map *isl_stream_read_union_map(struct isl_stream *s);
#if defined(__cplusplus)
}
__isl_give isl_union_map *isl_union_map_lex_ge_union_map(
__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2);
+__isl_give isl_union_map *isl_union_map_read_from_str(struct isl_ctx *ctx,
+ const char *str);
__isl_give isl_printer *isl_printer_print_union_map(__isl_take isl_printer *p,
__isl_keep isl_union_map *umap);
__isl_give isl_union_map *isl_union_set_lex_ge_union_set(
__isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2);
+__isl_give isl_union_set *isl_union_set_read_from_str(struct isl_ctx *ctx,
+ const char *str);
__isl_give isl_printer *isl_printer_print_union_set(__isl_take isl_printer *p,
__isl_keep isl_union_set *uset);
return NULL;
}
+__isl_give isl_union_map *isl_stream_read_union_map(struct isl_stream *s)
+{
+ struct isl_obj obj;
+ isl_union_map *umap;
+
+ obj = obj_read(s, -1);
+ if (obj.type == isl_obj_map) {
+ obj.type = isl_obj_union_map;
+ obj.v = isl_union_map_from_map(obj.v);
+ }
+ if (obj.type == isl_obj_set) {
+ obj.type = isl_obj_union_set;
+ obj.v = isl_union_set_from_set(obj.v);
+ }
+ if (obj.v)
+ isl_assert(s->ctx, obj.type == isl_obj_union_map ||
+ obj.type == isl_obj_union_set, goto error);
+
+ return obj.v;
+error:
+ obj.type->free(obj.v);
+ return NULL;
+}
+
+__isl_give isl_union_set *isl_stream_read_union_set(struct isl_stream *s)
+{
+ struct isl_obj obj;
+ isl_union_set *uset;
+
+ obj = obj_read(s, -1);
+ if (obj.type == isl_obj_set) {
+ obj.type = isl_obj_union_set;
+ obj.v = isl_union_set_from_set(obj.v);
+ }
+ if (obj.v)
+ isl_assert(s->ctx, obj.type == isl_obj_union_set, goto error);
+
+ return obj.v;
+error:
+ obj.type->free(obj.v);
+ return NULL;
+}
+
static struct isl_basic_map *basic_map_read(struct isl_stream *s, int nparam)
{
struct isl_obj obj;
return NULL;
}
+__isl_give isl_union_map *isl_union_map_read_from_str(struct isl_ctx *ctx,
+ const char *str)
+{
+ isl_union_map *umap;
+ struct isl_stream *s = isl_stream_new_str(ctx, str);
+ if (!s)
+ return NULL;
+ umap = isl_stream_read_union_map(s);
+ isl_stream_free(s);
+ return umap;
+}
+
+__isl_give isl_union_set *isl_union_set_read_from_str(struct isl_ctx *ctx,
+ const char *str)
+{
+ isl_union_set *uset;
+ struct isl_stream *s = isl_stream_new_str(ctx, str);
+ if (!s)
+ return NULL;
+ uset = isl_stream_read_union_set(s);
+ isl_stream_free(s);
+ return uset;
+}
+
static char *next_line(FILE *input, char *line, unsigned len)
{
char *p;
isl_union_map *umap1, *umap2;
str = "{ [i] : 0 <= i <= 1 }";
- uset = isl_union_set_from_set(isl_set_read_from_str(ctx, str, -1));
+ uset = isl_union_set_read_from_str(ctx, str);
str = "{ [1] -> [0] }";
- umap1 = isl_union_map_from_map(isl_map_read_from_str(ctx, str, -1));
+ umap1 = isl_union_map_read_from_str(ctx, str);
umap2 = isl_union_set_lex_gt_union_set(isl_union_set_copy(uset), uset);
assert(isl_union_map_is_equal(umap1, umap2));