<br><font size=2 face="sans-serif">Apologies for double posting but it
is more general than Clp.</font>
<br>
<br><font size=2 face="sans-serif">Francois mentioned that there was a
large overhead to using addColumn (i.e. adding one at a time) in Clp. &nbsp;As
Clp is using CoinPackedMatrix this probably also applies to other codes
using CoinPackedMatrix, including some implementations of Osi. &nbsp;I
had realized there was an overhead to addRow but had not realized it is
worse for addColumn.</font>
<br>
<br><font size=2 face="sans-serif">My solution is to add a new class to
Coin - CoinBuild. &nbsp;The user instantiates an empty CoinBuild object
and then performs addRow (or addColumn but not a mixture) in the same was
as addRow (or addColumn) for an OsiSolverInterface model. &nbsp;This stores
the information in a linked list. &nbsp;Then the user uses model.addRows(object)
to get the information to its final destination. &nbsp;There is addRows/addColumns
in Clp and addRows/addCols in OsiSolverInterface.</font>
<br>
<br><font size=2 face="sans-serif">Doing this reduced the time for adding
10,000 rows from 0.53 seconds to 0.04 and for adding 10,000 columns from
5.71 seconds to 0.03.</font>
<br>
<br><font size=2 face="sans-serif">(Francois - see Clp/Samples/addColumns.cpp
for sample code).</font>
<br>
<br><font size=2 face="sans-serif">The reason for posting this to Coin-discuss
was to tell people it was available and to ask if other people had noticed
the performance hit. &nbsp;Also to see if my solution is adequate.</font>
<br>
<br><font size=2 face="sans-serif">John Forrest</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>François Galea &lt;Francois.Galea@prism.uvsq.fr&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: coin-lpsolver-bounces@list.coin-or.org</font>
<p><font size=1 face="sans-serif">02/04/2005 03:15 AM</font>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">coin-lpsolver@list.coin-or.org</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">[Coin-lpsolver] Problem creation
performance</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Hi !<br>
<br>
I have a question concerning the Clp library API.<br>
<br>
I need to generate different LPs (my previous question about QPs has no
<br>
relation with this problem), whose size is about 2500 rows, 2500 columns
<br>
and 250000 non-zeros. The model is such that it's easier for me to <br>
create an empty problem object using the ClpSimplex() constructor :<br>
<br>
ClpSimplex * simplex = new ClpSimplex();<br>
<br>
then I populate it column-wise, by first performing a series of calls <br>
like this:<br>
<br>
simplex-&gt;addRows( rcnt, lb, ub, rowstarts, NULL, NULL );<br>
<br>
then I add the columns by a series of this kind of calls :<br>
<br>
simplex-&gt;addColumns( 1, &amp;lb, &amp;ub, &amp;objcoef, colstarts, ind,
val );<br>
<br>
This leads to a major problem, that the creation of the problem is much
<br>
slower than its resolution. Maybe Clp is more performant when creating
<br>
simplex objects row-wise than column-wise, but I really need to create
<br>
my problem objects this way.<br>
<br>
Most of the examples I found in the Clp documentation create ClpSimplex
<br>
objects by reading MPS files, and the only one I found that creates an
<br>
object from scratch provides the whole simplex matrix at once, which is
<br>
okay when you can easily find the size of the problem before creating <br>
the object, but it not okay for me.<br>
<br>
Could I get a link to a more complete documentation than the one I found
<br>
in the Clp website, which only mentions the addRows and addColumns <br>
methods once ? Or can anybody tell me why I get such a low model <br>
creation speed, and how to make things faster ?<br>
<br>
Thanks for the help,<br>
<br>
François Galea<br>
<br>
_______________________________________________<br>
Coin-lpsolver mailing list<br>
Coin-lpsolver@list.coin-or.org<br>
http://list.coin-or.org/mailman/listinfo/coin-lpsolver<br>
</tt></font>
<br>