glpk.LPX向后兼容?

时间:2014-08-12 14:13:34

标签: python matlab glpk

较新版本的glpk没有LPX api,这是旧版程序包所必需的。 如何在较新版本的glpk中使用较旧的软件包(如COBRA)?

请注意,COBRA可用于MATLAB和Python。两者都需要glpkLPX api,我想同时使用它们。

1 个答案:

答案 0 :(得分:1)

理想情况下,您应切换到使用新API的版本。它已存在多年。如果这不是选项,那么ChangeLog到V4.53中的以下条目指向正确的方向

    * 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.

在源版本的目录examples/oldapi中,您可以找到所需的一切。摘自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.