diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2008-11-06 17:50:04 +0100 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2008-12-14 17:17:53 +0100 |
commit | 84037b07483c1970b915b7e829598a3cbd2c5d7f (patch) | |
tree | b0efa94433350653eac76284bcc292332634ca11 /isl_mat.c | |
parent | 325dce226c72cf48fe7343f481df065f3b1d766a (diff) | |
download | isl-84037b07483c1970b915b7e829598a3cbd2c5d7f.tar.gz isl-84037b07483c1970b915b7e829598a3cbd2c5d7f.tar.bz2 isl-84037b07483c1970b915b7e829598a3cbd2c5d7f.zip |
introduce isl_dim structure for representing shared dimension information
All of isl_basic_set, isl_set, isl_basic_map and isl_map stored
information about the dimension directly. This information is
now shared in a common isl_dim structure.
Direct accesses to the removed fields have been replaced by calls
to getters.
Diffstat (limited to 'isl_mat.c')
-rw-r--r-- | isl_mat.c | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -1,3 +1,4 @@ +#include "isl_dim.h" #include "isl_seq.h" #include "isl_mat.h" #include "isl_map_private.h" @@ -687,15 +688,18 @@ struct isl_basic_set *isl_basic_set_preimage(struct isl_ctx *ctx, if (!bset) goto error; - isl_assert(ctx, bset->nparam == 0, goto error); + isl_assert(ctx, bset->dim->nparam == 0, goto error); isl_assert(ctx, bset->n_div == 0, goto error); - isl_assert(ctx, 1+bset->dim == mat->n_row, goto error); + isl_assert(ctx, 1+bset->dim->n_out == mat->n_row, goto error); if (mat->n_col > mat->n_row) bset = isl_basic_set_extend(bset, 0, mat->n_col-1, 0, 0, 0); - else { - bset->dim -= mat->n_row - mat->n_col; + else if (mat->n_col < mat->n_row) { + bset->dim = isl_dim_cow(bset->dim); + if (!bset->dim) + goto error; + bset->dim->n_out -= mat->n_row - mat->n_col; bset->extra += mat->n_row - mat->n_col; } @@ -746,8 +750,13 @@ struct isl_set *isl_set_preimage(struct isl_ctx *ctx, if (!set->p[i]) goto error; } - set->dim += mat->n_col; - set->dim -= mat->n_row; + if (mat->n_col != mat->n_row) { + set->dim = isl_dim_cow(set->dim); + if (!set->dim) + goto error; + set->dim->n_out += mat->n_col; + set->dim->n_out -= mat->n_row; + } isl_mat_free(ctx, mat); return set; error: |