BlockIPPlatform
 All Classes Files Functions Variables
OsiCplex.h
Go to the documentation of this file.
1 
6 #ifndef OSI_CPLEX_H
7 #define OSI_CPLEX_H
8 #ifdef CPLEX_
9 
10 #ifndef EXPDLL
11 #ifdef WIN32
12 #ifdef OSI_INTERFACE_EXPORTS
13 #define EXPDLL __declspec(dllexport)
14 #else
15 #define EXPDLL __declspec(dllimport)
16 #endif //OSI_INTERFACE_EXPORTS
17 #else
18 #define EXPDLL
19 #endif //WIN32
20 #endif //EXPDLL
21 
22 #include "OsiSolver.h"
23 #include <ilcplex/cplex.h>
24 
26 class EXPDLL OsiCplex : public OsiSolver {
27  private:
28  CPXENVptr env;
29  CPXLPptr Clp;
30  bool mpsLoaded;
31 
32  public:
33  // Constructor
34  OsiCplex();
35 
36  // Destructor
37  ~OsiCplex();
38 
39  // Solve the problem loaded with Cplex
40  STATUS solve();
41 
42  // Load a problem from a mps file
43  void readMps(const char *filename);
44 
45  // Get the name of variables
46  const string* getVarNames();
47 
48  private:
49  void showCpxStatus(int status);
50 
51  // Load the quadratic objective function cost
52  void loadQuadraticObj(double qobj[]);
53 };
54 
55 #endif //CPLEX_
56 #endif //OSI_CPLEX_H