Skip to main content

C++ GRBModel::addvars() problem

Answered

Comments

4 comments

  • Gwyneth Butera
    Gurobi Staff Gurobi Staff

    Hi Sebastian - 

    The fourth argument to addVars() ("type") should be an array of length "count". 

    I hope this helps,

    Gwyneth

    0
  • Sebastían Díaz
    Gurobi-versary
    First Comment
    First Question

    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
  • Gwyneth Butera
    Gurobi Staff Gurobi Staff

    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
  • Sebastían Díaz
    Gurobi-versary
    First Comment
    First Question

    thanks that help me alot

    0

Please sign in to leave a comment.