00001 /* $Id: OSCoinSolver.h 2698 2009-06-09 04:14:07Z kmartin $ */ 00017 #ifndef COINSOLVER_H 00018 #define COINSOLVER_H 00019 00020 #include "OSConfig.h" 00021 #include "OSDefaultSolver.h" 00022 #include "OSrLWriter.h" 00023 #include "OSErrorClass.h" 00024 #include "OSiLReader.h" 00025 #include "OSoLReader.h" 00026 #include "CbcModel.hpp" 00027 00028 #include <string> 00029 00030 class OsiSolverInterface; 00031 class CoinPackedMatrix; 00032 00039 class CoinSolver : public DefaultSolver{ 00040 00041 public: 00042 00046 CoinSolver(); 00047 00051 ~CoinSolver(); 00052 00057 virtual void solve() throw(ErrorClass); 00058 00063 virtual void buildSolverInstance() throw(ErrorClass); 00064 00069 virtual void setSolverOptions() throw(ErrorClass); 00070 00071 00076 bool setCoinPackedMatrix(); 00077 00083 std::string getCoinSolverType(std::string osol_); 00084 00089 void dataEchoCheck(); 00090 00094 OsiSolverInterface *osiSolver; 00095 00096 00097 00102 OSiLReader *m_osilreader; 00103 00108 OSoLReader *m_osolreader; 00109 00110 00111 void writeResult(OsiSolverInterface *solver); 00112 00113 // use this for when we solve with Cbc --AND-- have integer variables 00114 void writeResult(CbcModel *model); 00115 00116 00117 00118 private: 00119 00120 00121 00122 00123 00127 CoinPackedMatrix *m_CoinPackedMatrix ; 00128 00130 OSrLWriter *osrlwriter; 00131 00135 const char **cbc_argv; 00136 00139 int num_cbc_argv; 00140 00141 double cpuTime; 00142 00143 }; 00144 #endif