OSCoinSolver.h
Go to the documentation of this file.
1 /* $Id: OSCoinSolver.h 5284 2017-12-08 13:52:50Z stefan $ */
15 #ifndef COINSOLVER_H
16 #define COINSOLVER_H
17 
18 #include "OSConfig.h"
19 #include "OSDefaultSolver.h"
20 #include "OSrLWriter.h"
21 #include "OSErrorClass.h"
22 #include "OSiLReader.h"
23 #include "OSoLReader.h"
24 #include "CbcModel.hpp"
25 
26 #include <string>
27 
28 class OsiSolverInterface;
29 class CoinPackedMatrix;
30 
37 class CoinSolver : public DefaultSolver
38 {
39 
40 public:
41 
45  CoinSolver();
46 
50  ~CoinSolver();
51 
56  virtual void solve() throw(ErrorClass);
57 
62  virtual void buildSolverInstance() throw(ErrorClass);
63 
68  virtual void setSolverOptions() throw(ErrorClass);
69 
70 
75  bool setCoinPackedMatrix();
76 
82  std::string getCoinSolverType(std::string osol_);
83 
88  void dataEchoCheck();
89 
93  OsiSolverInterface *osiSolver;
94 
95 
96 
102 
108 
109 
110  void writeResult(OsiSolverInterface *solver);
111 
112  // use this for when we solve with Cbc --AND-- have integer variables
113  void writeResult(CbcModel *model);
114 
115 
116 
117 private:
118 
119 
120 
121 
122 
126  CoinPackedMatrix *m_CoinPackedMatrix ;
127 
130 
134  const char **cbc_argv;
135 
139 
140  double cpuTime;
141 
142 };
143 #endif
~CoinSolver()
The class destructor.
OsiSolverInterface * osiSolver
osiSolver is the osi solver object – in this case clp, glpk, cbc, cplex, symphony or dylp ...
Definition: OSCoinSolver.h:93
CoinPackedMatrix * m_CoinPackedMatrix
m_CoinPackedMatrix is a Coin Packed Matrix ojbect
Definition: OSCoinSolver.h:126
Take an OSResult object and write a string that validates against OSrL.
Definition: OSrLWriter.h:30
CoinSolver()
The class constructor.
virtual void buildSolverInstance()
The implementation of the corresponding virtual function.
std::string getCoinSolverType(std::string osol_)
Get the solver type, e.g. clp or glpk.
double cpuTime
Definition: OSCoinSolver.h:140
Used to read an OSiL string.
Definition: OSiLReader.h:37
const char ** cbc_argv
when Cbc is the solver, these are the arguments sent to Cbc Solve
Definition: OSCoinSolver.h:134
void writeResult(OsiSolverInterface *solver)
OSiLReader * m_osilreader
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed ...
Definition: OSCoinSolver.h:101
int num_cbc_argv
the number of arguments in the argument list to the Cbc Solver
Definition: OSCoinSolver.h:138
The Default Solver Class.
bool setCoinPackedMatrix()
Create a CoinPackedMatrix.
OSoLReader * m_osolreader
m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed ...
Definition: OSCoinSolver.h:107
OSrLWriter * osrlwriter
osrlwriter object used to write osrl from an OSResult object
Definition: OSCoinSolver.h:129
Used to read an OSoL string.
Definition: OSoLReader.h:37
Implements a solve method for the Coin solvers.
Definition: OSCoinSolver.h:37
void dataEchoCheck()
Print out problem parameters.
virtual void solve()
The implementation of the corresponding virtual function.
used for throwing exceptions.
Definition: OSErrorClass.h:31
virtual void setSolverOptions()
The implementation of the corresponding virtual function.