[Coin-discuss] Help with CoinMpsIO:setMpsData

steven.henderson at us.army.mil steven.henderson at us.army.mil
Sat Mar 27 16:11:38 EST 2004


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




More information about the Coin-discuss mailing list