How to get the variables/constraint names using MathProgBase?

You can also use the QPSReader package.

Read an MPS file with

using QPSReader

qps = readqps("example.mps")

and you can then access all the problem data, for instance:

using SparseArrays

# Constraint matrix
A = sparse(qps.arows, qps.acols, qps.avals, qps.ncon, qps.nvar)

# Index --> variable name 
qps.varnames

# Variable name --> index
qps.varindices
1 Like