[Coin-discuss] Python port of OSI

Leo Lopes leo at sie.arizona.edu
Mon May 19 10:23:39 EDT 2008


Hi Andrea,

I already have such a port using SWIG. I have contributed it before. I
have attached the .i file to this email, along with a Makefile, a set
of commands that illustrates the wrapper and the expected output.
Hopefully it will be helpful to you.

cheers,
Leo.



On Mon, May 19, 2008 at 7:11 AM, Andrea Nerli <anerli at mbigroup.it> wrote:
> Hi all,
>
> I'm working on a python module to use OSISolverInterface
> ( using Boost-python ). The idea is to have a pyOSI.so (dll in Windows)
> to do something as:
>
> import pyOSI
>
> theSI = pyOSI.getOsiClp()
>
> #Read in an mps file.  This one's from the MIPLIB library.
> #si->readMps("../../Data/Sample/p0033");
> theSI.readMps("p0033")
>
> #Solve the (relaxation of the) problem
> theSI.initialSolve()
>
> #Check the solution
> if ( theSI.isProvenOptimal() ):
>       print "Found optimal solution!"
>       print "Objective value is %f" % theSI.getObjValue()
>       n = theSI.getNumCols()
>       solution = theSI.getColSolution()
>       for i in solution:
>             print i
>
> else:
>       print "Didn't find optimal solution."
>
> and this is what I have done at the moment.
> Please, let me know if someone is interested.
> Thanks,
> Andrea
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
>



-- 
========================================================================
Leonardo B. Lopes
Assistant Professor SIE - University of Arizona
(520)621-2342
leo at sie.arizona.edu
http://www.sie.arizona.edu/faculty/leolopes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 798 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20080519/daaaad3b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osi.i
Type: application/octet-stream
Size: 13001 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20080519/daaaad3b/attachment-0001.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testOsi.txt
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20080519/daaaad3b/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testOsiCommands.txt
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20080519/daaaad3b/attachment-0001.txt>


More information about the Coin-discuss mailing list