-
-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sage.numerical.linear_functions.LinearConstraint is not a hashable type #15583
Comments
comment:5
Added example to the description. |
This comment has been minimized.
This comment has been minimized.
comment:7
sage: p = MixedIntegerLinearProgram()
sage: b = p.new_variable()
sage: c = (b[0] <= b[1] <= 2)
sage: c.__hash__()
8748240900236
sage: c.__hash__
<method-wrapper '__hash__' of sage.numerical.linear_functions.LinearConstraint object at 0x7f4dbca908c0> I think we have https://github.com/sagemath/sagetrac-mirror/commits/682ba3e7b8aaf84ba181ac16b8630aefb695c940 to thank for the update. |
Reviewer: Dima Pasechnik |
comment:9
IMHO, typically solvers are able to deal with multiple constraints, etc. Also, constraints are really held in the backend, and in fact they can get modified once they are processed. |
comment:10
Closing tickets in the sage-duplicate/invalid/wontfix module with positive_review (i.e. someone has confirmed they should be closed). |
I'd like to have
sage.numerical.linear_functions.LinearConstraint
to be a hashable type.Currently it is not:
This is for the following reasons:
MixedIntegerLinearProgram
, it is not necessary to add the same or equivalent constraint multiple times. A hash could be used to determine distinct linear constraints that are added into a MILP instance.Thanks,
Clinton
CC: @nathanncohen @vbraun @dimpase
Component: linear programming
Keywords: linear constraint, mixed integer linear program
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/15583
The text was updated successfully, but these errors were encountered: