是否可以在 Gurobi 中使用 C++ 中的元组?
Is it possible to use tuples in c++ with Gurobi?
我正在尝试在 C++ 项目中使用 Gurobi 解决 SOCP。据我所知,Gurobi 不支持复数,但我已经看到 python 可以使用元组作为变量,这将是一个很好的选择。
但是,我尝试在线搜索,但找不到任何有关在 C++ 中将元组与 Gurobi 结合使用的信息。有办法吗?
经过几天的更多研究(并在 Python 中实现了我需要的代码之后),我将 post 回答我自己的问题。在 Gurobi 文档中,开发人员承认 Python API 与其他编程语言的 API 相比提供了更多:
If you don't have a strong preference, we recommend that you use our Python® interface, which provides a number of benefits. First, Python is a very nice programming language that can be used for anything from experimentation to prototyping to deployment. Beyond this, though, our Python interface includes a set of higher-level modeling constructs that make it much easier to build optimization models.
因此,我 "solved" 通过使用 Python 脚本对 SOCP 进行建模和求解来解决问题,我的 C++ 代码调用该脚本并将优化结果传回其中过程。
我正在尝试在 C++ 项目中使用 Gurobi 解决 SOCP。据我所知,Gurobi 不支持复数,但我已经看到 python 可以使用元组作为变量,这将是一个很好的选择。
但是,我尝试在线搜索,但找不到任何有关在 C++ 中将元组与 Gurobi 结合使用的信息。有办法吗?
经过几天的更多研究(并在 Python 中实现了我需要的代码之后),我将 post 回答我自己的问题。在 Gurobi 文档中,开发人员承认 Python API 与其他编程语言的 API 相比提供了更多:
If you don't have a strong preference, we recommend that you use our Python® interface, which provides a number of benefits. First, Python is a very nice programming language that can be used for anything from experimentation to prototyping to deployment. Beyond this, though, our Python interface includes a set of higher-level modeling constructs that make it much easier to build optimization models.
因此,我 "solved" 通过使用 Python 脚本对 SOCP 进行建模和求解来解决问题,我的 C++ 代码调用该脚本并将优化结果传回其中过程。