Polly 19.0.0git
isl_multi_zero_templ.c
Go to the documentation of this file.
1/*
2 * Copyright 2012 Ecole Normale Superieure
3 *
4 * Use of this software is governed by the MIT license
5 *
6 * Written by Sven Verdoolaege,
7 * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
8 */
9
10#include <isl/space.h>
11#include <isl/local_space.h>
12
13#include <isl_multi_macro.h>
14
15/* Construct a multi expression in the given space with value zero in
16 * each of the output dimensions.
17 */
19{
20 isl_size n;
21 MULTI(BASE) *multi;
22
23 n = isl_space_dim(space , isl_dim_out);
24 if (n < 0)
25 goto error;
26
27 multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
28
29 if (!n)
30 isl_space_free(space);
31 else {
32 int i;
34 EL *el;
35
36 space = isl_space_domain(space);
38 el = FN(EL,zero_on_domain)(ls);
39
40 for (i = 0; i < n; ++i)
41 multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
42 FN(EL,copy)(el));
43
44 FN(EL,free)(el);
45 }
46
47 return multi;
48error:
49 isl_space_free(space);
50 return NULL;
51}
52
#define FN(TYPE, NAME)
#define __isl_take
Definition: ctx.h:22
#define __isl_give
Definition: ctx.h:19
int isl_size
Definition: ctx.h:96
#define BASE
Definition: flow_cmp.c:49
#define EL
#define MULTI(BASE)
const char * set
Definition: isl_test.c:1356
__isl_give isl_local_space * isl_local_space_from_space(__isl_take isl_space *space)
__isl_null isl_space * isl_space_free(__isl_take isl_space *space)
Definition: isl_space.c:445
__isl_give isl_space * isl_space_copy(__isl_keep isl_space *space)
Definition: isl_space.c:436
isl_size isl_space_dim(__isl_keep isl_space *space, enum isl_dim_type type)
Definition: isl_space.c:340
__isl_export __isl_give isl_space * isl_space_domain(__isl_take isl_space *space)
Definition: isl_space.c:2138
@ isl_dim_out
Definition: space_type.h:17
n
Definition: youcefn.c:8