* ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France
*/
-#include <isl_constraint.h>
+#include <isl_map_private.h>
+#include <isl/constraint.h>
#include <isl_dim_private.h>
-#include "isl_seq.h"
-#include "isl_map_private.h"
+#include <isl/seq.h>
static unsigned n(struct isl_constraint *c, enum isl_dim_type type)
{
return n(constraint, type);
}
+const char *isl_constraint_get_dim_name(__isl_keep isl_constraint *constraint,
+ enum isl_dim_type type, unsigned pos)
+{
+ return constraint ?
+ isl_basic_map_get_dim_name(constraint->bmap, type, pos) : NULL;
+}
+
void isl_constraint_get_constant(struct isl_constraint *constraint, isl_int *v)
{
if (!constraint)
isl_int_set(constraint->line[0][0], v);
}
+void isl_constraint_set_constant_si(__isl_keep isl_constraint *constraint,
+ int v)
+{
+ if (!constraint)
+ return;
+ isl_int_set_si(constraint->line[0][0], v);
+}
+
void isl_constraint_set_coefficient(struct isl_constraint *constraint,
enum isl_dim_type type, int pos, isl_int v)
{
isl_int_set(constraint->line[0][offset(constraint, type) + pos], v);
}
+void isl_constraint_set_coefficient_si(__isl_keep isl_constraint *constraint,
+ enum isl_dim_type type, int pos, int v)
+{
+ if (!constraint)
+ return;
+
+ isl_assert(constraint->ctx, pos < n(constraint, type), return);
+ isl_int_set_si(constraint->line[0][offset(constraint, type) + pos], v);
+}
+
void isl_constraint_clear(struct isl_constraint *constraint)
{
unsigned total;
lower = isl_basic_set_constraint(isl_basic_set_copy(bset),
&bset->eq[i]);
upper = isl_constraint_copy(lower);
- context = isl_basic_set_remove(isl_basic_set_copy(bset),
+ context = isl_basic_set_remove_dims(isl_basic_set_copy(bset),
type, pos, 1);
if (!lower || !upper || !context)
goto error;