<br><font size=2 face="sans-serif">Could be that the names are garbling
because you are using an implicit malloc in </font>
<br>
<br><font size=2><tt>for(int i = 0; i &lt; total_cols; i++)<br>
{<br>
 &nbsp; col_names[i] = &quot;ZZ&quot;;<br>
}<br>
</tt></font>
<br><font size=2><tt>These assignments are probably just using temporary
storage? &nbsp;Try using a string class instead.</tt></font>
<br>
<br><font size=2 face="sans-serif">Anyway, this shouldn't be your problem.
&nbsp;The interface should make a copy internally. &nbsp;It probably isn't
doing that. &nbsp;For other reasons, I was going to do a major rewrite
of the MpsIO classes. &nbsp;I'll take a look at this interface too.</font>
<br>
<br><font size=2 face="sans-serif">Alan</font>
<br><font size=2 face="sans-serif"><br>
Alan King<br>
Mathematical Sciences, IBM Research<br>
http://www.research.ibm.com/<br>
http://www.research.ibm.com/people/k/kingaj/<br>
<br>
Campus Relationship Manager: University of Washington<br>
http://www.washington.edu<br>
http://www.ibm.com/university</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>steven.henderson@us.army.mil</b>
</font>
<br><font size=1 face="sans-serif">Sent by: coin-discuss-admin@www-124.southbury.usf.ibm.com</font>
<p><font size=1 face="sans-serif">03/27/2004 04:11 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
coin-discuss</font></div></table>
<br>
<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-discuss@www-124.southbury.usf.ibm.com</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-discuss] Help with
CoinMpsIO:setMpsData</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Folks,<br>
<br>
I am having trouble setting row and col names in an MPS. &nbsp;<br>
<br>
My first attempt tried the OSISolverInterface &nbsp;WriteMpsNative method.
&nbsp;This didn't seem to accept any row or col char* arrays, but build
the MPS ok. &nbsp;Is this method active?<br>
<br>
My second attempt tried the MpsIO utility class. &nbsp;I am trying to initialize
an MPS reader given a CoinPacked Matrix and associated parameters.<br>
This is the method I am trying to use:<br>
<br>
void &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setMpsData
(const CoinPackedMatrix &amp;m, const double infinity, const double *collb,
const double *colub, const double *obj, const char *integrality, const
double *rowlb, const double *rowub, char const *const *const colnames,
char const *const *const rownames)<br>
<br>
When I call the method, it creates an MPS, which I<br>
can write to disk. &nbsp;However, several entries are garbled - like non-terminated
char arrays. <br>
<br>
I think the problem is setting my col and row names. &nbsp;Here is how
I am initializing the row and col names:<br>
<br>
char* col_names[total_cols];<br>
<br>
for(int i = 0; i &lt; total_cols; i++)<br>
{<br>
 &nbsp; col_names[i] = &quot;ZZ&quot;;<br>
}<br>
<br>
I do same thing with row_names char* array.<br>
<br>
Then I call the setMpsData:<br>
<br>
mpsReader.setMpsData(*matrix, si-getInfinity(), col_lb, sol_ub, objective,
inegrality, row_lb, row_up, col_names, row_names)<br>
<br>
The other paramters are good, as I can create a good MPS with OsiXxxSolverInterface
(except it has generic col/row names).<br>
<br>
Thank you in advance for your help. &nbsp;I apologize if this turns out
to be &nbsp;a C++ syntax error.<br>
<br>
Steve Henderson<br>
<br>
_______________________________________________<br>
Coin-discuss mailing list<br>
Coin-discuss@www-124.ibm.com<br>
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss<br>
</tt></font>
<br>