Thanks! This does not directly gives what I want but it should not be difficult to get what I want from these outputs:
model = Model()
@constraint(model, x >= 0)
@constraint(model, x <= 10)
@constraint(model, y >= 0)
@constraint(model, y <= 20-x)
@constraint(model, z >= -5)
@constraint(model, z <= 30-x-y)
undo_relax = relax_integrality(model)
s = JuMP._standard_form_matrix(model)
m, p = size(s.A)
A = s.A[:,1:(p-m)]
Thanks to some help I got on SO, I have this feature in Python, with SymPy.
def __getAb0(inequalities, symbols, required_type):
# 1. all inequalities are written with the same relational: < or <= or > or >=
# 2. For each inequality, LHS and RHS are linear in `symbols`
def get_ineq_with_correct_type(i, required_type):
if type(i) != required_type:
i = i.reversed
# extract all inequalities, process them so they are all of the same type and
# terms containing `symbols` are on the LHS.
ineq = 
for i in inequalities:
if isinstance(i, And):
[get_ineq_with_correct_type(a, required_type) for a in i.args]
# at this point, all inequalities should be of the same type.
# rewrite them as expressions: LHS - RHS
equations = [i.lhs - i.rhs for i in ineq]
return linear_eq_to_matrix(equations, symbols)
def getAb(inequalities, symbols):
Get the matrix-vector representation of a set of linear inequalities.
inequalities : list
list of symbolic inequalities
symbols : list
list of symbols
The matrix of the coefficients of the inequalities.
The vector made of the bounds of the inequalities.
>>> from pypolyhedralcubature.polyhedralcubature import getAb
>>> from sympy.abc import x, y, z
>>> # linear inequalities
>>> i1 = (x >= -5) & (x <= 4)
>>> i2 = (y >= -5) & (y <= 3 - x)
>>> i3 = (z >= -10) & (z <= 6 - x - y)
>>> # get matrix-vector representation of these inequalities
>>> A, b = getAb([i1, i2, i3], [x, y, z])
A, b = __getAb0(inequalities, symbols, LessThan)
return np.array(A), np.array(b)[:, 0]