I have problems finding documentation about the API works. I successfully installed the required libraries (I think), but now I try to create a mathematical program (MP) and it fails. I wonder if I am exploring the right path, and where I should look for documentation.
For example:
OsiSolverInterface osiSolver = new OsiCbcSolverInterface();
osiSolver.setColBounds(0, 0, 3);
outputs (in stderr) “Illegal index 0 in OsiClpSolverInterface::setColBounds
terminate called after throwing an instance of 'CoinError'”
Thus I guess I have to add the variable first, but how can I do that? Furthermore, the program just terminates instead of raising an Exception. Is this intended?
Looking to the OsiSolverInterface reference (http://www.coin-or.org/Doxygen/Osi/classOsiSolverInterface.html), I did not find relevant information about how to create an MP from scratch. Also, the name setting related calls described in the documentation (e.g. #setColName) do not seem to exist in the java OsiSolverInterface class.
Finally, the OS user manual (https://projects.coin-or.org/svn/OS/trunk/OS/doc/osUsersManual.pdf) suggests to use OSInstance class to build an MP (section 7.2 page 47; and section 10), for which I can't find a match in the swimp generated classes.
Thanks for any help.
Hi,
you can use one of the overloaded variants of OsiSolverInterface.addCols for adding columns (see http://www.coin-or.org/Doxygen/Osi/classOsiSolverInterface.html\). The setColName methods were added after the latest update of swIMP and are thus not yet included in the generated code. It would be fairly straight-forward to add them but I am afraid that I won't find the time for that soon.
swIMP is built on top of the OSI project. The OS project did not yet exist when swIMP was started. Hence, you do not find OSInstance in swIMP. It would definitely be possible and probably not too difficult to include the OS project in swIMP the same way as the OSI project.
Hope that helps.