#11607: read constraints from linear program
----------------------------------+-----------------------------------------
Reporter: john_perry | Owner: ncohen
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.7.2
Component: linear programming | Keywords: sd32
Work_issues: | Upstream: N/A
Reviewer: Nathann Cohen | Author: John Perry
Merged: | Dependencies:
----------------------------------+-----------------------------------------
Description changed by ncohen:
Old description:
> Sometimes a user might want to read & inspect the constraints in a linear
> program. For example, some code of mine generates a '''lot''' of linear
> programs (I described the project to Nathann once), and it would be nice
> if I could read the constraints off one program so as to combine it with
> another. Example usage would be:
> {{{
> sage: lp = MixedIntegerLinearProgram()
> sage: lp.add_constraint(lp[0]-lp[1],min=1)
> sage: lp.add_constraint(2*lp[1]-lp[0]-lp[2],max=1)
> sage: lp.get_constraints()
> [(1.0, ([1, 0],[-1.0, 1.0]), None),(None, ([2, 1, 0], [-1.0, 2.0, -1.0]),
> 1.0)]
> }}}
New description:
Sometimes a user might want to read & inspect the constraints in a linear
program. For example, some code of mine generates a '''lot''' of linear
programs (I described the project to Nathann once), and it would be nice
if I could read the constraints off one program so as to combine it with
another. Example usage would be:
{{{
sage: lp = MixedIntegerLinearProgram()
sage: lp.add_constraint(lp[0]-lp[1],min=1)
sage: lp.add_constraint(2*lp[1]-lp[0]-lp[2],max=1)
sage: lp.get_constraints()
[(1.0, ([1, 0],[-1.0, 1.0]), None),(None, ([2, 1, 0], [-1.0, 2.0, -1.0]),
1.0)]
}}}
Apply:
* [attachment:trac_11607_read_constraints_from_lp.patch]
* [attachment:trac_11607_reviewer.patch]
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11607#comment:14>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.