00001
00013 #ifndef OSDECOMPSOLVER_H
00014 #define OSDECOMPSOLVER_H
00015
00016
00017 #include "OSInstance.h"
00018 #include "OSResult.h"
00019 #include "OSDataStructures.h"
00020 #include "OSErrorClass.h"
00021 #include "OSOption.h"
00022 #include "OSCoinSolver.h"
00023 #include "OSDecompParam.h"
00024 #include <vector>
00025 #include <string>
00026 #include <map>
00027
00028
00029
00030
00031
00039
00040 class OSDecompSolver{
00041 public:
00042
00043
00044 OSInstance *m_osinstanceMaster;
00045
00046 int m_multiCommodCutLimit;
00047 int m_numMultCuts;
00048
00049
00053 OSDecompParam m_osDecompParam;
00054
00055 double m_bestIPValue;
00056 double m_bestLPValue;
00057 double m_rootLPValue;
00058
00059
00060
00061
00062 int* m_thetaPnt;
00063 int* m_thetaIndex;
00064 int m_numThetaVar;
00065 int m_numThetaNonz;
00066
00067
00068
00069
00070
00071
00072
00073 int* m_pntBmatrix;
00074
00075 int* m_BmatrixIdx;
00076
00077 double* m_BmatrixVal;
00078
00079
00084 std::set<std::pair<int, double> > intVarSet;
00085
00087 int m_numHubs;
00088
00092 int m_numNodes;
00093
00094
00095
00096
00097
00098
00099
00100 int* m_pntAmatrix;
00101
00102 int* m_Amatrix;
00103
00104
00112 int m_numBmatrixCon;
00113 int m_numBmatrixNonz;
00114
00115
00119 int m_maxBmatrixNonz;
00120
00121
00122
00123
00128 int m_maxBmatrixCon;
00129
00130
00134 int m_maxMasterColumns;
00135
00143 int m_maxMasterRows;
00144
00145
00146
00147
00148 std::string* m_variableNames;
00149
00150
00151 OSOption *m_osoption;
00152
00153
00154 virtual OSInstance* getInitialRestrictedMaster( ) = 0;
00155
00156
00170 virtual void getCutsTheta(const double* thetaVar, const int numThetaVar,
00171 int &numNewRows, int* &numNonz, int** &colIdx,
00172 double** &values, double* &rowLB, double* &rowUB) = 0 ;
00173
00174
00190 virtual void getCutsMultiCommod(const double* thetaVar, const int numThetaVar,
00191 int &numNewRows, int* &numNonz, int** &colIdx,
00192 double** &values, double* &rowLB, double* &rowUB) = 0;
00193
00194
00195
00196
00212 virtual void getColumns(const double* yA, const int numARows,
00213 const double* yB, const int numBRows,
00214 int &numNewColumns, int* &numNonz, double* &cost,
00215 int** &rowIdx, double** &values, double &lowerBound) = 0;
00216
00217
00218
00240 virtual void getBranchingCut(const double* thetaVar, const int numThetaVar,
00241 const std::map<int, int> &varConMap, int &varIdx, int &numNonz,
00242 int* &indexes, double* &values) = 0 ;
00243
00244
00245
00267 virtual void getBranchingCut(const int* thetaIdx, const double* theta,
00268 const int numThetaVar, const std::map<int, int> &varConMap,
00269 int &varIdx, int &numNonz, int* &indexes, double* &values) = 0 ;
00270
00271
00272
00273
00274
00275
00276 virtual void pauHana(std::vector<int> &m_zOptIndexes,
00277 std::vector<double> &m_zRootLPx_vals,
00278 int numNodes, int numColsGen, std::string message) = 0;
00279
00280
00281
00292 virtual void resetMaster(std::map<int, int> &inVars, OsiSolverInterface *si ) = 0;
00293
00294
00295
00299 virtual void initializeDataStructures() = 0;
00300
00301
00306 OSDecompSolver();
00307
00312 OSDecompSolver( OSOption* osoption);
00313
00314
00319 virtual ~OSDecompSolver() = 0;
00320
00321
00322
00323
00324 };
00325
00326
00327
00328 #endif