isl_bernstein.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. /*
  2. * Copyright 2006-2007 Universiteit Leiden
  3. * Copyright 2008-2009 Katholieke Universiteit Leuven
  4. * Copyright 2010 INRIA Saclay
  5. *
  6. * Use of this software is governed by the MIT license
  7. *
  8. * Written by Sven Verdoolaege, Leiden Institute of Advanced Computer Science,
  9. * Universiteit Leiden, Niels Bohrweg 1, 2333 CA Leiden, The Netherlands
  10. * and K.U.Leuven, Departement Computerwetenschappen, Celestijnenlaan 200A,
  11. * B-3001 Leuven, Belgium
  12. * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite,
  13. * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France
  14. */
  15. #include <isl_ctx_private.h>
  16. #include <isl_map_private.h>
  17. #include <isl/set.h>
  18. #include <isl_seq.h>
  19. #include <isl_morph.h>
  20. #include <isl_factorization.h>
  21. #include <isl_vertices_private.h>
  22. #include <isl_polynomial_private.h>
  23. #include <isl_options_private.h>
  24. #include <isl_vec_private.h>
  25. #include <isl_bernstein.h>
  26. struct bernstein_data {
  27. enum isl_fold type;
  28. isl_qpolynomial *poly;
  29. int check_tight;
  30. isl_cell *cell;
  31. isl_qpolynomial_fold *fold;
  32. isl_qpolynomial_fold *fold_tight;
  33. isl_pw_qpolynomial_fold *pwf;
  34. isl_pw_qpolynomial_fold *pwf_tight;
  35. };
  36. static isl_bool vertex_is_integral(__isl_keep isl_basic_set *vertex)
  37. {
  38. isl_size nvar;
  39. isl_size nparam;
  40. int i;
  41. nvar = isl_basic_set_dim(vertex, isl_dim_set);
  42. nparam = isl_basic_set_dim(vertex, isl_dim_param);
  43. if (nvar < 0 || nparam < 0)
  44. return isl_bool_error;
  45. for (i = 0; i < nvar; ++i) {
  46. int r = nvar - 1 - i;
  47. if (!isl_int_is_one(vertex->eq[r][1 + nparam + i]) &&
  48. !isl_int_is_negone(vertex->eq[r][1 + nparam + i]))
  49. return isl_bool_false;
  50. }
  51. return isl_bool_true;
  52. }
  53. static __isl_give isl_qpolynomial *vertex_coordinate(
  54. __isl_keep isl_basic_set *vertex, int i, __isl_take isl_space *space)
  55. {
  56. isl_size nvar;
  57. isl_size nparam;
  58. isl_size total;
  59. int r;
  60. isl_int denom;
  61. isl_qpolynomial *v;
  62. isl_int_init(denom);
  63. nvar = isl_basic_set_dim(vertex, isl_dim_set);
  64. nparam = isl_basic_set_dim(vertex, isl_dim_param);
  65. total = isl_basic_set_dim(vertex, isl_dim_all);
  66. if (nvar < 0 || nparam < 0 || total < 0)
  67. goto error;
  68. r = nvar - 1 - i;
  69. isl_int_set(denom, vertex->eq[r][1 + nparam + i]);
  70. isl_assert(vertex->ctx, !isl_int_is_zero(denom), goto error);
  71. if (isl_int_is_pos(denom))
  72. isl_seq_neg(vertex->eq[r], vertex->eq[r], 1 + total);
  73. else
  74. isl_int_neg(denom, denom);
  75. v = isl_qpolynomial_from_affine(space, vertex->eq[r], denom);
  76. isl_int_clear(denom);
  77. return v;
  78. error:
  79. isl_space_free(space);
  80. isl_int_clear(denom);
  81. return NULL;
  82. }
  83. /* Check whether the bound associated to the selection "k" is tight,
  84. * which is the case if we select exactly one vertex (i.e., one of the
  85. * exponents in "k" is exactly "d") and if that vertex
  86. * is integral for all values of the parameters.
  87. *
  88. * If the degree "d" is zero, then there are no exponents.
  89. * Since the polynomial is a constant expression in this case,
  90. * the bound is necessarily tight.
  91. */
  92. static isl_bool is_tight(int *k, int n, int d, isl_cell *cell)
  93. {
  94. int i;
  95. if (d == 0)
  96. return isl_bool_true;
  97. for (i = 0; i < n; ++i) {
  98. int v;
  99. if (!k[i])
  100. continue;
  101. if (k[i] != d)
  102. return isl_bool_false;
  103. v = cell->ids[n - 1 - i];
  104. return vertex_is_integral(cell->vertices->v[v].vertex);
  105. }
  106. return isl_bool_false;
  107. }
  108. static isl_stat add_fold(__isl_take isl_qpolynomial *b, __isl_keep isl_set *dom,
  109. int *k, int n, int d, struct bernstein_data *data)
  110. {
  111. isl_qpolynomial_fold *fold;
  112. isl_bool tight;
  113. fold = isl_qpolynomial_fold_alloc(data->type, b);
  114. tight = isl_bool_false;
  115. if (data->check_tight)
  116. tight = is_tight(k, n, d, data->cell);
  117. if (tight < 0)
  118. return isl_stat_error;
  119. if (tight)
  120. data->fold_tight = isl_qpolynomial_fold_fold_on_domain(dom,
  121. data->fold_tight, fold);
  122. else
  123. data->fold = isl_qpolynomial_fold_fold_on_domain(dom,
  124. data->fold, fold);
  125. return isl_stat_ok;
  126. }
  127. /* Extract the coefficients of the Bernstein base polynomials and store
  128. * them in data->fold and data->fold_tight.
  129. *
  130. * In particular, the coefficient of each monomial
  131. * of multi-degree (k[0], k[1], ..., k[n-1]) is divided by the corresponding
  132. * multinomial coefficient d!/k[0]! k[1]! ... k[n-1]!
  133. *
  134. * c[i] contains the coefficient of the selected powers of the first i+1 vars.
  135. * multinom[i] contains the partial multinomial coefficient.
  136. */
  137. static isl_stat extract_coefficients(isl_qpolynomial *poly,
  138. __isl_keep isl_set *dom, struct bernstein_data *data)
  139. {
  140. int i;
  141. int d;
  142. isl_size n;
  143. isl_ctx *ctx;
  144. isl_qpolynomial **c = NULL;
  145. int *k = NULL;
  146. int *left = NULL;
  147. isl_vec *multinom = NULL;
  148. n = isl_qpolynomial_dim(poly, isl_dim_in);
  149. if (n < 0)
  150. return isl_stat_error;
  151. ctx = isl_qpolynomial_get_ctx(poly);
  152. d = isl_qpolynomial_degree(poly);
  153. isl_assert(ctx, n >= 2, return isl_stat_error);
  154. c = isl_calloc_array(ctx, isl_qpolynomial *, n);
  155. k = isl_alloc_array(ctx, int, n);
  156. left = isl_alloc_array(ctx, int, n);
  157. multinom = isl_vec_alloc(ctx, n);
  158. if (!c || !k || !left || !multinom)
  159. goto error;
  160. isl_int_set_si(multinom->el[0], 1);
  161. for (k[0] = d; k[0] >= 0; --k[0]) {
  162. int i = 1;
  163. isl_qpolynomial_free(c[0]);
  164. c[0] = isl_qpolynomial_coeff(poly, isl_dim_in, n - 1, k[0]);
  165. left[0] = d - k[0];
  166. k[1] = -1;
  167. isl_int_set(multinom->el[1], multinom->el[0]);
  168. while (i > 0) {
  169. if (i == n - 1) {
  170. int j;
  171. isl_space *space;
  172. isl_qpolynomial *b;
  173. isl_qpolynomial *f;
  174. for (j = 2; j <= left[i - 1]; ++j)
  175. isl_int_divexact_ui(multinom->el[i],
  176. multinom->el[i], j);
  177. b = isl_qpolynomial_coeff(c[i - 1], isl_dim_in,
  178. n - 1 - i, left[i - 1]);
  179. b = isl_qpolynomial_project_domain_on_params(b);
  180. space = isl_qpolynomial_get_domain_space(b);
  181. f = isl_qpolynomial_rat_cst_on_domain(space,
  182. ctx->one, multinom->el[i]);
  183. b = isl_qpolynomial_mul(b, f);
  184. k[n - 1] = left[n - 2];
  185. if (add_fold(b, dom, k, n, d, data) < 0)
  186. goto error;
  187. --i;
  188. continue;
  189. }
  190. if (k[i] >= left[i - 1]) {
  191. --i;
  192. continue;
  193. }
  194. ++k[i];
  195. if (k[i])
  196. isl_int_divexact_ui(multinom->el[i],
  197. multinom->el[i], k[i]);
  198. isl_qpolynomial_free(c[i]);
  199. c[i] = isl_qpolynomial_coeff(c[i - 1], isl_dim_in,
  200. n - 1 - i, k[i]);
  201. left[i] = left[i - 1] - k[i];
  202. k[i + 1] = -1;
  203. isl_int_set(multinom->el[i + 1], multinom->el[i]);
  204. ++i;
  205. }
  206. isl_int_mul_ui(multinom->el[0], multinom->el[0], k[0]);
  207. }
  208. for (i = 0; i < n; ++i)
  209. isl_qpolynomial_free(c[i]);
  210. isl_vec_free(multinom);
  211. free(left);
  212. free(k);
  213. free(c);
  214. return isl_stat_ok;
  215. error:
  216. isl_vec_free(multinom);
  217. free(left);
  218. free(k);
  219. if (c)
  220. for (i = 0; i < n; ++i)
  221. isl_qpolynomial_free(c[i]);
  222. free(c);
  223. return isl_stat_error;
  224. }
  225. /* Perform bernstein expansion on the parametric vertices that are active
  226. * on "cell".
  227. *
  228. * data->poly has been homogenized in the calling function.
  229. *
  230. * We plug in the barycentric coordinates for the set variables
  231. *
  232. * \vec x = \sum_i \alpha_i v_i(\vec p)
  233. *
  234. * and the constant "1 = \sum_i \alpha_i" for the homogeneous dimension.
  235. * Next, we extract the coefficients of the Bernstein base polynomials.
  236. */
  237. static isl_stat bernstein_coefficients_cell(__isl_take isl_cell *cell,
  238. void *user)
  239. {
  240. int i, j;
  241. struct bernstein_data *data = (struct bernstein_data *)user;
  242. isl_space *space_param;
  243. isl_space *space_dst;
  244. isl_qpolynomial *poly = data->poly;
  245. isl_size n_in;
  246. unsigned nvar;
  247. int n_vertices;
  248. isl_qpolynomial **subs;
  249. isl_pw_qpolynomial_fold *pwf;
  250. isl_set *dom;
  251. isl_ctx *ctx;
  252. n_in = isl_qpolynomial_dim(poly, isl_dim_in);
  253. if (n_in < 0)
  254. goto error;
  255. nvar = n_in - 1;
  256. n_vertices = cell->n_vertices;
  257. ctx = isl_qpolynomial_get_ctx(poly);
  258. if (n_vertices > nvar + 1 && ctx->opt->bernstein_triangulate)
  259. return isl_cell_foreach_simplex(cell,
  260. &bernstein_coefficients_cell, user);
  261. subs = isl_alloc_array(ctx, isl_qpolynomial *, 1 + nvar);
  262. if (!subs)
  263. goto error;
  264. space_param = isl_basic_set_get_space(cell->dom);
  265. space_dst = isl_qpolynomial_get_domain_space(poly);
  266. space_dst = isl_space_add_dims(space_dst, isl_dim_set, n_vertices);
  267. for (i = 0; i < 1 + nvar; ++i)
  268. subs[i] =
  269. isl_qpolynomial_zero_on_domain(isl_space_copy(space_dst));
  270. for (i = 0; i < n_vertices; ++i) {
  271. isl_qpolynomial *c;
  272. c = isl_qpolynomial_var_on_domain(isl_space_copy(space_dst),
  273. isl_dim_set, 1 + nvar + i);
  274. for (j = 0; j < nvar; ++j) {
  275. int k = cell->ids[i];
  276. isl_qpolynomial *v;
  277. v = vertex_coordinate(cell->vertices->v[k].vertex, j,
  278. isl_space_copy(space_param));
  279. v = isl_qpolynomial_add_dims(v, isl_dim_in,
  280. 1 + nvar + n_vertices);
  281. v = isl_qpolynomial_mul(v, isl_qpolynomial_copy(c));
  282. subs[1 + j] = isl_qpolynomial_add(subs[1 + j], v);
  283. }
  284. subs[0] = isl_qpolynomial_add(subs[0], c);
  285. }
  286. isl_space_free(space_dst);
  287. poly = isl_qpolynomial_copy(poly);
  288. poly = isl_qpolynomial_add_dims(poly, isl_dim_in, n_vertices);
  289. poly = isl_qpolynomial_substitute(poly, isl_dim_in, 0, 1 + nvar, subs);
  290. poly = isl_qpolynomial_drop_dims(poly, isl_dim_in, 0, 1 + nvar);
  291. data->cell = cell;
  292. dom = isl_set_from_basic_set(isl_basic_set_copy(cell->dom));
  293. data->fold = isl_qpolynomial_fold_empty(data->type,
  294. isl_space_copy(space_param));
  295. data->fold_tight = isl_qpolynomial_fold_empty(data->type, space_param);
  296. if (extract_coefficients(poly, dom, data) < 0) {
  297. data->fold = isl_qpolynomial_fold_free(data->fold);
  298. data->fold_tight = isl_qpolynomial_fold_free(data->fold_tight);
  299. }
  300. pwf = isl_pw_qpolynomial_fold_alloc(data->type, isl_set_copy(dom),
  301. data->fold);
  302. data->pwf = isl_pw_qpolynomial_fold_fold(data->pwf, pwf);
  303. pwf = isl_pw_qpolynomial_fold_alloc(data->type, dom, data->fold_tight);
  304. data->pwf_tight = isl_pw_qpolynomial_fold_fold(data->pwf_tight, pwf);
  305. isl_qpolynomial_free(poly);
  306. isl_cell_free(cell);
  307. for (i = 0; i < 1 + nvar; ++i)
  308. isl_qpolynomial_free(subs[i]);
  309. free(subs);
  310. return isl_stat_ok;
  311. error:
  312. isl_cell_free(cell);
  313. return isl_stat_error;
  314. }
  315. /* Base case of applying bernstein expansion.
  316. *
  317. * We compute the chamber decomposition of the parametric polytope "bset"
  318. * and then perform bernstein expansion on the parametric vertices
  319. * that are active on each chamber.
  320. *
  321. * If the polynomial does not depend on the set variables
  322. * (and in particular if the number of set variables is zero)
  323. * then the bound is equal to the polynomial and
  324. * no actual bernstein expansion needs to be performed.
  325. */
  326. static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_base(
  327. __isl_take isl_basic_set *bset,
  328. __isl_take isl_qpolynomial *poly, struct bernstein_data *data,
  329. isl_bool *tight)
  330. {
  331. int degree;
  332. isl_size nvar;
  333. isl_space *space;
  334. isl_vertices *vertices;
  335. isl_bool covers;
  336. nvar = isl_basic_set_dim(bset, isl_dim_set);
  337. if (nvar < 0)
  338. bset = isl_basic_set_free(bset);
  339. if (nvar == 0)
  340. return isl_qpolynomial_cst_bound(bset, poly, data->type, tight);
  341. degree = isl_qpolynomial_degree(poly);
  342. if (degree < -1)
  343. bset = isl_basic_set_free(bset);
  344. if (degree <= 0)
  345. return isl_qpolynomial_cst_bound(bset, poly, data->type, tight);
  346. space = isl_basic_set_get_space(bset);
  347. space = isl_space_params(space);
  348. space = isl_space_from_domain(space);
  349. space = isl_space_add_dims(space, isl_dim_set, 1);
  350. data->pwf = isl_pw_qpolynomial_fold_zero(isl_space_copy(space),
  351. data->type);
  352. data->pwf_tight = isl_pw_qpolynomial_fold_zero(space, data->type);
  353. data->poly = isl_qpolynomial_homogenize(isl_qpolynomial_copy(poly));
  354. vertices = isl_basic_set_compute_vertices(bset);
  355. if (isl_vertices_foreach_disjoint_cell(vertices,
  356. &bernstein_coefficients_cell, data) < 0)
  357. data->pwf = isl_pw_qpolynomial_fold_free(data->pwf);
  358. isl_vertices_free(vertices);
  359. isl_qpolynomial_free(data->poly);
  360. isl_basic_set_free(bset);
  361. isl_qpolynomial_free(poly);
  362. covers = isl_pw_qpolynomial_fold_covers(data->pwf_tight, data->pwf);
  363. if (covers < 0)
  364. goto error;
  365. if (tight)
  366. *tight = covers;
  367. if (covers) {
  368. isl_pw_qpolynomial_fold_free(data->pwf);
  369. return data->pwf_tight;
  370. }
  371. data->pwf = isl_pw_qpolynomial_fold_fold(data->pwf, data->pwf_tight);
  372. return data->pwf;
  373. error:
  374. isl_pw_qpolynomial_fold_free(data->pwf_tight);
  375. isl_pw_qpolynomial_fold_free(data->pwf);
  376. return NULL;
  377. }
  378. /* Apply bernstein expansion recursively by working in on len[i]
  379. * set variables at a time, with i ranging from n_group - 1 to 0.
  380. */
  381. static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_recursive(
  382. __isl_take isl_pw_qpolynomial *pwqp,
  383. int n_group, int *len, struct bernstein_data *data, isl_bool *tight)
  384. {
  385. int i;
  386. isl_size nparam;
  387. isl_size nvar;
  388. isl_pw_qpolynomial_fold *pwf;
  389. nparam = isl_pw_qpolynomial_dim(pwqp, isl_dim_param);
  390. nvar = isl_pw_qpolynomial_dim(pwqp, isl_dim_in);
  391. if (nparam < 0 || nvar < 0)
  392. goto error;
  393. pwqp = isl_pw_qpolynomial_move_dims(pwqp, isl_dim_param, nparam,
  394. isl_dim_in, 0, nvar - len[n_group - 1]);
  395. pwf = isl_pw_qpolynomial_bound(pwqp, data->type, tight);
  396. for (i = n_group - 2; i >= 0; --i) {
  397. nparam = isl_pw_qpolynomial_fold_dim(pwf, isl_dim_param);
  398. if (nparam < 0)
  399. return isl_pw_qpolynomial_fold_free(pwf);
  400. pwf = isl_pw_qpolynomial_fold_move_dims(pwf, isl_dim_in, 0,
  401. isl_dim_param, nparam - len[i], len[i]);
  402. if (tight && !*tight)
  403. tight = NULL;
  404. pwf = isl_pw_qpolynomial_fold_bound(pwf, tight);
  405. }
  406. return pwf;
  407. error:
  408. isl_pw_qpolynomial_free(pwqp);
  409. return NULL;
  410. }
  411. static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_factors(
  412. __isl_take isl_basic_set *bset,
  413. __isl_take isl_qpolynomial *poly, struct bernstein_data *data,
  414. isl_bool *tight)
  415. {
  416. isl_factorizer *f;
  417. isl_set *set;
  418. isl_pw_qpolynomial *pwqp;
  419. isl_pw_qpolynomial_fold *pwf;
  420. f = isl_basic_set_factorizer(bset);
  421. if (!f)
  422. goto error;
  423. if (f->n_group == 0) {
  424. isl_factorizer_free(f);
  425. return bernstein_coefficients_base(bset, poly, data, tight);
  426. }
  427. set = isl_set_from_basic_set(bset);
  428. pwqp = isl_pw_qpolynomial_alloc(set, poly);
  429. pwqp = isl_pw_qpolynomial_morph_domain(pwqp, isl_morph_copy(f->morph));
  430. pwf = bernstein_coefficients_recursive(pwqp, f->n_group, f->len, data,
  431. tight);
  432. isl_factorizer_free(f);
  433. return pwf;
  434. error:
  435. isl_basic_set_free(bset);
  436. isl_qpolynomial_free(poly);
  437. return NULL;
  438. }
  439. static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_full_recursive(
  440. __isl_take isl_basic_set *bset,
  441. __isl_take isl_qpolynomial *poly, struct bernstein_data *data,
  442. isl_bool *tight)
  443. {
  444. int i;
  445. int *len;
  446. isl_size nvar;
  447. isl_pw_qpolynomial_fold *pwf;
  448. isl_set *set;
  449. isl_pw_qpolynomial *pwqp;
  450. nvar = isl_basic_set_dim(bset, isl_dim_set);
  451. if (nvar < 0 || !poly)
  452. goto error;
  453. len = isl_alloc_array(bset->ctx, int, nvar);
  454. if (nvar && !len)
  455. goto error;
  456. for (i = 0; i < nvar; ++i)
  457. len[i] = 1;
  458. set = isl_set_from_basic_set(bset);
  459. pwqp = isl_pw_qpolynomial_alloc(set, poly);
  460. pwf = bernstein_coefficients_recursive(pwqp, nvar, len, data, tight);
  461. free(len);
  462. return pwf;
  463. error:
  464. isl_basic_set_free(bset);
  465. isl_qpolynomial_free(poly);
  466. return NULL;
  467. }
  468. /* Compute a bound on the polynomial defined over the parametric polytope
  469. * using bernstein expansion and store the result
  470. * in bound->pwf and bound->pwf_tight.
  471. *
  472. * If bernstein_recurse is set to ISL_BERNSTEIN_FACTORS, we check if
  473. * the polytope can be factorized and apply bernstein expansion recursively
  474. * on the factors.
  475. * If bernstein_recurse is set to ISL_BERNSTEIN_INTERVALS, we apply
  476. * bernstein expansion recursively on each dimension.
  477. * Otherwise, we apply bernstein expansion on the entire polytope.
  478. */
  479. isl_stat isl_qpolynomial_bound_on_domain_bernstein(
  480. __isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly,
  481. struct isl_bound *bound)
  482. {
  483. struct bernstein_data data;
  484. isl_pw_qpolynomial_fold *pwf;
  485. isl_size nvar;
  486. isl_bool tight = isl_bool_false;
  487. isl_bool *tp = bound->check_tight ? &tight : NULL;
  488. nvar = isl_basic_set_dim(bset, isl_dim_set);
  489. if (nvar < 0 || !poly)
  490. goto error;
  491. data.type = bound->type;
  492. data.check_tight = bound->check_tight;
  493. if (bset->ctx->opt->bernstein_recurse & ISL_BERNSTEIN_FACTORS)
  494. pwf = bernstein_coefficients_factors(bset, poly, &data, tp);
  495. else if (nvar > 1 &&
  496. (bset->ctx->opt->bernstein_recurse & ISL_BERNSTEIN_INTERVALS))
  497. pwf = bernstein_coefficients_full_recursive(bset, poly, &data, tp);
  498. else
  499. pwf = bernstein_coefficients_base(bset, poly, &data, tp);
  500. if (tight)
  501. return isl_bound_add_tight(bound, pwf);
  502. else
  503. return isl_bound_add(bound, pwf);
  504. error:
  505. isl_basic_set_free(bset);
  506. isl_qpolynomial_free(poly);
  507. return isl_stat_error;
  508. }