Polly 19.0.0git
isl_pw_morph_templ.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 INRIA Saclay
3 *
4 * Use of this software is governed by the MIT license
5 *
6 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
7 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
8 * 91893 Orsay, France
9 */
10
12 __isl_take isl_morph *morph)
13{
14 int i;
15 isl_size n;
16 isl_ctx *ctx;
17 isl_space *space;
18
19 n = FN(PW,n_piece)(pw);
20 if (n < 0 || !morph)
21 goto error;
22
23 ctx = isl_space_get_ctx(pw->dim);
24 isl_assert(ctx, isl_space_is_domain_internal(morph->dom->dim, pw->dim),
25 goto error);
26
27 space = FN(PW,take_space)(pw);
29 isl_space_copy(morph->ran->dim), space);
30 pw = FN(PW,restore_space)(pw, space);
31
32 for (i = 0; i < n; ++i) {
34 EL *el;
35
36 domain = FN(PW,take_domain_at)(pw, i);
38 pw = FN(PW,restore_domain_at)(pw, i, domain);
39 el = FN(PW,take_base_at)(pw, i);
40 el = FN(EL,morph_domain)(el, isl_morph_copy(morph));
41 pw = FN(PW,restore_base_at)(pw, i, el);
42 }
43
44 isl_morph_free(morph);
45
46 return pw;
47error:
48 FN(PW,free)(pw);
49 isl_morph_free(morph);
50 return NULL;
51}
#define FN(TYPE, NAME)
#define __isl_take
Definition: ctx.h:22
#define __isl_give
Definition: ctx.h:19
#define isl_assert(ctx, test, code)
Definition: ctx.h:152
int isl_size
Definition: ctx.h:96
#define PW
Definition: isl_aff.c:4582
#define EL
static __isl_give isl_qpolynomial * morph_domain(__isl_take isl_qpolynomial *qp, void *user)
Definition: isl_fold.c:1597
__isl_give isl_set * isl_morph_set(__isl_take isl_morph *morph, __isl_take isl_set *set)
Definition: isl_morph.c:678
__isl_null isl_morph * isl_morph_free(__isl_take isl_morph *morph)
Definition: isl_morph.c:89
__isl_give isl_morph * isl_morph_copy(__isl_keep isl_morph *morph)
Definition: isl_morph.c:59
__isl_give isl_space * isl_space_extend_domain_with_range(__isl_take isl_space *space, __isl_take isl_space *model)
Definition: isl_space.c:3286
isl_bool isl_space_is_domain_internal(__isl_keep isl_space *space1, __isl_keep isl_space *space2)
Definition: isl_space.c:2599
struct isl_set isl_set
Definition: map_type.h:26
isl_ctx * isl_space_get_ctx(__isl_keep isl_space *space)
Definition: isl_space.c:23
__isl_give isl_space * isl_space_copy(__isl_keep isl_space *space)
Definition: isl_space.c:436
static Signature domain
n
Definition: youcefn.c:8