[Coin-discuss] Help with CoinMpsIO:setMpsData

Alan King kingaj at us.ibm.com
Mon Mar 29 08:17:02 EST 2004


Could be that the names are garbling because you are using an implicit 
malloc in 

for(int i = 0; i < total_cols; i++)
{
   col_names[i] = "ZZ";
}

These assignments are probably just using temporary storage?  Try using a 
string class instead.

Anyway, this shouldn't be your problem.  The interface should make a copy 
internally.  It probably isn't doing that.  For other reasons, I was going 
to do a major rewrite of the MpsIO classes.  I'll take a look at this 
interface too.

Alan

Alan King
Mathematical Sciences, IBM Research
http://www.research.ibm.com/
http://www.research.ibm.com/people/k/kingaj/

Campus Relationship Manager: University of Washington
http://www.washington.edu
http://www.ibm.com/university



steven.henderson at us.army.mil 
Sent by: coin-discuss-admin at www-124.southbury.usf.ibm.com
03/27/2004 04:11 PM
Please respond to
coin-discuss


To
coin-discuss at www-124.southbury.usf.ibm.com
cc

Subject
[Coin-discuss] Help with CoinMpsIO:setMpsData






Folks,

I am having trouble setting row and col names in an MPS. 

My first attempt tried the OSISolverInterface  WriteMpsNative method. This 
didn't seem to accept any row or col char* arrays, but build the MPS ok. 
Is this method active?

My second attempt tried the MpsIO utility class.  I am trying to 
initialize an MPS reader given a CoinPacked Matrix and associated 
parameters.
This is the method I am trying to use:

void             setMpsData (const CoinPackedMatrix &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)

When I call the method, it creates an MPS, which I
can write to disk.  However, several entries are garbled - like 
non-terminated char arrays. 

I think the problem is setting my col and row names.  Here is how I am 
initializing the row and col names:

char* col_names[total_cols];

for(int i = 0; i < total_cols; i++)
{
   col_names[i] = "ZZ";
}

I do same thing with row_names char* array.

Then I call the setMpsData:

mpsReader.setMpsData(*matrix, si-getInfinity(), col_lb, sol_ub, objective, 
inegrality, row_lb, row_up, col_names, row_names)

The other paramters are good, as I can create a good MPS with 
OsiXxxSolverInterface (except it has generic col/row names).

Thank you in advance for your help.  I apologize if this turns out to be a 
C++ syntax error.

Steve Henderson

_______________________________________________
Coin-discuss mailing list
Coin-discuss at www-124.ibm.com
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20040329/bdd0ebbe/attachment.html>


More information about the Coin-discuss mailing list