【发布时间】:2020-06-29 12:39:03
【问题描述】:
我在 C++ 界面中使用 Gurobi 求解器。我需要使用
int GRBgetBasisHead (GRBmodel *model, int *bhead)
我创建了我的模型:
GRBModel model1 = GRBModel(env);
我收到以下错误
error: cannot convert ‘GRBModel*’ to ‘GRBmodel* {aka _GRBmodel*}’ for argument ‘1’ to ‘int GRBgetBasisHead(GRBmodel*, int*)’
当我创建我的模型时:
GRBmodel *model2 = NULL;
指令 (int GRBgetBasisHead (GRBmodel *model, int *bhead)) 有效,但模型的操作与之前的声明不同。有什么方法可以关联model1 和model2?
【问题讨论】:
-
我收到以下错误:{error: cannot convert ‘GRBModel*’ to ‘GRBmodel* {aka _GRBmodel*}’ for: {GRBmodel *p_model1 = &model1;}
标签: c++ linear-programming gurobi