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
-
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
Please sign in to leave a comment.
Comments
4 comments