Polly 20.0.0git
isl_pw_insert_dims_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 unsigned first, unsigned n)
13{
14 int i;
15 isl_size n_piece;
17 isl_space *space;
18
19 n_piece = FN(PW,n_piece)(pw);
20 if (n_piece < 0)
21 return FN(PW,free)(pw);
22 if (n == 0 && !isl_space_is_named_or_nested(pw->dim, type))
23 return pw;
24
26
27 space = FN(PW,take_space)(pw);
28 space = isl_space_insert_dims(space, type, first, n);
29 pw = FN(PW,restore_space)(pw, space);
30
31 for (i = 0; i < n_piece; ++i) {
33 EL *el;
34
35 domain = FN(PW,take_domain_at)(pw, i);
37 pw = FN(PW,restore_domain_at)(pw, i, domain);
38 el = FN(PW,take_base_at)(pw, i);
39 el = FN(EL,insert_dims)(el, type, first, n);
40 pw = FN(PW,restore_base_at)(pw, i, el);
41 }
42
43 return pw;
44}
45
47 unsigned n)
48{
50
51 pos = FN(PW,dim)(pw, type);
52 if (pos < 0)
53 return FN(PW,free)(pw);
54
55 return FN(PW,insert_dims)(pw, type, pos, n);
56}
#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 PW
Definition: isl_aff.c:4582
#define EL
static __isl_give isl_qpolynomial * insert_dims(__isl_take isl_qpolynomial *qp, void *user)
Definition: isl_fold.c:412
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
Definition: isl_map.c:70
isl_bool isl_space_is_named_or_nested(__isl_keep isl_space *space, enum isl_dim_type type)
Definition: isl_space.c:2877
enum isl_fold type
Definition: isl_test.c:4017
struct isl_set isl_set
Definition: map_type.h:26
__isl_give isl_set * isl_set_insert_dims(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, unsigned n)
Definition: isl_map.c:4187
__isl_give isl_space * isl_space_insert_dims(__isl_take isl_space *space, enum isl_dim_type type, unsigned pos, unsigned n)
Definition: isl_space.c:1312
isl_dim_type
Definition: space_type.h:13
@ isl_dim_in
Definition: space_type.h:16
@ isl_dim_set
Definition: space_type.h:18
static Signature domain
static Kind set_type
n
Definition: youcefn.c:8