#16714: Add a matrix of constraints in a LP
----------------------------------+----------------------------
Reporter: ncohen | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.3
Component: linear programming | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
----------------------------------+----------------------------
Some users reported two problems with Sage's interface with LP solvers.
1) It is slow to add constraints one by one to the solver's data structure
2) It should be possible to add a matrix of constraints all at once
With a new syntax like that (thanks Dima), both problems can be
circumvented:
{{{
p = MixedIntegerLinearProgram()
x = p.new_variable()
p.add_constraint(A_matrix*x <= a_vector)
}}}
This would consider {{{x}}} as the vector
{{{x[0],x[1],...,x[size_of_the_matrix - 1]}}}.
In the `add_constraint` function, we can then call the backend's function
to add 10 000 constraints at the same time (probably better for the data
structure), and then fill the entries.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/16714>
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.