C++ GRBModel::addvars() problem
Answeredhi, i am trying to add binary variable to the model but i get and error that i dont know why is happening because i am following the documentation.
i have other variable without the type and it works perfect.
0
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Sebastian -
The fourth argument to addVars() ("type") should be an array of length "count".
I hope this helps,
Gwyneth
0 -
I got another error because when i use the array i got invalid type and the constant for binary is "B".
Thanks for responding.
0 -
Hi Sebastian - This doesn't work because "B" is not an array of length arcos.size().
char type[] = {GRB_BINARY, GRB_BINARY, GRB_BINARY};
...
x = model.addVars(0,0,obj,type,name,3);I hope this helps.
0 -
thanks that help me alot
0
Post is closed for comments.
Comments
5 comments