<br><font size=2 face="sans-serif">Lasse,</font>
<br>
<br><font size=2 face="sans-serif">If memory is an issue the most efficient
way takes more effort but is doable if you have a reasonable (over)estimate
of numbers of rows, columns and elements. I have updated Clp/examples/addRows.cpp
to create a model from scratch. The example matrix is built by column.
You could build by row and then transpose before handing to model.</font>
<br>
<br><font size=2 face="sans-serif">Hope the example is clear enough (Clp
trunk).</font>
<br>
<br><font size=2 face="sans-serif">John Forrest</font>
<br>
<br>
<br>
<table width=100%>
<tr>
<td><img src=cid:_1_06180768061803800057F7BC852573D4>
<td width=100%>
<table width=100%>
<tr valign=top>
<td width=100%><font size=2 face="sans-serif"><b>Re: [Coin-lpsolver] Best
way to bring an instance into CLP?</b></font></table>
<br>
<table width=100%>
<tr>
<td><font size=2 color=#e26200 face="sans-serif"><b>Lasse Kliemann </b></font>
<td><font size=2 color=#8f8f8f face="sans-serif">to:</font>
<td><font size=2 face="sans-serif">coin-lpsolver</font>
<td>
<div align=right><font size=1 face="sans-serif">01/18/2008 08:20 AM</font></div></table>
<br>
<table width=100%>
<tr>
<td>
<table width=100%>
<tr>
<td><font size=2 color=#8f8f8f face="sans-serif">Sent by:</font>
<td width=100%><font size=2 color=#e26200 face="sans-serif"><b>coin-lpsolver-bounces@list.coin-or.org</b></font></table>
<br>
<td>
<div align=right></div></table>
<br></table>
<br>
<br>
<hr>
<br>
<br>
<br><tt><font size=2>* Message by -Lasse Kliemann- from Fri 2008-01-18:<br>
> There are so many ways to bring an LP into the CLP solver.<br>
> <br>
> I figured out at least the following:<br>
> <br>
> <br>
> 1) CoinPackedMatrix --> ClpModel (via loadProblem)<br>
> <br>
> 2) CoinModel --> ClpModel (via loadProblem)<br>
> <br>
> 3) CoinBuild --> CoinModel (via addColumns or addRows) <br>
> --> ClpModel (via
loadProblem)<br>
> <br>
> 4) CoinBuild --> ClpModel (via addColumns or addRows) <br>
> <br>
> 5) CoinPackedMatrix --> OsiClpSolverInterface (via loadProblem)<br>
> <br>
> 6) CoinModel --> OsiClpSolverInterface (via loadFromCoinModel)<br>
> <br>
> 7) CoinBuild --> CoinModel (via addColumns or addRows) <br>
> --> OsiClpSolverInterface
(via loadFromCoinModel)<br>
<br>
Oh, there are even more:<br>
<br>
9) CoinBuild --> OsiClpSolverInterface (via addRows or addCols)<br>
<br>
And we can also load rows or columns given by vectors of indices and elements
<br>
(what I assumed to be the starting point all the time) directly into ClpModel
<br>
or OsiClpSolverInterface via addRow or addCol.<br>
<br>
<br>
> Which of these is the best in terms of memory usage?<br>
> Which is the best in terms of runtime efficiency?<br>
> <br>
> As far as I understood, CoinBuild helps to boost runtime efficiency.
Hence, <br>
> number 3 or number 7 could be the fastest solution. However, memory
usage is <br>
> an issue in my application.<br>
> <br>
> So far, I've been using alternative number 6, which I found pretty
fast <br>
> already (even without the use of CoinBuild). The program aborts with
'out of <br>
> memory' on instances of a certain size. These instances can be solved,
<br>
> however, when loaded directly into GLPK; I have not tried loading
them <br>
> directly into CLP yet. Before I try all possible ways to find out
the best, <br>
> maybe someone can give me a hint.<br>
> <br>
> Thanks a lot for your advice!<br>
> <br>
> Lasse<br>
_______________________________________________<br>
Coin-lpsolver mailing list<br>
Coin-lpsolver@list.coin-or.org<br>
http://list.coin-or.org/mailman/listinfo/coin-lpsolver<br>
</font></tt>
<br>