Ticket #7637 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Default dictionary in MixedIntegerLinearProgram

Reported by: ncohen Owned by: jkantor
Priority: major Milestone: sage-4.3
Component: numerical Keywords:
Cc: malb Work issues:
Report Upstream: N/A Reviewers: Martin Albrecht
Authors: Nathann Cohen Merged in: sage-4.3.rc1
Dependencies: Stopgaps:

Description

Martin Albrecht requested this functionality for his code, and it would also simplify mine. For short linear programs, of when some global variables do not require the creation of a new dictionary of variables ( from which only one field would be used ), this trick is good enough !

Nathann

Attachments

trac_7637.patch Download (1.8 KB) - added by ncohen 3 years ago.

Change History

comment:1 Changed 3 years ago by malb

  • try: foo except AttributeError: seems to be favoured in the Python community over hasattr. It is also faster if the attribute does in fact exist.
  • Why do you call __getitem__() instead of using the normal syntax [x]?

comment:2 Changed 3 years ago by ncohen

  • Status changed from new to needs_review

Done !

Changed 3 years ago by ncohen

comment:3 Changed 3 years ago by malb

  • Status changed from needs_review to positive_review

comment:4 Changed 3 years ago by mhansen

  • Status changed from positive_review to closed
  • Reviewers set to Martin Albrecht
  • Resolution set to fixed
  • Merged in set to sage-4.3.rc1
  • Authors set to Nathann Cohen

comment:5 Changed 3 years ago by mhansen

  • Milestone changed from sage-4.3.1 to sage-4.3
Note: See TracTickets for help on using tickets.