BlockIPPlatform
 All Classes Files Functions Variables
OsiXpress.h
Go to the documentation of this file.
1 
6 #ifndef OSI_XPRESS_H
7 #define OSI_XPRESS_H
8 #ifdef XPRESS_
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 <xprs.h>
24 
26 class EXPDLL OsiXpress : public OsiSolver {
27  private:
28  XPRSprob Xlp;
29  double consumedTime;
30  bool mpsLoaded;
31  double *solution;
32 
33  public:
34  // Constructor
35  OsiXpress();
36 
37  // Destructor
38  ~OsiXpress();
39 
40  // Solve the problem loaded with Xpress
41  STATUS solve();
42 
43  // Load a problem from a mps file
44  void readMps(const char *filename);
45 
46  // Get the name of variables
47  const string* getVarNames();
48 
49  // Get the solution
50  const double* getSolution();
51 
52  private:
53  void showXprsErrormsg(const char *sSubName,int nLineNo,int nErrCode);
54 
55  // Load the quadratic objective function cost
56  void loadQuadraticObj(double qobj[]);
57 };
58 
59 #endif //XPRESS_
60 #endif //OSI_XPRESS_H