};
struct isl_div *isl_div_alloc(struct isl_dim *dim);
-struct isl_div *isl_basic_map_div(struct isl_basic_map *bmap, isl_int **line);
+struct isl_div *isl_basic_map_div(struct isl_basic_map *bmap, int pos);
struct isl_div *isl_div_free(struct isl_div *c);
void isl_div_get_constant(struct isl_div *div, isl_int *v);
isl_assert(constraint->ctx, pos < n(constraint, isl_dim_div),
return NULL);
- return isl_basic_map_div(isl_basic_map_copy(constraint->bmap),
- constraint->bmap->div+pos);
+ return isl_basic_map_div(isl_basic_map_copy(constraint->bmap), pos);
}
void isl_constraint_set_constant(struct isl_constraint *constraint, isl_int v)
}
}
-struct isl_div *isl_basic_map_div(struct isl_basic_map *bmap, isl_int **line)
+struct isl_div *isl_basic_map_div(struct isl_basic_map *bmap, int pos)
{
struct isl_div *div;
- if (!bmap || !line)
+ if (!bmap)
goto error;
+
+ isl_assert(bmap->ctx, pos < bmap->n_div, goto error);
div = isl_alloc_type(bmap->ctx, struct isl_div);
if (!div)
isl_ctx_ref(div->ctx);
div->ref = 1;
div->bmap = bmap;
- div->line = line;
+ div->line = &bmap->div[pos];
return div;
error:
isl_basic_map_alloc_div(bmap);
isl_seq_clr(bmap->div[0], 1 + 1 + isl_basic_map_total_dim(bmap));
- return isl_basic_map_div(bmap, &bmap->div[0]);
+ return isl_basic_map_div(bmap, 0);
}
struct isl_div *isl_div_free(struct isl_div *c)