Opened 7 years ago
Closed 7 years ago
#15691 closed defect (duplicate)
mip backends: bug due to bool/number confusion
Reported by: | equaeghe | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | PLEASE CHANGE | Keywords: | |
Cc: | ncohen | Merged in: | |
Authors: | Nathann Cohen | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
(I only have the GLPK backend installed, so I actually only tested with that.)
In all the mip backends, the methods variable_upper_bound
and variable_lower_bound
contain essentially the statement value == False
.
This causes it to be impossible to set variable bounds to 0.0, as 0.0 == False
is True
.
Illustrated in the console:
sage: version() 'Sage Version 6.0, Release Date: 2013-12-17' sage: p = MixedIntegerLinearProgram() sage: p.set_objective(p[0]) sage: p.show() Maximization: x_0 Constraints: Variables: x_0 is a continuous variable (min=0.0, max=+oo) sage: p.set_max(p[0], 0.0) # fails sage: p.show() Maximization: x_0 Constraints: Variables: x_0 is a continuous variable (min=0.0, max=+oo)
A simple fix is to replace all(?) occurrences of value == False
by value is False
.
Change History (5)
comment:1 follow-up: ↓ 3 Changed 7 years ago by
- Milestone changed from sage-6.1 to sage-duplicate/invalid/wontfix
- Status changed from new to needs_review
comment:2 Changed 7 years ago by
- Status changed from needs_review to positive_review
(to be closed as a duplicate of #14581)
comment:3 in reply to: ↑ 1 ; follow-up: ↓ 4 Changed 7 years ago by
comment:4 in reply to: ↑ 3 Changed 7 years ago by
Thanks, I'm putting this on my to-do list. I'm right away going to inform myself on how to best perform the development process on my distribution.
Okayyyyyyy ! I can try to help to some extent (I don't know how to use the dev scripts for instance, I just git directly) so you can email me if you need. Otherwise sage-git and the developer's manual should answer everything :-)
Nathann
comment:5 Changed 7 years ago by
- Resolution set to duplicate
- Status changed from positive_review to closed
Well, if you want to review a patch why don't you try #14581 ? I can fix bugs but I cannot review the patch myself
:-P
Nathann