2 * Copyright 2008-2009 Katholieke Universiteit Leuven
4 * Use of this software is governed by the GNU LGPLv2.1 license
6 * Written by Sven Verdoolaege, K.U.Leuven, Departement
7 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
10 #ifndef ISL_CONSTRAINT_H
11 #define ISL_CONSTRAINT_H
16 #if defined(__cplusplus)
20 struct isl_constraint
{
24 struct isl_basic_map
*bmap
;
27 typedef struct isl_constraint isl_constraint
;
29 __isl_give isl_constraint
*isl_equality_alloc(__isl_take isl_dim
*dim
);
30 __isl_give isl_constraint
*isl_inequality_alloc(__isl_take isl_dim
*dim
);
31 struct isl_constraint
*isl_basic_set_constraint(struct isl_basic_set
*bset
,
34 struct isl_constraint
*isl_constraint_cow(struct isl_constraint
*c
);
35 struct isl_constraint
*isl_constraint_copy(struct isl_constraint
*c
);
36 void isl_constraint_free(struct isl_constraint
*c
);
38 __isl_give isl_constraint
*isl_basic_map_first_constraint(
39 __isl_take isl_basic_map
*bmap
);
40 __isl_give isl_constraint
*isl_basic_set_first_constraint(
41 __isl_take isl_basic_set
*bset
);
42 struct isl_constraint
*isl_constraint_next(struct isl_constraint
*c
);
43 int isl_basic_map_foreach_constraint(__isl_keep isl_basic_map
*bmap
,
44 int (*fn
)(__isl_take isl_constraint
*c
, void *user
), void *user
);
45 int isl_basic_set_foreach_constraint(__isl_keep isl_basic_set
*bset
,
46 int (*fn
)(__isl_take isl_constraint
*c
, void *user
), void *user
);
47 int isl_constraint_is_equal(struct isl_constraint
*constraint1
,
48 struct isl_constraint
*constraint2
);
50 int isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set
*bset
,
51 enum isl_dim_type type
, unsigned pos
,
52 int (*fn
)(__isl_take isl_constraint
*lower
,
53 __isl_take isl_constraint
*upper
,
54 __isl_take isl_basic_set
*bset
, void *user
), void *user
);
56 __isl_give isl_basic_map
*isl_basic_map_add_constraint(
57 __isl_take isl_basic_map
*bmap
, __isl_take isl_constraint
*constraint
);
58 __isl_give isl_basic_set
*isl_basic_set_add_constraint(
59 __isl_take isl_basic_set
*bset
, __isl_take isl_constraint
*constraint
);
61 int isl_basic_set_has_defining_equality(
62 struct isl_basic_set
*bset
, enum isl_dim_type type
, int pos
,
63 struct isl_constraint
**constraint
);
64 int isl_basic_set_has_defining_inequalities(
65 struct isl_basic_set
*bset
, enum isl_dim_type type
, int pos
,
66 struct isl_constraint
**lower
,
67 struct isl_constraint
**upper
);
69 int isl_constraint_dim(struct isl_constraint
*constraint
,
70 enum isl_dim_type type
);
72 void isl_constraint_get_constant(__isl_keep isl_constraint
*constraint
,
74 void isl_constraint_get_coefficient(__isl_keep isl_constraint
*constraint
,
75 enum isl_dim_type type
, int pos
, isl_int
*v
);
76 void isl_constraint_set_constant(__isl_keep isl_constraint
*constraint
, isl_int v
);
77 void isl_constraint_set_coefficient(__isl_keep isl_constraint
*constraint
,
78 enum isl_dim_type type
, int pos
, isl_int v
);
80 __isl_give isl_div
*isl_constraint_div(__isl_keep isl_constraint
*constraint
,
82 struct isl_constraint
*isl_constraint_add_div(struct isl_constraint
*constraint
,
83 struct isl_div
*div
, int *pos
);
85 void isl_constraint_clear(struct isl_constraint
*constraint
);
86 struct isl_constraint
*isl_constraint_negate(struct isl_constraint
*constraint
);
88 int isl_constraint_is_equality(__isl_keep isl_constraint
*constraint
);
89 int isl_constraint_is_div_constraint(__isl_keep isl_constraint
*constraint
);
91 __isl_give isl_basic_map
*isl_basic_map_from_constraint(
92 __isl_take isl_constraint
*constraint
);
93 struct isl_basic_set
*isl_basic_set_from_constraint(
94 struct isl_constraint
*constraint
);
96 #if defined(__cplusplus)