#20773: MixedIntegerLinearProgram.new_variable could optionally take a "static"
list of component indices
---------------------------+----------------------------
Reporter: mkoeppe | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-7.3
Component: numerical | Keywords: lp
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
---------------------------+----------------------------
Currently, `new_variable` allocates backend indices to MIP variable
component indices very dynamically.
{{{
sage: p = MixedIntegerLinearProgram()
sage: x = p.new_variable()
sage: x[7]
x_0
sage: x[2]
x_1
}}}
Sometimes it could be nice to have a predictable order in the backend. And
sometimes it could be nice to declare ahead of time which component
indices are valid, making accesses to other indices an error (rather than
creating a new backend variable); this could help debug MIP models.
This could look like this:
{{{
sage: p = MixedIntegerLinearProgram()
sage: x = p.new_variable(components=range(7))
sage: p.number_of_variables()
7
sage: x[3]
x_3
sage: x[11]
IndexError: MIPVariable component index out of range
}}}
(This would be optional; if no `components` argument is passed, it would
match the fully dynamic current behavior.)
--
Ticket URL: <http://trac.sagemath.org/ticket/20773>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.