There is an internal function to create a “standard form” version for inspecting the problem
## JuMP.jl/src/lp_sensitivity2.jl:
# Docstring:
# Given a problem:
#
# r_l <= Ax <= r_u
# c_l <= x <= c_u
#
# Return the standard form:
#
# [A -I] [x, y] = 0
# [c_l, r_l] <= [x, y] <= [c_u, r_u]
#
If you have an integral problem first do:
undo_relax = relax_integrality(rmodel);
then you can do
s = JuMP._standard_form_matrix(rmodel)
julia> keys(s)
(:columns, :lower, :upper, :A, :bounds, :constraints)
and
A = s.A
# If n is the number of variables in the original problem
# and m is the number of affine constraints in the problem
# then
m, p = size(s.A)
# where p == n + m.
# Hence, we can recover the "original" constraint matrix as
rA = A[:,1:(p-m)]
## Restore the original integral problem if necessary with:
undo_relax()
In the case of an existing equality constraint at row i, we have that
0 = r_l[i] <= y[i] <= r_u[i] = 0
; i.e. y[i] == 0
.