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

How can I efficiently add vector constraint in c++?

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • David Torres Sanchez
    • Gurobi Staff

    As noted in the article,

    Concerning adding multiple constraints in one call (documentation about addConstrs):

    We recommend that you build your model one constraint at a time (using addConstr), since it introduces no significant overhead and we find that it produces simpler code.

    You can use  GRBModel::addConstrs()

    Cheers, 
    David

    0
  • Yuhao Zhang
    • Gurobi-versary
    • First Comment
    • First Question

    Thanks David,

    using GRBModel::addConstrs() is a little bit faster, but not much.
    But thanks anyway.

    0

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