From Matthew.Galati at sas.com Thu Feb 2 11:18:23 2006 From: Matthew.Galati at sas.com (Matthew Galati) Date: Thu, 2 Feb 2006 11:18:23 -0500 Subject: [Coin-SMI] smps to mps Message-ID: Hi, I know there is a method for translating SMPS to MPS (deterministic equivalent). I was wondering if anyone had already done this for some benchmark instances. For example, from: http://www2.isye.gatech.edu/~sahmed/siplib/ ? I tried one example from SIPLIB, I first had to change the names to .core, .stoch, .time. But, it failed: #include "SmiScnModel.hpp" #include "OsiClpSolverInterface.hpp" int main(int argc, char ** argv){ SmiScnModel smi; const char * base = argv[1]; // read SMPS model from files // .core, .time, and .stoch smi.readSmps(base); // generate OSI solver object // here we use OsiClp OsiClpSolverInterface *clp = new OsiClpSolverInterface(); // set solver object for SmiScnModel smi.setOsiSolverHandle(*clp); // load solver data // this step generates the deterministic equivalent // and returns an OsiSolver object OsiSolverInterface *osiStoch = smi.loadOsiSolverData(); // set some nice Hints to the OSI solver osiStoch->writeMps(base); return 0; } magala at ordsrv3 /cygdrive/d/ormpdata/milp/siplib $ gdb ./coin_smps2mps GNU gdb 6.3.50_2004-12-28-cvs (cygwin-special) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-cygwin"... (gdb) set args sslp_15_45_15 (gdb) r Starting program: /cygdrive/d/ormpdata/milp/siplib/coin_smps2mps.exe sslp_15_45_ 15 Coin0001I At line 1 NAME SSLP_15_45_15 Coin0001I At line 2 ROWS Coin0001I At line 65 COLUMNS Coin0001I At line 1447 RHS Coin0001I At line 1471 BOUNDS Coin0001I At line 2162 ENDATA Coin0002I Problem SSLP_15_45_15 has 61 rows, 705 columns and 1379 elements Coin0001I At line 1 TIME SSLP_15_45_15 Coin0001I At line 2 PERIODS LP Coin0001I At line 5 ENDATA Coin0001I At line 1 STOCH SSLP_15_45_15 Coin0001I At line 2 SCENARIOS DISCRETE Coin0001I At line 693 ENDATA Program received signal SIGSEGV, Segmentation fault. 0x00406bac in SmiNodeData::combineWithCoreDoubleArray () (gdb) where #0 0x00406bac in SmiNodeData::combineWithCoreDoubleArray () #1 0x00406d94 in SmiNodeData::copyColLower () #2 0x00401621 in SmiScnModel::addNode () #3 0x005a9cca in std::for_each<__gnu_cxx::__normal_iterator > >, SmiScnModelAddNode> () at /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/iostream:77 #4 0x004019ca in SmiScnModel::loadOsiSolverData () #5 0x004012ed in main () (gdb) Matthew Galati - Optimization Developer SAS Institute - Analytical Solutions Phone 919-531-0332, R5327 Fax 919-677-4444 http://coral.ie.lehigh.edu/~magh http://ordlnx2.na.sas.com/projects/OptWiki http://www.sas.com/technologies/analytics/optimization/ From alois.geyer at wu-wien.ac.at Wed Feb 15 09:15:18 2006 From: alois.geyer at wu-wien.ac.at (Alois Geyer) Date: Wed, 15 Feb 2006 15:15:18 +0100 Subject: [Coin-SMI] OSLSE vs COIN (problem with readSMPS) Message-ID: <43F34586.23441.164A4E7@alois.geyer.wu-wien.ac.at> I have noticed some discrepancies between solutions obtained from OSLSE and COIN (e.g. using the KandW3 example and others). to investigate this issue further I have looked more closely to the results of readSMPS (among other things). what seems strange is the following: ? if the row sense in the core-file is 'G' or 'L', the stoch-file uses the REPLACE option and the RHS is stochastic "osiStoch->getRowSense()" returns 'R' rather than 'G' or 'L' (see code excerpt from unitTest.cpp below). I understand that 'R' could be used on purpose to indicate that the RHS is stochastic/random. but 'R' does not appear if the row sense is 'E' or the RHS is non-stochastic. in addition, the RHS of 'L' constraints is not replaced by the stoch-file entry. the RHS of 'G' constraints is replaced! another observation: using ADD in the the stoch-file does not change 'G' or 'L' to 'R' (as above) but the stochastic RHS is not added to the RHS from the core-file. it is only added for equality constraints ('E'). has anyone else made similar observations? how can this problem be resolved? ~~Alois { ? ? ? ? ? ? // test SMPS files KandW3R ? ? ? ? ? ? printf(" *** testing KandW3.\n"); ? ? ? ? ? ? SmiScnModel smi; ? ? ? ? ? ? ? smi.readSmps("../../Mps/Stochastic/KandW3R"); ? ? ? ? ? ? ? ? ? ? OsiClpSolverInterface *clp = new OsiClpSolverInterface(); ? ? ? ? ? ? smi.setOsiSolverHandle(*clp); ? ? ? ? ? ? OsiSolverInterface *osiStoch = smi.loadOsiSolverData(); ? ? ? ? ? ? ? ? ? //+AG* ? ? ? ? ? ? int nrows = osiStoch->getNumRows(); ? ? ? ? ? ? int ncols = osiStoch->getNumCols(); ? ? ? ? ? ? const char * rs ?= osiStoch->getRowSense(); ? ? ? ? ? ? const double * rhs = osiStoch->getRightHandSide(); ? ? ? ? ? ? int i; ? ? ? ? ? ? ? ? for (i=0;iinitialSolve(); ? ? ? ? ? ? ? ?assert(fabs(osiStoch->getObjValue()2613.0) < 0.0001); ? ? ? } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.coin-or.org/pipermail/smi/attachments/20060215/8beb8655/attachment.html