#16504: A mandatory 'nonnegative' argument for
MixedIntegerLinearProgram.new_variable() until the standard changes
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.3
Component: linear | Resolution:
programming | Merged in:
Keywords: | Reviewers: Jeroen Demeyer
Authors: Nathann Cohen | Work issues: nonnegative=False
Report Upstream: N/A | doctests
Branch: u/ncohen/16504 | Commit:
Dependencies: | b1f43af754d4ab7e136015519c7fc0cdbe32dd36
| Stopgaps:
-------------------------------------+-------------------------------------
Comment (by jdemeyer):
Could you replace
{{{
if isinstance(v, MIPVariable):
v.set_min(min)
else:
self._backend.variable_lower_bound(self._variables[v], min)
}}}
by the more Pythonic
{{{
try:
v.set_min(min)
except AttributeError:
self._backend.variable_lower_bound(self._variables[v], min)
}}}
My personal opinion is that `v.set_min(min)` should actually work in all
cases, but that's perhaps for a new ticket.
--
Ticket URL: <http://trac.sagemath.org/ticket/16504#comment:27>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.