メインコンテンツへスキップ

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

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • 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

    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

投稿コメントは受け付けていません。