31 int status =
m_MpsData->readMps( &mpsfilename[ 0],
"", nOfSOS, SOS );
33 throw ErrorClass(
"Error trying to read MPS file");
40 std::ostringstream outStr;
42 outStr <<
"Detected " << nOfSOS <<
" special ordered sets" << std::endl;
43 for (
int i=0; i < nOfSOS; i++)
45 int numberEntries = SOS[i]->numberEntries();
46 const int * which = SOS[i]->which();
47 const double * weights = SOS[i]->weights();
48 outStr <<
"SOS " << i <<
" has type " << SOS[i]->setType();
49 outStr <<
" and " << numberEntries <<
" entries:" << std::endl;
50 for (
int j=0;j<numberEntries;j++)
51 outStr <<
" Idx: " << which[j] <<
" Weight: " << weights[j] << std::endl;
60 int * columnStart = NULL;
61 int * columnIdx = NULL;
62 double * elements = NULL;
63 status =
m_MpsData->readQuadraticMps(NULL, columnStart, columnIdx, elements, 0);
67 if (status != -2 && status != -3)
68 throw ErrorClass(
"Error trying to read QUADOBJ section");
73 std::ostringstream outStr;
74 int numberColumns=
m_MpsData->getNumCols();
75 outStr <<
"Quadratic objective has " << columnStart[numberColumns] <<
" entries" << std::endl;
76 outStr <<
"Column starts:" << std::endl;
77 for (
int i=0; i<=numberColumns; i++)
78 outStr <<
" " << columnStart[i] << std::endl;
79 for (
int i=0; i<numberColumns; i++)
81 if (columnStart[i] < columnStart[i+1])
83 outStr <<
"Column " << i <<
": index value" << std::endl;
84 for (
int j=columnStart[i];j<columnStart[i+1];j++)
85 outStr <<
" " << columnIdx[j] <<
" " << elements[j] << std::endl;
94 int * coneStart = NULL;
96 int * coneType = NULL;
97 status =
m_MpsData->readConicMps(NULL, coneStart, coneIdx, coneType, nOfCones);
100 if (status != -2 && status != -3)
101 throw ErrorClass(
"Error trying to read cone section");
106 std::ostringstream outStr;
107 outStr <<
"Conic section has " << nOfCones <<
" cones" << std::endl;
108 for (
int i=0;i<nOfCones;i++)
110 outStr <<
"Cone " << i <<
" has " << coneStart[i+1]-coneStart[i] <<
" entries ";
111 outStr <<
"(type " << coneType[i] <<
"):" << std::endl;
112 for (
int j=coneStart[i];j<coneStart[i+1];j++)
113 outStr <<
" " << coneIdx[j] << std::endl;
149 int numnonz =
m_MpsData->getNumElements();
152 double objWeight = 1.0;
158 for(i = 0; i < numvar; i++)
169 double *p =
const_cast<double*
>(
m_MpsData->getObjCoefficients());
170 for(i = 0; i < numvar; i++)
172 objectiveCoefficients->
indexes[i] = i;
173 objectiveCoefficients->
values[i] = *(p++);
179 "min",
m_MpsData->objectiveOffset(), objWeight, objectiveCoefficients) ;
180 delete objectiveCoefficients;
181 objectiveCoefficients = NULL;
186 double constant = 0.0;
187 for(i = 0; i < numrows; i++)
196 int valuesEnd = numnonz - 1;
198 int indexesBegin = 0;
199 int indexesEnd = numnonz - 1;