My Project
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// --------------------------------------------------------------------- //
41public:
42
43
45
48
49
54
58
59
60
61 //the transformation matrix
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
76 //m_Bmatrix is the matrix of Xij coefficients
77 double* m_BmatrixVal;
78
79
84 std::set<std::pair<int, double> > intVarSet;
85
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
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
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
307
313
314
319 virtual ~OSDecompSolver() = 0;
320
321
322
323 //
324};//end class OSDecompSolver
325
326
327
328#endif
OSOption * osoption
OSDecompParam m_osDecompParam
share the parameters with the decomposition solver
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.
int m_maxBmatrixCon
m_maxBmatrixCon is the maximum number of B matrix constraints it is the number of tour breaking const...
OSDecompSolver(OSOption *osoption)
Constructor with OSOption Arg.
virtual ~OSDecompSolver()=0
Default destructor.
int m_numNodes
m_numNodes is the number of nodes (both pickup and hub) in the model
int m_maxMasterRows
m_maxMasterColumns is the maximumn number of rows we allow in the master, in this application it is e...
int m_numBmatrixCon
m_numBmatrixCon is the number of constraints in B - 1, we have the -1 because: m_pntBmatrix[ k] point...
int m_numHubs
m_numHubs is the number of hubs/routes
std::string * m_variableNames
virtual void initializeDataStructures()=0
allocate memory and initialize arrays
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...
OSInstance * m_osinstanceMaster
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:
OSOption * m_osoption
int m_maxMasterColumns
m_maxMasterColumns is the maximumn number of columns we allow in the master
OSDecompSolver()
Default Constructor.
virtual void getCutsTheta(const double *thetaVar, const int numThetaVar, int &numNewRows, int *&numNonz, int **&colIdx, double **&values, double *&rowLB, double *&rowUB)=0
RETURN VALUES:
virtual void getBranchingCut(const int *thetaIdx, const double *theta, const int numThetaVar, const std::map< int, int > &varConMap, int &varIdx, int &numNonz, int *&indexes, double *&values)=0
Sparse Version.
virtual void resetMaster(std::map< int, int > &inVars, OsiSolverInterface *si)=0
INPUT:
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.
int m_maxBmatrixNonz
m_maxBmatrixNonz is the maximum number of nonzero elements in the B matrix constraints
double * m_BmatrixVal
virtual void pauHana(std::vector< int > &m_zOptIndexes, std::vector< double > &m_zRootLPx_vals, int numNodes, int numColsGen, std::string message)=0
virtual OSInstance * getInitialRestrictedMaster()=0
The in-memory representation of an OSiL instance..
The Option Class.
Definition OSOption.h:3565