Skip to content

MPS files - .write() - mischanging QUADOBJ and QMATRIX? #2122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
phstratmann opened this issue Sep 7, 2021 · 0 comments · May be fixed by #3609
Open

MPS files - .write() - mischanging QUADOBJ and QMATRIX? #2122

phstratmann opened this issue Sep 7, 2021 · 0 comments · May be fixed by #3609

Comments

@phstratmann
Copy link

Hi,
First of all, thanks a lot for your great software!

While using it, I found one possible issue:
When I, for example, declare the quadratic objective function
problem.obj = pyo.Objective(expr = -1*problem.x[0]problem.x[0] + 4problem.x[0]*problem.x[1])
and write the problem to an MPS file,
problem.write("file_name")
then the objective function in the MPS-file looks like this:
QUADOBJ
x1 x1 -2
x1 x2 4
x2 x1 4

But according to my knowledge, this is the formulation if you use the QMATRIX keyword. For the QUADOBJ keyword, only the upper diagonal elements of the Q matrix are entered (http://www-eio.upc.edu/lceio/manuals/cplex-11/html/reffileformatscplex/reffileformatscplex13.html),
QUADOBJ
x1 x1 -2
x1 x2 4

In your code (Pyomo/pyomo/blob/main/pyomo/repn/plugins/mps.py l.705), I can see that you originally intended to write QMATRIX instead of QUADOBJ. Could you check if this is a correct or not?

Thanks a lot for your help!

@dansplain dansplain linked a pull request May 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant