Exporting the model to LP or MPS format in Mathopt #4327
Replies: 3 comments 2 replies
-
|
(Did not touch MathOpt yet) Following the code, it seem you should be able to that using a 2-step process: or-tools/ortools/math_opt/cpp/model.h // Returns a proto representation of the optimization model.
//
// See FromModelProto() to build a Model from a proto.
ModelProto ExportModel(bool remove_names = false) const;or-tools/ortools/math_opt/io/mps_converter.h // Returns the model in MPS format.
//
// The RemoveNames() function can be used on the model to remove names if they
// should not be exported.
absl::StatusOr<std::string> ModelProtoToMps(const ModelProto& model);Edit: Ah... Python... It seems the exporter is there (Sources) but imho |
Beta Was this translation helpful? Give feedback.
-
|
Python bindings for that function (MPS reading) were added a few weeks ago, they have not been exported to the open source project yet. The python bindings for reading LP format are still missing. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you @sschnug and @rma350 for your replies. I will wait for the next release 🙂 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello experts,
I am currently building models using the new MathOpt feature in Python. I would like to know how to export a given model to an LP file or MPS file. Previously, with pywraplp, we had the option of using 'solver.ExportModelAsMpsFormat'. Is there a similar feature available in MathOpt?
Beta Was this translation helpful? Give feedback.
All reactions