How to remove a constraint and add it back in .NET environment ?
AnsweredI've found the way to do that in Python like https://support.gurobi.com/hc/en-us/community/posts/360047909572-how-to-remove-and-add-back-a-constraint-?page=1#community_comment_360012823711 do.
But if I want to add constraint back in a .NET environment, how can I do to get the lhs of the constraint c?
I found that there's no attribute 'LHS' in a constraint of .NET environment so I don't know how to do that.
Thanks!!
-
Official comment
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?. -
Hi,
You can get the LHS by using the getRow() function.
Best regards,
Jaromił1 -
Hi Jaromił,
Thanks!
For better understanding, take the following constraint for example:
GRBConstr c : x1 + 2 x3 + 3 x3 >= 6
If I use getRow(c), I will get a GRBLinExpr : x1 + 2 x3 + 3 x3 , right?
Thanks again!0 -
Hi Jia-Kai,
Correct, that's what you would get.
Have a look at the answers of this community post. It's for the Python API but it works the same for the .NET API.
Best regards,
Jaromił0
Post is closed for comments.
Comments
4 comments