Closed mhechthz closed 2 years ago
Looking at the code, it looks non-trivial to implement reading lp from a string since python-mip simply passes the file path to CBC.
Your easiest solution will probably be to save the lp data to a temporary file and then read it in (if that's possible in your situation)
Yes, I don’t think this would be simple, as it would require some integration with the procedures implemented in CoinUtils to parse the LPs. CoinUtils, to the best of my knowledge, does not have a C API.
From: Michael Jurasovic @.> Reply-To: coin-or/python-mip @.> Date: Thursday, November 18, 2021 at 2:33 PM To: coin-or/python-mip @.> Cc: Subscribed @.> Subject: Re: [coin-or/python-mip] Parse LP formulation from string (Issue #217)
Looking at the code, it looks non-trivial to implement reading lp from a string since python-mip simply passes the file path to CBC.
Your easiest solution will probably be to save the lp data to a temporary file and then read it in (if that's possible in your situation)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Yes, saving a temporary file would be the standard solution, but it is definitely not "beautiful". So I didn't want to miss to ask for this. If it is not or only difficult to solve, I go with the standard.
Thank You.
For a project I need to solve lp formulations coming from clients. I want to avoid storing the formulation in a file to get it parsed via
model.read("xxx.lp")
. Is it possible to hand over just a string containing the lp formulation, e.g. likemodel.parseLP(myLpFormulationString)
?Sorry, this is not an issue but a question or feature request. Didn't find the reight place for it.