isl_map_simplify.c: isl_basic_map_eliminate_vars: drop redundant mark removal
[isl.git] / isl_multi_zero_templ.c
bloba0561459e858560912ba6750dd4d2afb11472f71
1 /*
2 * Copyright 2012 Ecole Normale Superieure
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege,
7 * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
8 */
10 #include <isl/space.h>
11 #include <isl/local_space.h>
13 #include <isl_multi_macro.h>
15 /* Construct a multi expression in the given space with value zero in
16 * each of the output dimensions.
18 __isl_give MULTI(BASE) *FN(MULTI(BASE),zero)(__isl_take isl_space *space)
20 int n;
21 MULTI(BASE) *multi;
23 if (!space)
24 return NULL;
26 n = isl_space_dim(space , isl_dim_out);
27 multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
29 if (!n)
30 isl_space_free(space);
31 else {
32 int i;
33 isl_local_space *ls;
34 EL *el;
36 space = isl_space_domain(space);
37 ls = isl_local_space_from_space(space);
38 el = FN(EL,zero_on_domain)(ls);
40 for (i = 0; i < n; ++i)
41 multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
42 FN(EL,copy)(el));
44 FN(EL,free)(el);
47 return multi;