<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>FYI. The following seems to work. Feel free to add to some
CoinUtils code or maybe there should be a repository for &quot;scripts&quot;?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>// to build:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>// g++ main.cpp -L ~/COIN/coin-Decomp/build-g/lib -I
~/COIN/coin-Decomp/build-g\<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>/include/coin -lCoinUtils<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>// mps to matrix-market format<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>//&nbsp;&nbsp; http://math.nist.gov/MatrixMarket/formats.html#mtx<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>#include &quot;CoinMpsIO.hpp&quot;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>#include &quot;CoinPackedMatrix.hpp&quot;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>#include &lt;string&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>#include &lt;fstream&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>#include &lt;iomanip&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>using namespace std;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>int main(int argc, char ** argv){<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; CoinMpsIO mps;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; mps.readMps(argv[1]);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const CoinPackedMatrix * mat&nbsp;&nbsp; = mps.getMatrixByCol();<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nCols = mat-&gt;getNumCols();<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nRows = mat-&gt;getNumRows();<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nEls&nbsp; = mat-&gt;getNumElements();<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * els&nbsp;&nbsp; = mat-&gt;getElements();<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * ind&nbsp;&nbsp; = mat-&gt;getIndices();<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * beg&nbsp;&nbsp; = mat-&gt;getVectorStarts();<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * len&nbsp;&nbsp; = mat-&gt;getVectorLengths();<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; string mmName = (string)(argv[1]) + &quot;.mtx&quot;;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; ofstream os(mmName.c_str());<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; os &lt;&lt; &quot;%%MatrixMarket matrix coordinate real
general&quot; &lt;&lt; endl;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; os &lt;&lt; &quot;%From mps file: &quot; &lt;&lt; argv[1]
&lt;&lt; endl;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; os &lt;&lt; nRows &lt;&lt; &quot; &quot; &lt;&lt; nCols
&lt;&lt; &quot; &quot; &lt;&lt; nEls &lt;&lt; endl;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lenI = 0;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const int&nbsp;&nbsp;&nbsp; * indI = NULL;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; const double * elsI = NULL;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; os &lt;&lt; setiosflags(ios::fixed|ios::showpoint);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; os &lt;&lt; setprecision(7);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; int i,k;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; for(i = 0; i &lt; nCols; i++){<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lenI = len[i];<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; indI = ind + beg[i];<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elsI = els + beg[i];<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(k = 0; k &lt; lenI; k++){<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os &lt;&lt; indI[k]+1 &lt;&lt; &quot; &quot; &lt;&lt;
i+1 &lt;&lt; &quot; &quot; &lt;&lt; elsI[k] &lt;&lt; endl;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp; }<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
coin-discuss-bounces@list.coin-or.org
[mailto:coin-discuss-bounces@list.coin-or.org] <b>On Behalf Of </b>magh<br>
<b>Sent:</b> Thursday, September 24, 2009 11:40 AM<br>
<b>To:</b> coin-discuss@list.coin-or.org<br>
<b>Subject:</b> Re: [Coin-discuss] bringing a matrix into block angular form<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>This looks fairly easy to use
so I was going to try it:<br>
&nbsp; <a href="http://www.math.uu.nl/people/bisseling/Mondriaan/">http://www.math.uu.nl/people/bisseling/Mondriaan/</a><br>
<br>
It wants this format:<br>
&nbsp; <a href="http://math.nist.gov/MatrixMarket/formats.html#mtx">http://math.nist.gov/MatrixMarket/formats.html#mtx</a><br>
<br>
Has anyone written a MPS to MatrixMarket format convertor? I just figured I'd
ask before I write it - I think it will be easy.<br>
<br>
Thanks,<br>
Matt<br>
<br>
<br>
<o:p></o:p></p>

<div>

<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Has anyone used COIN together with some package (MeTiS? or
any other?) to bring a matrix into block angular form? I am looking to read in
an MPS file - into OSI or CoinMpsIO or something like this, run one of these
heuristic methods and then return the rows/cols in each block. <br>
<br>
Thanks,<br>
Matt<o:p></o:p></p>

</blockquote>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>