isl_basic_set_compare_at: combine constraints before setting up objective
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 22 Dec 2008 15:25:34 +0000 (16:25 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 22 Dec 2008 15:25:34 +0000 (16:25 +0100)
The number of columns in the objective function should be equal
to the number of columns in the domain, but this number may change
during the call to add_constraints if bmap2 has any divs.

isl_map.c

index e3d6fb7..9aeb6d4 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -4610,6 +4610,7 @@ int isl_basic_set_compare_at(struct isl_basic_set *bset1,
        bmap1 = isl_basic_map_extend(bmap1, nparam,
                        pos, (dim1 - pos) + (dim2 - pos),
                        bmap2->n_div, bmap2->n_eq, bmap2->n_ineq);
+       bmap1 = add_constraints(bmap1, bmap2, 0, dim1 - pos);
        if (!bmap1)
                goto error;
        total = isl_basic_map_total_dim(bmap1);
@@ -4620,7 +4621,6 @@ int isl_basic_set_compare_at(struct isl_basic_set *bset1,
        isl_int_set_si(obj->block.data[nparam+pos+(dim1-pos)], -1);
        if (!obj)
                goto error;
-       bmap1 = add_constraints(bmap1, bmap2, 0, dim1 - pos);
        isl_int_init(num);
        isl_int_init(den);
        res = isl_solve_lp(bmap1, 0, obj->block.data, ctx->one, &num, &den);