JuliaOpt / MathProgBase.jl

DEPRECATED: Solver-independent functions (i.e. linprog and mixintprog) and low-level interface for Mathematical Programming
Other
80 stars 38 forks source link

loadproblem!() for conic problems won't load SDPs into Mosek #211

Open leoliberti opened 6 years ago

leoliberti commented 6 years ago

Hi,

in http://mathprogbasejl.readthedocs.io/en/latest/conic.html, the loadproblem!() function applied to conic problems is explained in rather abstract terms. The first sentence explains what the function does, which is "load the conic problem in primal form into the model".

From the context (e.g. the MosekSolver() mentioned at the beginning of the page), I surmised that I could read any CBF file (e.g. using the ConicBenchmarkUtilities), then load it up in memory using loadproblem!(), and finally solve it using e.g. Mosek. By "any CBF" I mean "any, including those encoding an SDP" --- and since no exceptions for SDPs are mentioned in the manual page, I think it was a fair assumption.

After a few hours of toil I launched my Julia script, which told me that loadproblem!() was undefined. A few minutes of source examination told me that loadproblem!()'s sole purpose is to be able to load up SOCPs into a quadratic solver. Moreover, I am guessing that I should somehow load up the lpqp_to_conic.jl source file, where loadproblem!() is actually defined -- but this is also not explained in the documentation. Moreover, it would help if there were some code examples in the docs.

Note that I don't mean for this issue to be about the documentation. Actually, I would like loadproblem() to conform to the existing documentation! I.e. I'd like to load up a CBF data for an SDP using loadproblem!() rather than the modelling environment (i.e. @variable @constraint and so on) so as not to waste CPU time with the modelling itself, and then solve it calling Mosek. How far are we from the MathProgBase code achieving this purpose?

Thanks Yours Leo Liberti

blegat commented 6 years ago

told me that loadproblem!() was undefined

You need to do MathProgBase.SolverInterface.loadproblem!.

leoliberti commented 6 years ago

Thanks Benoit, this addresses the "how to call it" question, but does not address the issue that this function will not load up an SDP problem into memory so it can be passed to an SDP solver (as its declared usage would suggest).

blegat commented 6 years ago

What do you mean by that ? Could you show an example showing that it does not work ?

mlubin commented 6 years ago

From the context (e.g. the MosekSolver() mentioned at the beginning of the page), I surmised that I could read any CBF file (e.g. using the ConicBenchmarkUtilities), then load it up in memory using loadproblem!(), and finally solve it using e.g. Mosek. By "any CBF" I mean "any, including those encoding an SDP" --- and since no exceptions for SDPs are mentioned in the manual page, I think it was a fair assumption.

That's correct, there's an example of doing exactly this here: https://github.com/mlubin/ConicBenchmarkUtilities.jl/blob/b127d60549ca9fcc6fb9ceb3e77259704eefa266/test/runtests.jl#L290