OSDecompSolver.h
Go to the documentation of this file.
1 /* $Id: OSDecompSolver.h 3038 2009-11-07 11:43:44Z Gassmann $ */
13 #ifndef OSDECOMPSOLVER_H
14 #define OSDECOMPSOLVER_H
15 
16 // --------------------------------------------------------------------- //
17 #include "OSInstance.h"
18 #include "OSResult.h"
19 #include "OSDataStructures.h"
20 #include "OSErrorClass.h"
21 #include "OSOption.h"
22 #include "OSCoinSolver.h"
23 #include "OSDecompParam.h"
24 #include <vector>
25 #include <string>
26 #include <map>
27 
28 
29 
30 
31 // --------------------------------------------------------------------- //
39 // --------------------------------------------------------------------- //
41 public:
42 
43 
45 
48 
49 
54 
55  double m_bestIPValue;
56  double m_bestLPValue;
57  double m_rootLPValue;
58 
59 
60 
61  //the transformation matrix
62  int* m_thetaPnt;
66 
67 
68  //arrays for the added constraints
69  //for now the added constraints are
70  //tour breaking and variable branching
71  //constraints
72  //
74  //m_Bmatrix is the matrix of Xij indexes
75  int* m_BmatrixIdx;
76  //m_Bmatrix is the matrix of Xij coefficients
77  double* m_BmatrixVal;
78 
79 
84  std::set<std::pair<int, double> > intVarSet;
85 
87  int m_numHubs;
88 
93 
94 
95 
96  //arrays for the coupling constraint matrix
97  //we store indexes since values are 1.0
98  //also the RHS is 1.0
99  //the matrix has m_numNodes - m_numHubs rows
101  //m_Amatrix holds the column indexes for each row
102  int* m_Amatrix;
103  //
104 
114 
115 
120  //
121  //end arrays for added constaints
122 
123 
129 
130 
135 
144 
145 
146 
147  //these variable names are in the original variable space
148  std::string* m_variableNames;
149 
150 
152 
153 
154  virtual OSInstance* getInitialRestrictedMaster( ) = 0;
155 
156 
170  virtual void getCutsTheta(const double* thetaVar, const int numThetaVar,
171  int &numNewRows, int* &numNonz, int** &colIdx,
172  double** &values, double* &rowLB, double* &rowUB) = 0 ;
173 
174 
190  virtual void getCutsMultiCommod(const double* thetaVar, const int numThetaVar,
191  int &numNewRows, int* &numNonz, int** &colIdx,
192  double** &values, double* &rowLB, double* &rowUB) = 0;
193 
194 
195 
196 
212  virtual void getColumns(const double* yA, const int numARows,
213  const double* yB, const int numBRows,
214  int &numNewColumns, int* &numNonz, double* &cost,
215  int** &rowIdx, double** &values, double &lowerBound) = 0;
216 
217 
218 
240  virtual void getBranchingCut(const double* thetaVar, const int numThetaVar,
241  const std::map<int, int> &varConMap, int &varIdx, int &numNonz,
242  int* &indexes, double* &values) = 0 ;
243 
244 
245 
267  virtual void getBranchingCut(const int* thetaIdx, const double* theta,
268  const int numThetaVar, const std::map<int, int> &varConMap,
269  int &varIdx, int &numNonz, int* &indexes, double* &values) = 0 ;
270 
271 
272 
273 
274 
275  //this method gets called when we are done
276  virtual void pauHana(std::vector<int> &m_zOptIndexes,
277  std::vector<double> &m_zRootLPx_vals,
278  int numNodes, int numColsGen, std::string message) = 0;
279 
280 
281 
292  virtual void resetMaster(std::map<int, int> &inVars, OsiSolverInterface *si ) = 0;
293 
294 
295 
299  virtual void initializeDataStructures() = 0;
300 
301 
306  OSDecompSolver();
307 
313 
314 
319  virtual ~OSDecompSolver() = 0;
320 
321 
322 
323  //
324 };//end class OSDecompSolver
325 
326 
327 
328 #endif
double * values
virtual void getCutsTheta(const double *thetaVar, const int numThetaVar, int &numNewRows, int *&numNonz, int **&colIdx, double **&values, double *&rowLB, double *&rowUB)=0
RETURN VALUES:
int m_maxMasterRows
m_maxMasterColumns is the maximumn number of rows we allow in the master, in this application it is e...
double m_bestLPValue
OSOption * osoption
OSInstance * m_osinstanceMaster
OSDecompSolver()
Default Constructor.
int m_numBmatrixCon
m_numBmatrixCon is the number of constraints in B - 1, we have the -1 because: m_pntBmatrix[ k] point...
The Option Class.
Definition: OSOption.h:3564
virtual void getCutsMultiCommod(const double *thetaVar, const int numThetaVar, int &numNewRows, int *&numNonz, int **&colIdx, double **&values, double *&rowLB, double *&rowUB)=0
This is the routine that generates the multi-item cuts.
double m_rootLPValue
std::set< std::pair< int, double > > intVarSet
intVarSet holds and std::pair where the first element is the index of an integer variable and the sec...
virtual void getColumns(const double *yA, const int numARows, const double *yB, const int numBRows, int &numNewColumns, int *&numNonz, double *&cost, int **&rowIdx, double **&values, double &lowerBound)=0
RETURN VALUES:
virtual ~OSDecompSolver()=0
Default destructor.
double * m_BmatrixVal
virtual void initializeDataStructures()=0
allocate memory and initialize arrays
virtual void pauHana(std::vector< int > &m_zOptIndexes, std::vector< double > &m_zRootLPx_vals, int numNodes, int numColsGen, std::string message)=0
int m_numNodes
m_numNodes is the number of nodes (both pickup and hub) in the model
virtual void getBranchingCut(const double *thetaVar, const int numThetaVar, const std::map< int, int > &varConMap, int &varIdx, int &numNonz, int *&indexes, double *&values)=0
Dense Version.
std::string * m_variableNames
int m_maxBmatrixNonz
m_maxBmatrixNonz is the maximum number of nonzero elements in the B matrix constraints ...
The in-memory representation of an OSiL instance..
Definition: OSInstance.h:2262
virtual void resetMaster(std::map< int, int > &inVars, OsiSolverInterface *si)=0
INPUT:
OSDecompParam m_osDecompParam
share the parameters with the decomposition solver
int m_numHubs
m_numHubs is the number of hubs/routes
double m_bestIPValue
int m_maxMasterColumns
m_maxMasterColumns is the maximumn number of columns we allow in the master
int m_maxBmatrixCon
m_maxBmatrixCon is the maximum number of B matrix constraints it is the number of tour breaking const...
virtual OSInstance * getInitialRestrictedMaster()=0
OSOption * m_osoption