privately export isl_basic_map_fast_cmp and isl_basic_map_fast_is_equal
[platform/upstream/isl.git] / include / isl_dim.h
1 /*
2  * Copyright 2008-2009 Katholieke Universiteit Leuven
3  *
4  * Use of this software is governed by the GNU LGPLv2.1 license
5  *
6  * Written by Sven Verdoolaege, K.U.Leuven, Departement
7  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
8  */
9
10 #ifndef ISL_DIM_H
11 #define ISL_DIM_H
12
13 #include <isl_ctx.h>
14
15 #if defined(__cplusplus)
16 extern "C" {
17 #endif
18
19 struct isl_name;
20 struct isl_dim {
21         int ref;
22
23         struct isl_ctx *ctx;
24
25         unsigned nparam;
26         unsigned n_in;          /* zero for sets */
27         unsigned n_out;         /* dim for sets */
28
29         unsigned n_name;
30         struct isl_name **names;
31 };
32 typedef struct isl_dim isl_dim;
33
34 enum isl_dim_type {
35         isl_dim_param,
36         isl_dim_in,
37         isl_dim_out,
38         isl_dim_set = isl_dim_out,
39         isl_dim_div,
40         isl_dim_all
41 };
42
43 __isl_give isl_dim *isl_dim_alloc(isl_ctx *ctx,
44                         unsigned nparam, unsigned n_in, unsigned n_out);
45 __isl_give isl_dim *isl_dim_set_alloc(isl_ctx *ctx,
46                         unsigned nparam, unsigned dim);
47 __isl_give isl_dim *isl_dim_copy(__isl_keep isl_dim *dim);
48 struct isl_dim *isl_dim_cow(struct isl_dim *dim);
49 void isl_dim_free(__isl_take isl_dim *dim);
50
51 __isl_give isl_dim *isl_dim_set_name(__isl_take isl_dim *dim,
52                                  enum isl_dim_type type, unsigned pos,
53                                  __isl_keep const char *name);
54 __isl_keep const char *isl_dim_get_name(__isl_keep isl_dim *dim,
55                                  enum isl_dim_type type, unsigned pos);
56
57 struct isl_dim *isl_dim_extend(struct isl_dim *dim,
58                         unsigned nparam, unsigned n_in, unsigned n_out);
59 struct isl_dim *isl_dim_add(struct isl_dim *dim, enum isl_dim_type type,
60                 unsigned n);
61 __isl_give isl_dim *isl_dim_move(__isl_take isl_dim *dim,
62         enum isl_dim_type dst_type, unsigned dst_pos,
63         enum isl_dim_type src_type, unsigned src_pos, unsigned n);
64 __isl_give isl_dim *isl_dim_insert(__isl_take isl_dim *dim,
65         enum isl_dim_type type, unsigned pos, unsigned n);
66 struct isl_dim *isl_dim_join(struct isl_dim *left, struct isl_dim *right);
67 struct isl_dim *isl_dim_product(struct isl_dim *left, struct isl_dim *right);
68 struct isl_dim *isl_dim_map(struct isl_dim *dim);
69 struct isl_dim *isl_dim_reverse(struct isl_dim *dim);
70 struct isl_dim *isl_dim_drop(struct isl_dim *dim, enum isl_dim_type type,
71                 unsigned first, unsigned num);
72 struct isl_dim *isl_dim_drop_inputs(struct isl_dim *dim,
73                 unsigned first, unsigned n);
74 struct isl_dim *isl_dim_drop_outputs(struct isl_dim *dim,
75                 unsigned first, unsigned n);
76 struct isl_dim *isl_dim_domain(struct isl_dim *dim);
77 struct isl_dim *isl_dim_range(struct isl_dim *dim);
78 struct isl_dim *isl_dim_underlying(struct isl_dim *dim, unsigned n_div);
79
80 int isl_dim_equal(struct isl_dim *dim1, struct isl_dim *dim2);
81 int isl_dim_match(struct isl_dim *dim1, enum isl_dim_type dim1_type,
82                 struct isl_dim *dim2, enum isl_dim_type dim2_type);
83 int isl_dim_compatible(struct isl_dim *dim1, struct isl_dim *dim2);
84 unsigned isl_dim_size(__isl_keep isl_dim *dim, enum isl_dim_type type);
85 unsigned isl_dim_total(struct isl_dim *dim);
86
87 #if defined(__cplusplus)
88 }
89 #endif
90
91 #endif