coin-or / Cbc.old

This is a mirror of the subversion repository on COIN-OR
https://projects.coin-or.org/Cbc
Other
88 stars 30 forks source link

[Trac #138] writeMps() bug? #68

Open s-c-e opened 5 years ago

s-c-e commented 5 years ago

image

I am quite new to coin-or, so I might be wrong, yet there seems to be a bug regarding the writeMps() method.

Scenario: My objective function a quite simple minimization problem over a number of days, where I'd like to choose the earliest periods for each day. (Min Z = sum_days sum_periods p * choose_d,p )

For 2 days and 2 periods with indices {0,1}, that would equal 4 column with values {0,1,0,1}

The model works fine, yet when I try to print write the model to an mps file, the first column is omitted. Thus, reading it later will create another (incorrect) answer.

As the model is so simple, I just modified the coefficient to (p+1) as soon as I found the reason my answers were all wrong, yet I thought I'd at least should at least report this incident as a bug.