From fbf002808c0c82f7f5d8e155ff4afe7687a10460 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 4 Aug 2010 15:52:25 +0200 Subject: [PATCH] add isl_pw_qpolynomial_insert_dims Signed-off-by: Sven Verdoolaege --- include/isl_polynomial.h | 6 ++++++ isl_polynomial.c | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/include/isl_polynomial.h b/include/isl_polynomial.h index 4515183..717be26 100644 --- a/include/isl_polynomial.h +++ b/include/isl_polynomial.h @@ -57,6 +57,9 @@ __isl_give isl_qpolynomial *isl_qpolynomial_sub(__isl_take isl_qpolynomial *qp1, __isl_give isl_qpolynomial *isl_qpolynomial_mul(__isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2); +__isl_give isl_qpolynomial *isl_qpolynomial_insert_dims( + __isl_take isl_qpolynomial *qp, enum isl_dim_type type, + unsigned first, unsigned n); __isl_give isl_qpolynomial *isl_qpolynomial_add_dims( __isl_take isl_qpolynomial *qp, enum isl_dim_type type, unsigned n); __isl_give isl_qpolynomial *isl_qpolynomial_move_dims( @@ -160,6 +163,9 @@ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul( __isl_take isl_pw_qpolynomial *pwqp1, __isl_take isl_pw_qpolynomial *pwqp2); +__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_insert_dims( + __isl_take isl_pw_qpolynomial *pwqp, enum isl_dim_type type, + unsigned first, unsigned n); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_dims( __isl_take isl_pw_qpolynomial *pwqp, enum isl_dim_type type, unsigned n); diff --git a/isl_polynomial.c b/isl_polynomial.c index 1bfff5c..bf51598 100644 --- a/isl_polynomial.c +++ b/isl_polynomial.c @@ -2115,9 +2115,9 @@ __isl_give isl_qpolynomial *isl_qpolynomial_add_dims( return isl_qpolynomial_insert_dims(qp, type, pos, n); } -__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_dims( - __isl_take isl_pw_qpolynomial *pwqp, - enum isl_dim_type type, unsigned n) +__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_insert_dims( + __isl_take isl_pw_qpolynomial *pwqp, enum isl_dim_type type, + unsigned first, unsigned n) { int i; @@ -2128,15 +2128,16 @@ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_dims( if (!pwqp) return NULL; - pwqp->dim = isl_dim_add(pwqp->dim, type, n); + pwqp->dim = isl_dim_insert(pwqp->dim, type, first, n); if (!pwqp->dim) goto error; for (i = 0; i < pwqp->n; ++i) { - pwqp->p[i].set = isl_set_add(pwqp->p[i].set, type, n); + pwqp->p[i].set = isl_set_insert(pwqp->p[i].set, type, first, n); if (!pwqp->p[i].set) goto error; - pwqp->p[i].qp = isl_qpolynomial_add_dims(pwqp->p[i].qp, type, n); + pwqp->p[i].qp = isl_qpolynomial_insert_dims(pwqp->p[i].qp, + type, first, n); if (!pwqp->p[i].qp) goto error; } @@ -2147,6 +2148,17 @@ error: return NULL; } +__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_dims( + __isl_take isl_pw_qpolynomial *pwqp, + enum isl_dim_type type, unsigned n) +{ + unsigned pos; + + pos = isl_pw_qpolynomial_dim(pwqp, type); + + return isl_pw_qpolynomial_insert_dims(pwqp, type, pos, n); +} + static int *reordering_move(isl_ctx *ctx, unsigned len, unsigned dst, unsigned src, unsigned n) { -- 2.7.4