Opened 13 years ago
Closed 5 years ago
#6592 closed defect (fixed)
minimize_constrained only takes lambda functions as constraints
Reported by: | Robert Miller | Owned by: | jkantor |
---|---|---|---|
Priority: | major | Milestone: | sage-8.0 |
Component: | numerical | Keywords: | |
Cc: | Marcelo Forets | Merged in: | |
Authors: | Marcelo Forets | Reviewers: | Travis Scrimshaw |
Report Upstream: | N/A | Work issues: | |
Branch: | 79205d7 (Commits, GitHub, GitLab) | Commit: | 79205d73c377aef03282ccf5a7c7d749bb649904 |
Dependencies: | Stopgaps: |
Description
e.g.:
sage: var('x y') sage: f = (100 - x) + (1000 - y) sage: c = x + y - 479 # > 0 sage: minimize_constrained(f,[c],[100,300]) Traceback (most recent call last): ... UnboundLocalError: local variable 'min' referenced before assignment
Change History (12)
comment:1 Changed 13 years ago by
Report Upstream: | → N/A |
---|
comment:2 Changed 9 years ago by
Milestone: | sage-5.11 → sage-5.12 |
---|
comment:3 Changed 9 years ago by
Milestone: | sage-6.1 → sage-6.2 |
---|
comment:4 Changed 8 years ago by
Milestone: | sage-6.2 → sage-6.3 |
---|
comment:5 Changed 8 years ago by
Milestone: | sage-6.3 → sage-6.4 |
---|
comment:6 Changed 5 years ago by
Cc: | Marcelo Forets added |
---|
comment:7 Changed 5 years ago by
Authors: | → Marcelo Forets |
---|---|
Branch: | → u/mforets/6592 |
Commit: | → 79205d73c377aef03282ccf5a7c7d749bb649904 |
Milestone: | sage-6.4 → sage-8.0 |
comment:8 Changed 5 years ago by
Status: | new → needs_review |
---|
comment:9 Changed 5 years ago by
This patch adds code branches for the cases when the constraints are one or more symbolic expressions. There is also some cleanup (PEP-8).
comment:10 follow-up: 11 Changed 5 years ago by
Reviewers: | → Travis Scrimshaw |
---|---|
Status: | needs_review → positive_review |
The code make sense and fixes the error.
comment:11 Changed 5 years ago by
comment:12 Changed 5 years ago by
Branch: | u/mforets/6592 → 79205d73c377aef03282ccf5a7c7d749bb649904 |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
Note: See
TracTickets for help on using
tickets.
More clearly, here's the "bug" part of this. The documentation says that the function takes a symbolic function, but clearly does not: