#16714: Add a matrix of constraints in a LP
-------------------------------------+-------------------------------------
Reporter: ncohen | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.4
Component: linear | Resolution:
programming | Merged in:
Keywords: | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | fd10630a8e4884d3a44f55cc6e1d4c83ea7ee154
u/vbraun/add_a_matrix_of_constraints_in_a_lp| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by ncohen):
> Obviously it is very fast to solve trivial constraints. Read my question
again.
Volker you make mistakes too, and if there is something I don't stand for
long it is people giving me orders. If there is a misunderstanding, we
will clear it.
What I said is that people (some I met, or myself in the past) noticed
that it took time to add constraints to a LP. I am not talking of solving
the LP itself. Just imagine that the matrix is stored as a dense
contiguous matrix, and that adding a row means having to copy everything.
I don't know if this is how it is implemented, but on some occasions
adding constraints one by one (each with the same number of nonzero
coefficients and looking the same) takes a time which is not constant per
call, i.e. calling {{{add_constraint}}} on a matrix that is already big is
longer than on an empty matrix.
Which means that calling add_linear_constraints may make a difference.
Which would also explain why the solvers contain this in their API, even
though it seems useless at first.
I just tried it again by adding the same constraint "b[3]<=8" many many
times but in this case the time seems to be constant. Perhaps there is
something else missing.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/16714#comment:30>
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.