X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_morph.c;h=9fc39d2e0ad28194e6aa4442bb432e2d850f73c0;hb=de51a9bc4da5dd3f1f9f57c2362da6f9752c44e0;hp=bd5733dad890c7e380e73455dd6758cdf5ac76ed;hpb=fca879e2df368770ac56f0e005e934234092b22e;p=platform%2Fupstream%2Fisl.git diff --git a/isl_morph.c b/isl_morph.c index bd5733d..9fc39d2 100644 --- a/isl_morph.c +++ b/isl_morph.c @@ -1,7 +1,7 @@ /* * Copyright 2010 INRIA Saclay * - * Use of this software is governed by the GNU LGPLv2.1 license + * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, @@ -473,6 +473,10 @@ error: * We basically just call isl_mat_parameter_compression with the right input * and then extend the resulting matrix to include the variables. * + * The implementation assumes that "bset" does not have any equalities + * that only involve the parameters and that isl_basic_set_gauss has + * been applied to "bset". + * * Let the equalities be given as * * B(p) + A x = 0 @@ -509,7 +513,14 @@ __isl_give isl_morph *isl_basic_set_parameter_compression( nparam = isl_basic_set_dim(bset, isl_dim_param); nvar = isl_basic_set_dim(bset, isl_dim_set); - isl_assert(bset->ctx, n_eq <= nvar, return NULL); + if (isl_seq_first_non_zero(bset->eq[bset->n_eq - 1] + 1 + nparam, + nvar) == -1) + isl_die(isl_basic_set_get_ctx(bset), isl_error_invalid, + "input not allowed to have parameter equalities", + return NULL); + if (n_eq > nvar) + isl_die(isl_basic_set_get_ctx(bset), isl_error_invalid, + "input not gaussed", return NULL); d = isl_vec_alloc(bset->ctx, n_eq); B = isl_mat_sub_alloc6(bset->ctx, bset->eq, 0, n_eq, 0, 1 + nparam); @@ -520,7 +531,7 @@ __isl_give isl_morph *isl_basic_set_parameter_compression( H = isl_mat_right_inverse(H); if (!H || !d) goto error; - isl_seq_set(d->el, H->row[0][0], d->size); + d = isl_vec_set(d, H->row[0][0]); H = isl_mat_drop_rows(H, 0, 1); H = isl_mat_drop_cols(H, 0, 1); B = isl_mat_product(H, B); @@ -581,6 +592,7 @@ static __isl_give isl_basic_set *add_strides(__isl_take isl_basic_set *bset, div = isl_basic_set_alloc_div(bset); if (div < 0) goto error; + isl_int_set_si(bset->div[div][0], 0); k = isl_basic_set_alloc_equality(bset); if (k < 0) goto error;