// $Id: readconic.cpp 1898 2013-04-09 18:06:04Z stefan $ // Copyright (C) 2005, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #include "CoinMpsIO.hpp" int main (int argc, const char *argv[]) { CoinMpsIO m_MpsData; int nOfSOS; CoinSet ** SOS = NULL; std::string mpsFileName; #if defined(SAMPLEDIR) mpsFileName = SAMPLEDIR "/conic.mps"; #else if (argc < 2) { fprintf(stderr, "Do not know where to find sample MPS files.\n"); exit(1); } #endif if (argc>=2) mpsFileName = argv[1]; int status = m_MpsData.readMps( mpsFileName.c_str(), "", nOfSOS, SOS ); assert (!status); int * columnStart = NULL; int * columnIdx = NULL; double * elements = NULL; status = m_MpsData.readQuadraticMps(NULL, columnStart, columnIdx, elements, 0); assert (!status); int nOfCones; int * coneStart = NULL; int * coneIdx = NULL; int * coneType = NULL; status = m_MpsData.readConicMps(NULL, coneStart, coneIdx, coneType, nOfCones); assert (!status); if (nOfSOS) { printf("%d SOS sets\n",nOfSOS); for (int iSOS=0;iSOSnumberEntries(); printf("Set %d has %d entries - type %d\n",iSOS,numberEntries,SOS[iSOS]->setType()); const int * which = SOS[iSOS]->which(); const double * weights = SOS[iSOS]->weights(); for (int i=0;i