6 #ifndef BLOCKIP_INTERFACE_H
7 #define BLOCKIP_INTERFACE_H
11 #ifdef BLOCKIP_INTERFACE_EXPORTS
12 #define EXPDLL __declspec(dllexport)
14 #define EXPDLL __declspec(dllimport)
15 #endif //BLOCKIP_INTERFACE_EXPORTS
26 #endif // OSI_INTERFACE
35 enum SOLVER{CPLEX, XPRESS, GLPK, CLP, BLOCKIP, BLOCKIP_MATLAB, NONE};
36 enum OPT_STATUS{OPTIMAL_SOLUTION, TIME_LIMIT_INFEAS, TIME_LIMIT_FEAS, FEASIBLE, INFEASIBLE, OTHERWISE, UNBOUNDED};
37 enum TYPE_INPUT {NO_INPUT, MPS, AMPL, BLOCKIP_FORMAT};
44 #endif // OSI_INTERFACE
96 void setSolver(SOLVER solver);
102 void setMaxTime(
double time);
108 void setMaxThreads(
int numThreads);
114 void setLogFilename(
char *filename);
117 const char* getLogFilename();
120 void setSolFilename(
char *filename);
123 const char* getSolFilename();
126 BlockIP* getBlockIPInterface();
131 #endif // OSI_INTERFACE
134 void readMps(
const char *filename);
137 void readAmpl(
const char *modelFilename,
const char *dataFilename);
140 void readBlockIPFormat(
const char *filename);
143 void amplToMps(
const char *modelFilename,
const char *dataFilename,
const char *mpsFilename,
bool convertToStd=
false);
146 void amplToBlockIPFormat(
const char *modelFilename,
const char *dataFilename,
const char *BlockIPFormatFilename,
bool convertToStd=
false);
149 void mpsToBlockIPFormat(
const char *mpsFilename,
const char *BlockIPFormatFilename,
bool convertToStd=
false);
152 void BlockIPFormatToMps(
const char *BlockIPFormatFilename,
const char *mpsFilename,
bool convertToStd=
false);
158 double getObjValue();
161 const double* getSolution();
168 double getDualValue();
178 void printX(
int globalVarIndex);
179 void printX(
string varName);
180 void printX(
int blockIndex,
int varIndex);
181 void printX(
string blockName,
int varIndex);
182 void printXBlock(
int blockIndex);
183 void printXBlock(
string blockName);
185 void printXSlack(
int slackIndex);
189 void printRC(
int globalVarIndex);
190 void printRC(
string varName);
191 void printRC(
int blockIndex,
int varIndex);
192 void printRC(
string blockName,
int varIndex);
193 void printRCBlock(
int blockIndex);
194 void printRCBlock(
string blockName);
196 void printRCSlack(
int slackIndex);
200 void printCons(
int globalConsIndex);
201 void printCons(
string consName);
202 void printCons(
int blockIndex,
int consIndex);
203 void printCons(
string blockName,
int consIndex);
204 void printConsBlock(
int blockIndex);
205 void printConsBlock(
string blockName);
206 void printConsLinking();
207 void printConsLinking(
int linkingIndex);
215 void createMatlabProblem();
224 #ifndef OSI_INTERFACE
225 if (solver == CPLEX || solver == XPRESS || solver == GLPK || solver == CLP)
228 this->solver = solver;
240 this->maxTime = time;
255 this->numThreads = numThreads;
300 #endif // OSI_INTERFACE
308 inline double BlockIPInterface::getDualValue()
314 inline int BlockIPInterface::getIter()
320 inline int BlockIPInterface::getPCGIter()
326 inline double BlockIPInterface::getCPUsec()
332 #endif //BLOCKIP_INTERFACE_H