glpk.LPX backward compatiblity?

心不动则不痛 提交于 2019-12-11 03:26:15

问题


Newer versions of glpk do not have the LPX api, which is required by older packages. How can I use an older package (like COBRA) with the newer versions of glpk?

Note that COBRA is available for MATLAB and Python. Both require glpk and the LPX api, and I would like to use both.


回答1:


Ideally you should switch to a version that uses the new API. It has been around for years. If that is no option, then the following entry in the ChangeLog to V4.53 points in the right direction

    * examples/oldapi/lpx.h, examples/oldapi/lpx.c
    A set of routines that simulate the old GLPK API (as defined
    in 4.48) were added. Thanks to Jan Engelhardt <jengelh@inai.de>
    for suggestion.

In the directory examples/oldapi of the source release you find everything you need. Excerpt from README:

The program module in this subdirectory contains an implementation of
the old GLPK API as it was defined in GLPK 4.48.

To compile an existing project using the old GLPK API you need to add
to the project two files lpx.h and lpx.c.


来源:https://stackoverflow.com/questions/25266593/glpk-lpx-backward-compatiblity

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!