Skip to main content

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

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    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?.
  • 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

Post is closed for comments.