__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);
+
+C<isl_multi_aff_scale_vec> scales the first elements of C<ma>
+by the corresponding elements of C<v>.
+
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_params(
__isl_take isl_pw_multi_aff *pma,
__isl_take isl_set *set);
#include <isl/list.h>
#include <isl/multi.h>
#include <isl/union_set_type.h>
+#include <isl/vec.h>
#if defined(__cplusplus)
extern "C" {
__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_range_splice(
__isl_take isl_multi_aff *ma1, unsigned pos,
/*
* Copyright 2011 INRIA Saclay
* Copyright 2011 Sven Verdoolaege
- * Copyright 2012 Ecole Normale Superieure
+ * Copyright 2012-2013 Ecole Normale Superieure
*
* Use of this software is governed by the MIT license
*
#define BASE pw_aff
#include <isl_multi_templ.c>
+
+/* 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;
+}