- if list(self.inequalities): #check if any inequalities exist
- for ineq in self.inequalities:
- coeff_in = dict(ineq.coefficients())
- if ineq.constant:
- value = ineq.constant
- cin = libisl.isl_constraint_set_constant_si(cin, value)
- for ineq in coeff_in:
- num = coeff_in.get(ineq)
- iden = symbols.index(ineq)
- cin = libisl.isl_constraint_set_coefficient_si(cin, libisl.isl_dim_set, iden, num) #use 3 for type isl_dim_set
+ for inequality in self.inequalities:
+ cin = libisl.isl_inequality_alloc(libisl.isl_local_space_copy(ls))
+ for symbol, coefficient in inequality.coefficients():
+ val = str(coefficient).encode()
+ val = libisl.isl_val_read_from_str(_main_ctx, val)
+ dim = symbols.index(symbol)
+ cin = libisl.isl_constraint_set_coefficient_val(cin, libisl.isl_dim_set, dim, val)
+ if inequality.constant != 0:
+ val = str(ineq.constant).encode()
+ val = libisl.isl_val_read_from_str(_main_ctx, val)
+ cin = libisl.isl_constraint_set_constant_val(cin, val)