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_constraint_is_equal(struct isl_constraint
*constraint1
,
44 struct isl_constraint
*constraint2
);
46 __isl_give isl_basic_map
*isl_basic_map_add_constraint(
47 __isl_take isl_basic_map
*bmap
, __isl_take isl_constraint
*constraint
);
48 __isl_give isl_basic_set
*isl_basic_set_add_constraint(
49 __isl_take isl_basic_set
*bset
, __isl_take isl_constraint
*constraint
);
51 int isl_basic_set_has_defining_equality(
52 struct isl_basic_set
*bset
, enum isl_dim_type type
, int pos
,
53 struct isl_constraint
**constraint
);
54 int isl_basic_set_has_defining_inequalities(
55 struct isl_basic_set
*bset
, enum isl_dim_type type
, int pos
,
56 struct isl_constraint
**lower
,
57 struct isl_constraint
**upper
);
59 int isl_constraint_dim(struct isl_constraint
*constraint
,
60 enum isl_dim_type type
);
62 void isl_constraint_get_constant(struct isl_constraint
*constraint
, isl_int
*v
);
63 void isl_constraint_get_coefficient(struct isl_constraint
*constraint
,
64 enum isl_dim_type type
, int pos
, isl_int
*v
);
65 void isl_constraint_set_constant(__isl_keep isl_constraint
*constraint
, isl_int v
);
66 void isl_constraint_set_coefficient(__isl_keep isl_constraint
*constraint
,
67 enum isl_dim_type type
, int pos
, isl_int v
);
69 struct isl_div
*isl_constraint_div(struct isl_constraint
*constraint
, int pos
);
70 struct isl_constraint
*isl_constraint_add_div(struct isl_constraint
*constraint
,
71 struct isl_div
*div
, int *pos
);
73 void isl_constraint_clear(struct isl_constraint
*constraint
);
74 struct isl_constraint
*isl_constraint_negate(struct isl_constraint
*constraint
);
76 int isl_constraint_is_equality(struct isl_constraint
*constraint
);
78 __isl_give isl_basic_map
*isl_basic_map_from_constraint(
79 __isl_take isl_constraint
*constraint
);
80 struct isl_basic_set
*isl_basic_set_from_constraint(
81 struct isl_constraint
*constraint
);
83 #if defined(__cplusplus)