add copyright statements
[isl.git] / include / isl_constraint.h
blob54c60e64128956e92d578be9d1f5e85d6fdfcd63
1 /*
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
8 */
10 #ifndef ISL_CONSTRAINT_H
11 #define ISL_CONSTRAINT_H
13 #include "isl_div.h"
14 #include "isl_set.h"
16 #if defined(__cplusplus)
17 extern "C" {
18 #endif
20 struct isl_constraint {
21 int ref;
22 struct isl_ctx *ctx;
24 struct isl_basic_map *bmap;
25 isl_int **line;
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,
32 isl_int **line);
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)
85 #endif
87 #endif