2 * Copyright 2008-2009 Katholieke Universiteit Leuven
3 * Copyright 2010 INRIA Saclay
5 * Use of this software is governed by the GNU LGPLv2.1 license
7 * Written by Sven Verdoolaege, K.U.Leuven, Departement
8 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
9 * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite,
10 * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France
19 #include "isl_stream.h"
20 #include "isl_map_private.h"
25 struct variable *next;
34 static struct vars *vars_new(struct isl_ctx *ctx)
37 v = isl_alloc_type(ctx, struct vars);
46 static void variable_free(struct variable *var)
49 struct variable *next = var->next;
56 static void vars_free(struct vars *v)
64 static void vars_drop(struct vars *v, int n)
75 struct variable *next = var->next;
83 static struct variable *variable_new(struct vars *v, const char *name, int len,
87 var = isl_alloc_type(v->ctx, struct variable);
90 var->name = strdup(name);
91 var->name[len] = '\0';
100 static int vars_pos(struct vars *v, const char *s, int len)
107 for (q = v->v; q; q = q->next) {
108 if (strncmp(q->name, s, len) == 0 && q->name[len] == '\0')
115 v->v = variable_new(v, s, len, v->n);
123 static struct vars *read_var_list(struct isl_stream *s, struct vars *v)
125 struct isl_token *tok;
127 while ((tok = isl_stream_next_token(s)) != NULL) {
131 if (tok->type != ISL_TOKEN_IDENT)
134 p = vars_pos(v, tok->u.s, -1);
138 isl_stream_error(s, tok, "expecting unique identifier");
142 tok = isl_stream_next_token(s);
143 if (!tok || tok->type != ',')
149 isl_stream_push_token(s, tok);
158 static struct isl_vec *accept_affine(struct isl_stream *s, struct vars *v)
160 struct isl_token *tok = NULL;
164 aff = isl_vec_alloc(v->ctx, 1 + v->n);
165 isl_seq_clr(aff->el, aff->size);
170 tok = isl_stream_next_token(s);
172 isl_stream_error(s, NULL, "unexpected EOF");
175 if (tok->type == ISL_TOKEN_IDENT) {
177 int pos = vars_pos(v, tok->u.s, -1);
181 isl_stream_error(s, tok, "unknown identifier");
185 isl_int_add_ui(aff->el[1 + pos],
186 aff->el[1 + pos], 1);
188 isl_int_sub_ui(aff->el[1 + pos],
189 aff->el[1 + pos], 1);
191 } else if (tok->type == ISL_TOKEN_VALUE) {
192 struct isl_token *tok2;
195 tok2 = isl_stream_next_token(s);
196 if (tok2 && tok2->type == ISL_TOKEN_IDENT) {
197 pos = vars_pos(v, tok2->u.s, -1);
201 isl_stream_error(s, tok2,
202 "unknown identifier");
203 isl_token_free(tok2);
206 isl_token_free(tok2);
208 isl_stream_push_token(s, tok2);
210 isl_int_neg(tok->u.v, tok->u.v);
211 isl_int_add(aff->el[1 + pos],
212 aff->el[1 + pos], tok->u.v);
214 } else if (tok->type == '-') {
216 } else if (tok->type == '+') {
219 isl_stream_push_token(s, tok);
231 static __isl_give isl_mat *accept_affine_list(struct isl_stream *s,
236 struct isl_token *tok = NULL;
238 vec = accept_affine(s, v);
239 mat = isl_mat_from_row_vec(vec);
244 tok = isl_stream_next_token(s);
246 isl_stream_error(s, NULL, "unexpected EOF");
249 if (tok->type != ',') {
250 isl_stream_push_token(s, tok);
255 vec = accept_affine(s, v);
256 mat = isl_mat_vec_concat(mat, vec);
267 static struct isl_basic_map *add_div_definition(struct isl_stream *s,
268 struct vars *v, struct isl_basic_map *bmap, int k)
270 struct isl_token *tok;
274 if (isl_stream_eat(s, '['))
277 tok = isl_stream_next_token(s);
280 if (tok->type == '(') {
284 isl_stream_push_token(s, tok);
286 aff = accept_affine(s, v);
290 isl_seq_cpy(bmap->div[k] + 1, aff->el, aff->size);
294 if (seen_paren && isl_stream_eat(s, ')'))
296 if (isl_stream_eat(s, '/'))
299 tok = isl_stream_next_token(s);
302 if (tok->type != ISL_TOKEN_VALUE) {
303 isl_stream_error(s, tok, "expected denominator");
304 isl_stream_push_token(s, tok);
307 isl_int_set(bmap->div[k][0], tok->u.v);
310 if (isl_stream_eat(s, ']'))
313 if (isl_basic_map_add_div_constraints(bmap, k) < 0)
318 isl_basic_map_free(bmap);
322 static struct isl_basic_map *read_defined_var_list(struct isl_stream *s,
323 struct vars *v, struct isl_basic_map *bmap)
325 struct isl_token *tok;
327 while ((tok = isl_stream_next_token(s)) != NULL) {
331 unsigned total = isl_basic_map_total_dim(bmap);
333 if (tok->type != ISL_TOKEN_IDENT)
336 p = vars_pos(v, tok->u.s, -1);
340 isl_stream_error(s, tok, "expecting unique identifier");
345 bmap = isl_basic_map_cow(bmap);
346 bmap = isl_basic_map_extend_dim(bmap, isl_dim_copy(bmap->dim),
349 if ((k = isl_basic_map_alloc_div(bmap)) < 0)
351 isl_seq_clr(bmap->div[k], 1 + 1 + total);
353 tok = isl_stream_next_token(s);
354 if (tok && tok->type == '=') {
356 bmap = add_div_definition(s, v, bmap, k);
357 tok = isl_stream_next_token(s);
360 if (!tok || tok->type != ',')
366 isl_stream_push_token(s, tok);
371 isl_basic_map_free(bmap);
375 static struct vars *read_tuple(struct isl_stream *s, struct vars *v)
377 struct isl_token *tok;
379 tok = isl_stream_next_token(s);
380 if (!tok || tok->type != '[') {
381 isl_stream_error(s, tok, "expecting '['");
385 v = read_var_list(s, v);
386 tok = isl_stream_next_token(s);
387 if (!tok || tok->type != ']') {
388 isl_stream_error(s, tok, "expecting ']'");
401 static struct isl_basic_map *add_constraints(struct isl_stream *s,
402 struct vars *v, struct isl_basic_map *bmap);
404 static struct isl_basic_map *add_exists(struct isl_stream *s,
405 struct vars *v, struct isl_basic_map *bmap)
407 struct isl_token *tok;
414 tok = isl_stream_next_token(s);
417 if (tok->type == '(') {
421 isl_stream_push_token(s, tok);
423 bmap = read_defined_var_list(s, v, bmap);
427 if (isl_stream_eat(s, ':'))
429 bmap = add_constraints(s, v, bmap);
430 if (seen_paren && isl_stream_eat(s, ')'))
434 isl_basic_map_free(bmap);
438 static __isl_give isl_basic_map *construct_constraint(
439 __isl_take isl_basic_map *bmap, enum isl_token_type type,
440 isl_int *left, isl_int *right)
448 len = 1 + isl_basic_map_total_dim(bmap);
451 k = isl_basic_map_alloc_inequality(bmap);
454 if (type == ISL_TOKEN_LE)
455 isl_seq_combine(bmap->ineq[k], ctx->negone, left,
458 else if (type == ISL_TOKEN_GE)
459 isl_seq_combine(bmap->ineq[k], ctx->one, left,
462 else if (type == ISL_TOKEN_LT) {
463 isl_seq_combine(bmap->ineq[k], ctx->negone, left,
466 isl_int_sub_ui(bmap->ineq[k][0], bmap->ineq[k][0], 1);
467 } else if (type == ISL_TOKEN_GT) {
468 isl_seq_combine(bmap->ineq[k], ctx->one, left,
471 isl_int_sub_ui(bmap->ineq[k][0], bmap->ineq[k][0], 1);
473 isl_seq_combine(bmap->ineq[k], ctx->one, left,
476 isl_basic_map_inequality_to_equality(bmap, k);
481 isl_basic_map_free(bmap);
485 static int is_comparator(struct isl_token *tok)
502 static struct isl_basic_map *add_constraint(struct isl_stream *s,
503 struct vars *v, struct isl_basic_map *bmap)
506 unsigned total = isl_basic_map_total_dim(bmap);
507 struct isl_token *tok = NULL;
508 struct isl_mat *aff1 = NULL, *aff2 = NULL;
510 tok = isl_stream_next_token(s);
513 if (tok->type == ISL_TOKEN_EXISTS) {
515 return add_exists(s, v, bmap);
517 isl_stream_push_token(s, tok);
520 bmap = isl_basic_map_cow(bmap);
522 aff1 = accept_affine_list(s, v);
525 tok = isl_stream_next_token(s);
526 if (!is_comparator(tok)) {
527 isl_stream_error(s, tok, "missing operator");
529 isl_stream_push_token(s, tok);
533 isl_assert(aff1->ctx, aff1->n_col == 1 + total, goto error);
535 aff2 = accept_affine_list(s, v);
538 isl_assert(aff2->ctx, aff2->n_col == 1 + total, goto error);
540 bmap = isl_basic_map_extend_constraints(bmap, 0,
541 aff1->n_row * aff2->n_row);
542 for (i = 0; i < aff1->n_row; ++i)
543 for (j = 0; j < aff2->n_row; ++j)
544 bmap = construct_constraint(bmap, tok->type,
545 aff1->row[i], aff2->row[j]);
550 tok = isl_stream_next_token(s);
551 if (!is_comparator(tok)) {
553 isl_stream_push_token(s, tok);
565 isl_basic_map_free(bmap);
569 static struct isl_basic_map *add_constraints(struct isl_stream *s,
570 struct vars *v, struct isl_basic_map *bmap)
572 struct isl_token *tok;
575 bmap = add_constraint(s, v, bmap);
578 tok = isl_stream_next_token(s);
580 isl_stream_error(s, NULL, "unexpected EOF");
583 if (tok->type != ISL_TOKEN_AND)
587 isl_stream_push_token(s, tok);
593 isl_basic_map_free(bmap);
597 static struct isl_basic_map *read_disjunct(struct isl_stream *s,
598 struct vars *v, __isl_take isl_dim *dim)
601 struct isl_token *tok;
602 struct isl_basic_map *bmap;
604 bmap = isl_basic_map_alloc_dim(dim, 0, 0, 0);
608 tok = isl_stream_next_token(s);
611 if (tok->type == '(') {
615 isl_stream_push_token(s, tok);
617 bmap = add_constraints(s, v, bmap);
618 bmap = isl_basic_map_simplify(bmap);
619 bmap = isl_basic_map_finalize(bmap);
621 if (seen_paren && isl_stream_eat(s, ')'))
626 isl_basic_map_free(bmap);
630 static struct isl_map *read_disjuncts(struct isl_stream *s,
631 struct vars *v, __isl_take isl_dim *dim)
633 struct isl_token *tok;
636 tok = isl_stream_next_token(s);
638 isl_stream_error(s, NULL, "unexpected EOF");
641 if (tok->type == '}') {
642 isl_stream_push_token(s, tok);
643 return isl_map_universe(dim);
645 isl_stream_push_token(s, tok);
647 map = isl_map_empty(isl_dim_copy(dim));
649 struct isl_basic_map *bmap;
652 bmap = read_disjunct(s, v, isl_dim_copy(dim));
653 map = isl_map_union(map, isl_map_from_basic_map(bmap));
655 vars_drop(v, v->n - n);
657 tok = isl_stream_next_token(s);
658 if (!tok || tok->type != ISL_TOKEN_OR)
663 isl_stream_push_token(s, tok);
672 static int polylib_pos_to_isl_pos(__isl_keep isl_basic_map *bmap, int pos)
674 if (pos < isl_basic_map_dim(bmap, isl_dim_out))
675 return 1 + isl_basic_map_dim(bmap, isl_dim_param) +
676 isl_basic_map_dim(bmap, isl_dim_in) + pos;
677 pos -= isl_basic_map_dim(bmap, isl_dim_out);
679 if (pos < isl_basic_map_dim(bmap, isl_dim_in))
680 return 1 + isl_basic_map_dim(bmap, isl_dim_param) + pos;
681 pos -= isl_basic_map_dim(bmap, isl_dim_in);
683 if (pos < isl_basic_map_dim(bmap, isl_dim_div))
684 return 1 + isl_basic_map_dim(bmap, isl_dim_param) +
685 isl_basic_map_dim(bmap, isl_dim_in) +
686 isl_basic_map_dim(bmap, isl_dim_out) + pos;
687 pos -= isl_basic_map_dim(bmap, isl_dim_div);
689 if (pos < isl_basic_map_dim(bmap, isl_dim_param))
695 static __isl_give isl_basic_map *basic_map_read_polylib_constraint(
696 struct isl_stream *s, __isl_take isl_basic_map *bmap)
699 struct isl_token *tok;
709 nparam = isl_basic_map_dim(bmap, isl_dim_param);
710 dim = isl_basic_map_dim(bmap, isl_dim_out);
712 tok = isl_stream_next_token(s);
713 if (!tok || tok->type != ISL_TOKEN_VALUE) {
714 isl_stream_error(s, tok, "expecting coefficient");
716 isl_stream_push_token(s, tok);
719 if (!tok->on_new_line) {
720 isl_stream_error(s, tok, "coefficient should appear on new line");
721 isl_stream_push_token(s, tok);
725 type = isl_int_get_si(tok->u.v);
728 isl_assert(s->ctx, type == 0 || type == 1, goto error);
730 k = isl_basic_map_alloc_equality(bmap);
733 k = isl_basic_map_alloc_inequality(bmap);
739 for (j = 0; j < 1 + isl_basic_map_total_dim(bmap); ++j) {
741 tok = isl_stream_next_token(s);
742 if (!tok || tok->type != ISL_TOKEN_VALUE) {
743 isl_stream_error(s, tok, "expecting coefficient");
745 isl_stream_push_token(s, tok);
748 if (tok->on_new_line) {
749 isl_stream_error(s, tok,
750 "coefficient should not appear on new line");
751 isl_stream_push_token(s, tok);
754 pos = polylib_pos_to_isl_pos(bmap, j);
755 isl_int_set(c[pos], tok->u.v);
761 isl_basic_map_free(bmap);
765 static __isl_give isl_basic_map *basic_map_read_polylib(struct isl_stream *s,
769 struct isl_token *tok;
770 struct isl_token *tok2;
773 unsigned in = 0, out, local = 0;
774 struct isl_basic_map *bmap = NULL;
779 tok = isl_stream_next_token(s);
781 isl_stream_error(s, NULL, "unexpected EOF");
784 tok2 = isl_stream_next_token(s);
787 isl_stream_error(s, NULL, "unexpected EOF");
790 n_row = isl_int_get_si(tok->u.v);
791 n_col = isl_int_get_si(tok2->u.v);
792 on_new_line = tok2->on_new_line;
793 isl_token_free(tok2);
795 isl_assert(s->ctx, !on_new_line, return NULL);
796 isl_assert(s->ctx, n_row >= 0, return NULL);
797 isl_assert(s->ctx, n_col >= 2 + nparam, return NULL);
798 tok = isl_stream_next_token_on_same_line(s);
800 if (tok->type != ISL_TOKEN_VALUE) {
801 isl_stream_error(s, tok,
802 "expecting number of output dimensions");
803 isl_stream_push_token(s, tok);
806 out = isl_int_get_si(tok->u.v);
809 tok = isl_stream_next_token_on_same_line(s);
810 if (!tok || tok->type != ISL_TOKEN_VALUE) {
811 isl_stream_error(s, tok,
812 "expecting number of input dimensions");
814 isl_stream_push_token(s, tok);
817 in = isl_int_get_si(tok->u.v);
820 tok = isl_stream_next_token_on_same_line(s);
821 if (!tok || tok->type != ISL_TOKEN_VALUE) {
822 isl_stream_error(s, tok,
823 "expecting number of existentials");
825 isl_stream_push_token(s, tok);
828 local = isl_int_get_si(tok->u.v);
831 tok = isl_stream_next_token_on_same_line(s);
832 if (!tok || tok->type != ISL_TOKEN_VALUE) {
833 isl_stream_error(s, tok,
834 "expecting number of parameters");
836 isl_stream_push_token(s, tok);
839 nparam = isl_int_get_si(tok->u.v);
841 if (n_col != 1 + out + in + local + nparam + 1) {
842 isl_stream_error(s, NULL,
843 "dimensions don't match");
847 out = n_col - 2 - nparam;
848 bmap = isl_basic_map_alloc(s->ctx, nparam, in, out, local, n_row, n_row);
852 for (i = 0; i < local; ++i) {
853 int k = isl_basic_map_alloc_div(bmap);
858 for (i = 0; i < n_row; ++i)
859 bmap = basic_map_read_polylib_constraint(s, bmap);
861 bmap = isl_basic_map_simplify(bmap);
862 bmap = isl_basic_map_finalize(bmap);
865 isl_basic_map_free(bmap);
869 static struct isl_map *map_read_polylib(struct isl_stream *s, int nparam)
871 struct isl_token *tok;
872 struct isl_token *tok2;
876 tok = isl_stream_next_token(s);
878 isl_stream_error(s, NULL, "unexpected EOF");
881 tok2 = isl_stream_next_token(s);
884 isl_stream_error(s, NULL, "unexpected EOF");
887 if (!tok2->on_new_line) {
888 isl_stream_push_token(s, tok2);
889 isl_stream_push_token(s, tok);
890 return isl_map_from_basic_map(basic_map_read_polylib(s, nparam));
892 isl_stream_push_token(s, tok2);
893 n = isl_int_get_si(tok->u.v);
896 isl_assert(s->ctx, n >= 1, return NULL);
898 map = isl_map_from_basic_map(basic_map_read_polylib(s, nparam));
900 for (i = 1; i < n; ++i)
901 map = isl_map_union(map,
902 isl_map_from_basic_map(basic_map_read_polylib(s, nparam)));
907 static struct isl_dim *set_names(struct isl_dim *dim, struct vars *vars,
908 enum isl_dim_type type, int offset, int n)
913 for (i = 0, v = vars->v; i < offset; ++i, v = v->next)
915 for (i = n - 1; i >= 0; --i, v = v->next) {
916 char *prime = strchr(v->name, '\'');
919 dim = isl_dim_set_name(dim, type, i, v->name);
927 static struct isl_dim *dim_from_vars(struct vars *vars,
928 int nparam, int n_in, int n_out)
932 dim = isl_dim_alloc(vars->ctx, nparam, n_in, n_out);
933 dim = set_names(dim, vars, isl_dim_param, n_out + n_in, nparam);
934 dim = set_names(dim, vars, isl_dim_in, n_out, n_in);
935 dim = set_names(dim, vars, isl_dim_out, 0, n_out);
940 static struct isl_map *map_read(struct isl_stream *s, int nparam)
942 struct isl_dim *dim = NULL;
943 struct isl_map *map = NULL;
944 struct isl_token *tok;
945 struct vars *v = NULL;
949 tok = isl_stream_next_token(s);
951 isl_stream_error(s, NULL, "unexpected EOF");
954 if (tok->type == ISL_TOKEN_VALUE) {
955 isl_stream_push_token(s, tok);
956 return map_read_polylib(s, nparam);
958 v = vars_new(s->ctx);
959 if (tok->type == '[') {
960 isl_stream_push_token(s, tok);
961 v = read_tuple(s, v);
965 isl_assert(s->ctx, nparam == v->n, goto error);
967 tok = isl_stream_next_token(s);
968 if (!tok || tok->type != ISL_TOKEN_TO) {
969 isl_stream_error(s, tok, "expecting '->'");
971 isl_stream_push_token(s, tok);
975 tok = isl_stream_next_token(s);
979 if (!tok || tok->type != '{') {
980 isl_stream_error(s, tok, "expecting '{'");
982 isl_stream_push_token(s, tok);
986 v = read_tuple(s, v);
990 tok = isl_stream_next_token(s);
991 if (tok && tok->type == ISL_TOKEN_TO) {
993 v = read_tuple(s, v);
996 n2 = v->n - n1 - nparam;
999 isl_stream_push_token(s, tok);
1003 dim = dim_from_vars(v, nparam, n1, n2);
1004 tok = isl_stream_next_token(s);
1006 isl_stream_error(s, NULL, "unexpected EOF");
1009 if (tok->type == ':') {
1010 isl_token_free(tok);
1011 map = read_disjuncts(s, v, isl_dim_copy(dim));
1012 tok = isl_stream_next_token(s);
1014 map = isl_map_universe(isl_dim_copy(dim));
1015 if (tok && tok->type == '}') {
1016 isl_token_free(tok);
1018 isl_stream_error(s, tok, "unexpected isl_token");
1020 isl_token_free(tok);
1035 static struct isl_basic_map *basic_map_read(struct isl_stream *s, int nparam)
1037 struct isl_map *map;
1038 struct isl_basic_map *bmap;
1040 map = map_read(s, nparam);
1044 isl_assert(map->ctx, map->n <= 1, goto error);
1047 bmap = isl_basic_map_empty_like_map(map);
1049 bmap = isl_basic_map_copy(map->p[0]);
1059 __isl_give isl_basic_map *isl_basic_map_read_from_file(isl_ctx *ctx,
1060 FILE *input, int nparam)
1062 struct isl_basic_map *bmap;
1063 struct isl_stream *s = isl_stream_new_file(ctx, input);
1066 bmap = basic_map_read(s, nparam);
1071 __isl_give isl_basic_set *isl_basic_set_read_from_file(isl_ctx *ctx,
1072 FILE *input, int nparam)
1074 struct isl_basic_map *bmap;
1075 bmap = isl_basic_map_read_from_file(ctx, input, nparam);
1078 isl_assert(ctx, isl_basic_map_n_in(bmap) == 0, goto error);
1079 return (struct isl_basic_set *)bmap;
1081 isl_basic_map_free(bmap);
1085 struct isl_basic_map *isl_basic_map_read_from_str(struct isl_ctx *ctx,
1086 const char *str, int nparam)
1088 struct isl_basic_map *bmap;
1089 struct isl_stream *s = isl_stream_new_str(ctx, str);
1092 bmap = basic_map_read(s, nparam);
1097 struct isl_basic_set *isl_basic_set_read_from_str(struct isl_ctx *ctx,
1098 const char *str, int nparam)
1100 struct isl_basic_map *bmap;
1101 bmap = isl_basic_map_read_from_str(ctx, str, nparam);
1104 isl_assert(ctx, isl_basic_map_n_in(bmap) == 0, goto error);
1105 return (struct isl_basic_set *)bmap;
1107 isl_basic_map_free(bmap);
1111 __isl_give isl_map *isl_map_read_from_file(struct isl_ctx *ctx,
1112 FILE *input, int nparam)
1114 struct isl_map *map;
1115 struct isl_stream *s = isl_stream_new_file(ctx, input);
1118 map = map_read(s, nparam);
1123 __isl_give isl_map *isl_map_read_from_str(struct isl_ctx *ctx,
1124 const char *str, int nparam)
1126 struct isl_map *map;
1127 struct isl_stream *s = isl_stream_new_str(ctx, str);
1130 map = map_read(s, nparam);
1135 __isl_give isl_set *isl_set_read_from_file(struct isl_ctx *ctx,
1136 FILE *input, int nparam)
1138 struct isl_map *map;
1139 map = isl_map_read_from_file(ctx, input, nparam);
1142 isl_assert(ctx, isl_map_n_in(map) == 0, goto error);
1143 return (struct isl_set *)map;
1149 struct isl_set *isl_set_read_from_str(struct isl_ctx *ctx,
1150 const char *str, int nparam)
1152 struct isl_map *map;
1153 map = isl_map_read_from_str(ctx, str, nparam);
1156 isl_assert(ctx, isl_map_n_in(map) == 0, goto error);
1157 return (struct isl_set *)map;
1163 static char *next_line(FILE *input, char *line, unsigned len)
1168 if (!(p = fgets(line, len, input)))
1170 while (isspace(*p) && *p != '\n')
1172 } while (*p == '#' || *p == '\n');
1177 static struct isl_vec *isl_vec_read_from_file_polylib(struct isl_ctx *ctx,
1180 struct isl_vec *vec = NULL;
1189 isl_assert(ctx, next_line(input, line, sizeof(line)), return NULL);
1190 isl_assert(ctx, sscanf(line, "%u", &size) == 1, return NULL);
1192 vec = isl_vec_alloc(ctx, size);
1194 p = next_line(input, line, sizeof(line));
1195 isl_assert(ctx, p, goto error);
1197 for (j = 0; j < size; ++j) {
1198 n = sscanf(p, "%s%n", val, &offset);
1199 isl_assert(ctx, n != 0, goto error);
1200 isl_int_read(vec->el[j], val);
1210 struct isl_vec *isl_vec_read_from_file(struct isl_ctx *ctx,
1211 FILE *input, unsigned input_format)
1213 if (input_format == ISL_FORMAT_POLYLIB)
1214 return isl_vec_read_from_file_polylib(ctx, input);
1216 isl_assert(ctx, 0, return NULL);