Simplex tableau


#1

Hi my freinds.
how to get simplex table in julia?
Thanks for your guidance


#2

Hello

If you are using CPLEX or Gurobi you can use functions from their C APIs. Here is an example of what I did for a model with 3 rows and 10 columns. Remeber to solve the LP relaxation before requesting the row.

function getrow(j, m)
    ci = m.internalModel.inner
    row = zeros(10)
    ccall((:CPXbinvarow,CPLEX.libcplex),Cint,(Ptr{Void},Ptr{Void},Cint,Ptr{Cdouble}),ci.env.ptr, ci.lp, j,row)
    return row
end

tableau = zeros(3,10)
for j in 0:2
    tableau[j+1,:] = getrow(j)
end

I hope it helps.
https://www.ibm.com/support/knowledgecenter/SSSA5P_12.5.0/ilog.odms.cplex.help/refcallablelibrary/html/functions/CPXbinvarow.html

Also check slides 17-22 of the seminar I did on JuMP
http://egon.cheme.cmu.edu/ewo/docs/EWO_Seminar_03_10_2017.pdf

regards!