From f04492f2cd692fea0e0628fcf2b2eff546690f57 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 18 Jun 2013 12:32:05 +0200 Subject: [PATCH] remove *_scale_vec functions They have been superseded by *_scale_multi_val functions, which provide a nicer interface. Since the *_scale_vec functions were introduced after the latest release, removing them does not cause any backward compatibility problems. Signed-off-by: Sven Verdoolaege --- doc/user.pod | 11 ------- include/isl/aff.h | 7 ---- isl_aff.c | 98 ------------------------------------------------------- 3 files changed, 116 deletions(-) diff --git a/doc/user.pod b/doc/user.pod index 4590af8c..12f1cefa 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -4401,20 +4401,9 @@ C subtracts the second argument from the first. isl_union_pw_multi_aff_scale_multi_val( __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_multi_val *mv); - __isl_give isl_multi_aff *isl_multi_aff_scale_vec( - __isl_take isl_multi_aff *ma, - __isl_take isl_vec *v); - __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_vec( - __isl_take isl_pw_multi_aff *pma, - __isl_take isl_vec *v); - __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_scale_vec( - __isl_take isl_union_pw_multi_aff *upma, - __isl_take isl_vec *v); C scales the elements of C by the corresponding elements of C. -C scales the first elements of C -by the corresponding elements of C. __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_params( __isl_take isl_pw_multi_aff *pma, diff --git a/include/isl/aff.h b/include/isl/aff.h index 8aa9e357..eb85f4ab 100644 --- a/include/isl/aff.h +++ b/include/isl/aff.h @@ -9,7 +9,6 @@ #include #include #include -#include #if defined(__cplusplus) extern "C" { @@ -311,8 +310,6 @@ __isl_give isl_multi_aff *isl_multi_aff_sub(__isl_take isl_multi_aff *ma1, __isl_give isl_multi_aff *isl_multi_aff_scale(__isl_take isl_multi_aff *maff, isl_int f); -__isl_give isl_multi_aff *isl_multi_aff_scale_vec(__isl_take isl_multi_aff *ma, - __isl_take isl_vec *v); __isl_give isl_multi_aff *isl_multi_aff_product( __isl_take isl_multi_aff *ma1, __isl_take isl_multi_aff *ma2); @@ -411,8 +408,6 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_val( __isl_take isl_pw_multi_aff *pma, __isl_take isl_val *v); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_multi_val( __isl_take isl_pw_multi_aff *pma, __isl_take isl_multi_val *mv); -__isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_vec( - __isl_take isl_pw_multi_aff *pma, __isl_take isl_vec *v); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmin( __isl_take isl_pw_multi_aff *pma1, @@ -502,8 +497,6 @@ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_sub( __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_scale_multi_val( __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_multi_val *mv); -__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_scale_vec( - __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_vec *v); __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_flat_range_product( __isl_take isl_union_pw_multi_aff *upma1, diff --git a/isl_aff.c b/isl_aff.c index 96ded4a9..3b2d20e1 100644 --- a/isl_aff.c +++ b/isl_aff.c @@ -5186,104 +5186,6 @@ error: #include -/* Scale the first elements of "ma" by the corresponding elements of "vec". - */ -__isl_give isl_multi_aff *isl_multi_aff_scale_vec(__isl_take isl_multi_aff *ma, - __isl_take isl_vec *vec) -{ - int i, n; - isl_int v; - - if (!ma || !vec) - goto error; - - n = isl_multi_aff_dim(ma, isl_dim_out); - if (isl_vec_size(vec) < n) - n = isl_vec_size(vec); - - isl_int_init(v); - for (i = 0; i < n; ++i) { - isl_aff *aff; - - isl_vec_get_element(vec, i, &v); - - aff = isl_multi_aff_get_aff(ma, i); - aff = isl_aff_scale(aff, v); - ma = isl_multi_aff_set_aff(ma, i, aff); - } - isl_int_clear(v); - - isl_vec_free(vec); - return ma; -error: - isl_vec_free(vec); - isl_multi_aff_free(ma); - return NULL; -} - -/* Scale the first elements of "pma" by the corresponding elements of "vec". - */ -__isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_vec( - __isl_take isl_pw_multi_aff *pma, __isl_take isl_vec *v) -{ - int i; - - pma = isl_pw_multi_aff_cow(pma); - if (!pma || !v) - goto error; - - for (i = 0; i < pma->n; ++i) { - pma->p[i].maff = isl_multi_aff_scale_vec(pma->p[i].maff, - isl_vec_copy(v)); - if (!pma->p[i].maff) - goto error; - } - - isl_vec_free(v); - return pma; -error: - isl_vec_free(v); - isl_pw_multi_aff_free(pma); - return NULL; -} - -/* This function is called for each entry of an isl_union_pw_multi_aff. - * Replace the entry by the result of applying isl_pw_multi_aff_scale_vec - * to the original entry with the isl_vec in "user" as extra argument. - */ -static int union_pw_multi_aff_scale_vec_entry(void **entry, void *user) -{ - isl_pw_multi_aff **pma = (isl_pw_multi_aff **) entry; - isl_vec *v = user; - - *pma = isl_pw_multi_aff_scale_vec(*pma, isl_vec_copy(v)); - if (!*pma) - return -1; - - return 0; -} - -/* Scale the first elements of "upma" by the corresponding elements of "vec". - */ -__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_scale_vec( - __isl_take isl_union_pw_multi_aff *upma, __isl_take isl_vec *v) -{ - upma = isl_union_pw_multi_aff_cow(upma); - if (!upma || !v) - goto error; - - if (isl_hash_table_foreach(upma->dim->ctx, &upma->table, - &union_pw_multi_aff_scale_vec_entry, v) < 0) - goto error; - - isl_vec_free(v); - return upma; -error: - isl_vec_free(v); - isl_union_pw_multi_aff_free(upma); - return NULL; -} - /* Scale the elements of "pma" by the corresponding elements of "mv". */ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_multi_val( -- 2.11.4.GIT