Skip to main content

how do I change variable type with c++ API?

Answered

Comments

2 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Dapei,

    Except for

    for (size_t p = 0; p < nCategories; ++p)
    {
    buy[p].set(GRB_CharAttr_VType, GRB_INTEGER);
    }

    which should read

    for(size_t p = 0; p < nFoods /* there are only nFoods "buy" variables */; ++p)
    {
    buy[p].set(GRB_CharAttr_VType, GRB_INTEGER);
    }

    the code looks fine. Why do you think that it does not work?

    Best regards,
    Jaromił

    0
  • dapei jiang
    Gurobi-versary
    First Comment
    First Question

    oooooooooh! I make a foolish mistake, I'm so stupid. 

    Mr Najman, Thank you!

    0

Please sign in to leave a comment.