Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Smi read .cor with quadratic objective? #4

Closed
cheesecakeball opened this issue May 8, 2020 · 9 comments
Closed

Can Smi read .cor with quadratic objective? #4

cheesecakeball opened this issue May 8, 2020 · 9 comments

Comments

@cheesecakeball
Copy link

Hi,

I see that Smi has SmiQuadratic.hpp for quadratic objective function, and can solve QP through Clp. It is using readmps() function in CoinMpsIO to read .cor files. But in CoinMpsIO, the quadratic objective information is read through readQuadraticMps(). I did not find this function being called in Smi. My guess is that Smi cannot read .cor with quadratic objective but can solve QP? I appreciate your help!

@kingaj12
Copy link
Contributor

kingaj12 commented May 8, 2020

Hi @cheesecakeball

The readMps() method from CoinMpsIO is called here:

if (smiSmpsIO->readMps(c,core_ext[i]) == -1)

If you copy this logic just below, and replace readMps(..) with readQuadradicMps() then that should read the quadratic section of the core file.

The basic concept is that the class SmiSmpsIO inherits from CoinMpsIO, so that method is available. Can you try it and let me know if it works?

@bcdandurand
Copy link

Perhaps on a related note, in using the Smi library as a third-party library, I get a compile error:

${HOME}/COIN-OR/include/coin/SmiScnData.hpp:12:10: fatal error: SmiQuadratic.hpp: No such file or directory
 #include "SmiQuadratic.hpp"
          ^~~~~~~~~~~~~~~~~~
compilation terminated.

For my part, it is easy enough to copy SmiQuadratic.hpp into the include/coin directory to fix the issue (I don't think I'm using any of the interface specified in SmiQuadratic.hpp itself, so if my hack is a bad solution, it may not show in my code).

@kingaj12
Copy link
Contributor

Yeah that will work .. is ${COIN-OR}/include/coin a directory that you made?

@bcdandurand
Copy link

bcdandurand commented May 13, 2020

I have multiple COIN-OR git repositories in the directory named COIN-OR, which is the only directory I created myself with the mkdir command. In building each project from the git repository version, I run the configure scripts with argument --prefix=${HOME}/COIN-OR. All other directories are created automatically through the project specific configuration/make/install processes.

@bcdandurand
Copy link

bcdandurand commented May 13, 2020

Most COIN-OR project make install commands copied the header files into include/coin-or, but some header files went into include/coin, including Smi header files.

@kingaj12
Copy link
Contributor

Thanks. That helps. It looks like SmiQuadratic.hpp is left out of the install for some reason. I’ll try to track it down. For now, I think you have to copy it over.

@tkralphs
Copy link
Member

tkralphs commented May 14, 2020

We have recently made major changes to the build system that are backwards in compatible. One of those changes was to start installing headers in include/coin-or instead of include/coin. Versions of projects that still use the old build system (such as the current master branch of Smi) should not really be mixed with versions of dependent projects that use the new build system (primarily, all the master branches of the Cbc/Cgl/Clp/Osi/CoinUtils stack). Since the dependencies of Smi master are already on the current stable versions of dependent projects (see here), I guess the mixing must be happening because of projects @bcdandurand installed independently that are being found and linked to in configuration somehow. @bcdandurand if you use coinbrew to fetch everything, you'll be able to automagically switch all your dependencies to the right versions when building.

@kingaj12 in one of the future Webinars, we'll have a tutorial about the new build system and we can move Smi master to the new system and then create a new stable.

@svigerske
Copy link
Member

I've added the install of SmiQuadratic.hpp to the Makefile on master and stable/0.96. That should be sufficient to get it working if using the dependencies as specified in Dependencies file.

@kingaj12
Copy link
Contributor

kingaj12 commented May 14, 2020

Thanks @svigerske and @tkralphs for quick responses. And thanks @bcdandurand and @cheesecakeball for bringing this to our attention. And thanks GitHub for making such a nice platform for tracking issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants