Forum Discussion

FICO's avatar
FICO
Community Manager
2 years ago

How to export LP problem definition w/XpressProblem

I used to create .lp files to help debug and share problem definitions on the old XPRBprob BCL class. This was done via prob.exportProb() (on an instance of XPRBprob). For the new XpressProblem interface I can't figure out how to generate an LP file, or at least some human readable file (.mps produced by prob.writeProb() isn't super easy to parse). Or since the XpressProblem extends the XPRSprob only, there is no way to create an LP file anymore?

2 Replies

  • FICO's avatar
    FICO
    Community Manager

    Hi William,

    Passing a filename ending with ".lp", or passing the "l" flag (lower case L) to writeProb will cause it to write an LP file:

    prob.writeProb("prob.lp")
    prob.writeProb("probfile", "l")
  • FICO's avatar
    FICO
    Community Manager

    Ah, yup that worked! And yeah thanks I was a little confused at the fact that a lot of the new XpressProblem stuff is just inherited from XPRSprob, which in its documentation mentions this flag.