<br><font size=2 face="sans-serif">Kyle,</font>
<br>
<br><font size=2 face="sans-serif">I will write a constructor for you.
 If you still need more memory there are a few more tricks e.g.  replaceMatrix
may not need two copies and you can switch off a row copy (but it will
be slower).</font>
<br>
<br><font size=2 face="sans-serif">May be ready by tomorrow.</font>
<br>
<br><font size=2 face="sans-serif">John Forrest</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Kyle Ellrott <kellrott@csbl.bmb.uga.edu></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">03/08/2005 11:39 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">Re: [Coin-lpsolver] Constraint
matrix</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>I've been playing around with the ClpSimplex solver
directly as <br>
suggested.  Upon further research, given the nature of my problem,
I <br>
may want to skip the Branch and Bound interface altogether (my <br>
branches, which rarely exist, are binary in nature, so no need for a <br>
linear cutting plane)<br>
Currently I'm trying to tackle a problem with a size of 10861552 <br>
Column, 103481 rows, and 21788000 elements, but as mentioned before <br>
there only exists the values +1,0,-1, so using a ClpPlusMinusOneMatrix
<br>
is preferable.<br>
Anyway, I'm still playing around with quickly constructing a large <br>
ClpPlusMinusOneMatrix.  Originally, when I used the CoinPackedMatrix,
I <br>
utilized the triplet array description of the matrix to initialize <br>
(row, column, element) to initialize the structure.  But because this
<br>
interface is not part of the ClpPlusMinusOneMatrix class, I rewrote my
<br>
code to generate the matrix one column at a time, and attempt to use <br>
the appendCol call in ClpPlusMinusOneMatrix.  At this point I found
<br>
out, this might not work,<br>
 From the looks of the source code, and <br>
http://www.coin-or.org/Clp/userguide/ch03s02.html it looks as if the <br>
only way to initialize a ClpPlusMinusOneMatrix is to first create a <br>
ClpPackedMatrix, and then initialize the PlusMinus matrix by passing in
<br>
the PackedMatrix.<br>
But currently I run out of memory creating the ClpPackedMatrix on <br>
certain problems, so I can't even create the PlusMinus matrix.<br>
<br>
The problem is that ClpPackedMatrix creation is a bit of a memory hog,
<br>
because at it's worst point I have two copies of the matrix in memory <br>
at one time  (one in the linked list of CoinBuild, and on in the matrix
<br>
inside of ClpSimplex), or I could try building the matrix one column at
<br>
a time, but that takes way to much time.  The triplet method is a
bit <br>
better, because it removes a bit of memory overhead associated in <br>
describing each of the columns separately, but PlusMinus doesn't take a
<br>
CoinPackedMatrix as a constructor argument.  But even then, I still
use <br>
a lot of memory creating a PackedMatrix before creating the smaller <br>
PlusMinus one.<br>
<br>
Is it possible to create a ClpPlusMinusOneMatrix without creating a <br>
ClpPackedMatrix first?<br>
<br>
I think the following call might be the way to go, but the <br>
documentation is kind of sparse in terms of how to use it...<br>
<br>
  ClpPlusMinusOneMatrix::ClpPlusMinusOneMatrix      
            (    
               int
                 
  numberRows,<br>
                
                 int
                 
numberColumns,<br>
                
                 bool
                 
columnOrdered,<br>
                
                 const
int *                  
indices,<br>
                
                 const
CoinBigIndex *              
    startPositive,<br>
                
                 const
CoinBigIndex *              
    startNegative<br>
                
)                  
<br>
<br>
<br>
Kyle<br>
<br>
<br>
<br>
><br>
> Kyle,<br>
><br>
> While Cbc i.e. Osi could allow more types of matrices I am not sure
it <br>
> is a good idea for Branch and Cut.  A bit of extra storage before
<br>
> entering branch and cut  is the least of your worries.  In
branch and <br>
> cut the cut generators all expect a CoinPackedMatrix and if they add
<br>
> any cuts they will destroy any special structure.<br>
><br>
> If you are masochistic enough to want to try and stress the code you
<br>
> could do the following:<br>
><br>
> Get an OsiClpSolverInterface solver<br>
> get a ClpSimplex pointer using getModelPtr()<br>
> create model and pass in +-1 matrix - you can get clues from <br>
> Clp/Test/unitTest.cpp<br>
> pass solver to Cbc<br>
><br>
> It will do the initial solve.  If it does not add cuts it should
stay <br>
> as +- matrix.  If it does cuts it "should" magically
become an <br>
> ordinary matrix - if it fails then I will fix.<br>
><br>
> John Forrest<br>
><br>
><br>
><br>
><br>
> Kyle Ellrott <kellrott@csbl.bmb.uga.edu><br>
><br>
> Sent by: coin-lpsolver-bounces@list.coin-or.org<br>
><br>
><br>
> 03/03/2005 11:09 AM<br>
><br>
><br>
> To<br>
><br>
> coin-lpsolver@list.coin-or.org<br>
><br>
><br>
> cc<br>
><br>
><br>
> Subject<br>
><br>
> Re: [Coin-lpsolver] Constraint matrix<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> I've been looking through the source tree to get a better understanding<br>
>  of what's going on.  But I do have a few questions.<br>
>  From my understanding CoinPackedMatrix is derived from <br>
> ClpPackedMatrix,<br>
>  and adds a few functions (actually It looks like it adds about
38 <br>
> pages<br>
>  worth of code to ClpPackMatrix).  Do all those functions
need to be<br>
>  added before Cbc can utilize the matrix?<br>
><br>
>  There is no equivalent Coin class for the ClpPlusMinusOneMatrix.
 I'm<br>
>  assuming one would have to be created before it could be used
in the<br>
>  CbcModel interface.  Of course I would also have to add
a loadProblem<br>
>  method to Cbc that used this hypothetical CoinPlusMinusOneMatrix.
<br>
>  Then<br>
>  maybe change the internal Cbc matrix pointers is a more generic<br>
>  CoinMatrixBase (which doesn't exist either) which would be an
abstract<br>
>  based on ClpMatrixBase, rather then the current CoinPackedMatrix.<br>
><br>
>  Is this what it would take to get a plus/minus one matrix working
in<br>
>  Cbc?  Or have I over complicated the problem?<br>
><br>
>  Kyle<br>
><br>
><br>
><br>
>  > Thank you, that helps ;-)<br>
>  ><br>
>  > But I do have one problem.  According the page mentioned,
both<br>
>  > ClpPlusMinusOneMatrix and ClpPackedMatrix both inherit
from<br>
>  > ClpMatrixBase.  The problem is that OsiClpSolverInterface's<br>
>  > loadProblem only mentions CoinPackedMatrix (which I think
is the <br>
> same<br>
>  > as ClpPackedMatrix), but not the parent class of ClpMatrixBase.
 So<br>
>  > when I try to pass a ClpPlusMinusOneMatrix to <br>
> OsiClpSolverInterface's<br>
>  > loadProblem, I get something like<br>
>  ><br>
>  > intpro_threading.cc:766: error: no matching function for
call to `<br>
>  >    OsiClpSolverInterface::loadProblem(ClpPlusMinusOneMatrix&,
<br>
> double*&,<br>
>  >    double*&, double*&, double*&,
double*&)'<br>
>  > /Users/kye/COIN/include/OsiClpSolverInterface.hpp:600:
error:<br>
>  > candidates are:<br>
>  >    virtual void OsiClpSolverInterface::loadProblem(const<br>
>  > CoinPackedMatrix&,<br>
>  >    const double*, const double*, const double*,
const double*, const<br>
>  > double*)<br>
>  ><br>
>  > Any thoughts?<br>
>  ><br>
>  > Kyle<br>
>  ><br>
>  ><br>
>  ><br>
>  >> I think you will find this page of the CLP documentation
will help<br>
>  >> you:<br>
>  >><br>
>  >> http://www.coin-or.org/Clp/userguide/ch03s02.html<br>
>  >><br>
>  >> In other words, there's (supposed to be) a matrix class
specific to<br>
>  >> your situation.<br>
>  >><br>
>  >> At 02:38 PM 3/2/2005, Kyle Ellrott wrote:<br>
>  >>> I'm curious about the CoinPackedMatrix structure
that I use to <br>
> setup<br>
>  >>> my constraint matrix for my integer programming
problem.  From <br>
> what<br>
>  >>> I understand so far, it's input data is doubles.
 But for my<br>
>  >>> particular problem, the only values I put in it
are -1, 1, and 0 <br>
> (0<br>
>  >>> being being cells that aren't mentioned in my description).
 By<br>
>  >>> using a double rather then a char, I'm using 8
time more memory <br>
> then<br>
>  >>> I need to.<br>
>  >>> Is there are more efficient method to describe
this matrix?<br>
>  >>><br>
>  >>> Kyle<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>
>  >><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>
><br>
>  _______________________________________________<br>
>  Coin-lpsolver mailing list<br>
>  Coin-lpsolver@list.coin-or.org<br>
>  http://list.coin-or.org/mailman/listinfo/coin-lpsolver<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>
  _______________________________________________<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>