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

How to retrieve the constraints from a given model using the Gurobi C APIs?

回答済み

コメント

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?.
  • Pawan Aurora
    • Gurobi-versary
    • First Question
    • First Comment

    If nothing else, I have the following workaround in mind. Since all my constraints are linear equations, I can optimise the model (which anyway I have to) and find the rhs values for a feasible solution (I don't need the constraints if the model is infeasible). Further, since all my rhs values come from a known set of integer values, I can round the values to the nearest integer if required.

    0
  • Jaromił Najman
    • Gurobi Staff

    Hi Pawan,

    You can access the RHS values of linear constraints via the RHS attribute. You can use the GRBgetdblattrarray function to access all right-hand side values at once and save those to an array.

    Best regards,
    Jaromił

    1

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