OSDipInterface.h
Go to the documentation of this file.
1 /* $Id: OSDipInterface.h 3038 2009-11-07 11:43:44Z Gassmann $ */
16 #ifndef OSDIPINTERFACE_H
17 #define OSDIPINTERFACE_H
18 
19 //===========================================================================//
20 #include "UtilMacros.h"
21 #include "OSInstance.h"
22 #include "OSCoinSolver.h"
23 #include "OSConfig.h"
24 #include "OSResult.h"
25 #include "OSOption.h"
26 #include "OSiLReader.h"
27 #include "OSiLWriter.h"
28 #include "OSoLReader.h"
29 #include "OSoLWriter.h"
30 #include "OSrLReader.h"
31 #include "OSrLWriter.h"
32 #include "OSInstance.h"
33 #include "OSFileUtil.h"
34 #include "CoinError.hpp"
35 #include "OSDefaultSolver.h"
36 #include "OSWSUtil.h"
37 #include "OSErrorClass.h"
38 #include "OSMathUtil.h"
39 #include "CoinHelperFunctions.hpp"
40 
41 
42 
43 #include <set>
44 #include <map>
45 #include <vector>
46 
47 //===========================================================================//
56 //===========================================================================//
58 
59 
60 public:
61 
64  double m_bestKnownLB;
65  double m_bestKnownUB;
66 
67 
68 
74  CoinPackedMatrix *m_coinpm;
75  CoinPackedVector *m_row ;
76 
77 
79  void readOSiL(std::string & filename);
80 
81  void readOSoL(std::string & filename);
82 
83  CoinPackedVector *getRow( int i);
84 
85  //return a CoinPackedMatrix
86  CoinPackedMatrix *getCoinPackedMatrix( );
87 
93  const char* getIntegerColumns();
94 
95  //get the objective function constant
96  double getObjectiveOffset() ;
97 
98 
99  //get the set of variable indexes for each block in the model
100  std::vector<std::set<int> > getBlockVarIndexes();
101  std::vector<std::set<int> > m_blockVariableIndexes;
103 
104  //get the set of core constraint indexes
105  std::set<int> getCoreConstraintIndexes();
106  std::set<int> m_coreConstraintIndexes;
108 
109  //get a map of constraint indexes for each block in the model
110  //the key is the index of the constraint in the original problem
111  //the key points to the index number in the block
112  std::vector<std::map<int, int> > getBlockConstraintIndexes();
113  std::vector<std::map<int, int> > m_blockConstraintIndexes;
115 
116  //get and osinstance that corresponds to each block in the model
117  std::vector<OSInstance* > getBlockOSInstances();
118  std::vector<OSInstance* > m_blockOSInstances;
120 
121 
122  //get factory solver for each block in the model
123  std::vector<std::string > getBlockFactories();
124  std::vector<std::string > m_blockFactories;
126 
127 
128  //get the objective function coefficients
129  double *getObjectiveFunctionCoeff();
130 
131 
132  inline const double getBestKnownLB() const {return m_bestKnownLB;} //kipp can we get rid of this
133  inline const double getBestKnownUB() const {return m_bestKnownUB;} // kipp can we get rid of this
134 
135 
136  //some OS wrapper methods
137 
144  inline const std::string* getObjectiveMaxOrMins() const {return m_osinstance->getObjectiveMaxOrMins();}
145 
146 
153  inline const double* getObjectiveConstants() const {return m_osinstance->getObjectiveConstants();}
154 
161  inline const double* getObjectiveWeights() const {return m_osinstance->getObjectiveWeights();}
162 
168 
174 
175 
181  inline const int getVariableNumber() const {return m_osinstance->getVariableNumber();}
182 
188  inline const int getConstraintNumber() const {return m_osinstance->getConstraintNumber();}
189 
195  inline const double* getColLower() const {return m_osinstance->getVariableLowerBounds();}
196 
197 
203  inline const double* getColUpper() const {return m_osinstance->getVariableUpperBounds();}
204 
205 
211  inline const std::string* getVariableNames() const {return m_osinstance->getVariableNames();}
212 
213 
219  inline const double* getRowLower() const {return m_osinstance->getConstraintLowerBounds();}
220 
221 
227  inline const double* getRowUpper() const {return m_osinstance->getConstraintUpperBounds();}
228 
229 
235  inline const std::string* getConstraintNames() const {return m_osinstance->getConstraintNames();}
236 
237 
238  std::map<int, std::vector< int> > generateInitialMaster();
239 
240  //end wrapper methods
241 
243  OS_DipInterface();
244 
247 };
248 
249 #endif
double * getConstraintLowerBounds()
Get constraint lower bounds.
double * getVariableLowerBounds()
Get variable lower bounds.
double * getConstraintUpperBounds()
Get constraint upper bounds.
int getNumberOfIntegerVariables()
getNumberOfIntegerVariables
CoinPackedMatrix * getCoinPackedMatrix()
Returns array[getNumCols()] specifying if a variable is integer.
bool m_blockOSInstancesProcessed
Returns array[getNumCols()] specifying if a variable is integer.
const int getVariableNumber() const
Get variable number.
bool m_coreConstraintIndexesProcessed
Returns array[getNumCols()] specifying if a variable is integer.
int getVariableNumber()
Get number of variables.
const int getNumberOfBinaryVariables() const
getNumberOfBinaryVariables
const double * getColLower() const
Get variable lower bounds.
std::vector< std::set< int > > m_blockVariableIndexes
Returns array[getNumCols()] specifying if a variable is integer.
const double getBestKnownUB() const
Returns array[getNumCols()] specifying if a variable is integer.
bool m_blockVariableIndexesProcessed
Returns array[getNumCols()] specifying if a variable is integer.
CoinPackedMatrix * m_coinpm
double * getObjectiveFunctionCoeff()
Returns array[getNumCols()] specifying if a variable is integer.
OSiLReader * m_osilreader
std::string * getVariableNames()
Get variable names.
The Option Class.
Definition: OSOption.h:3564
CoinPackedVector * getRow(int i)
Returns array[getNumCols()] specifying if a variable is integer.
double * getObjectiveWeights()
Get objective weights.
const double * getColUpper() const
Get variable upper bounds.
const double * getObjectiveWeights() const
Get objective weights.
const std::string * getConstraintNames() const
Get constraint names.
std::vector< std::set< int > > getBlockVarIndexes()
Returns array[getNumCols()] specifying if a variable is integer.
const std::string * getObjectiveMaxOrMins() const
Get objective maxOrMins.
std::vector< std::map< int, int > > getBlockConstraintIndexes()
Returns array[getNumCols()] specifying if a variable is integer.
~OS_DipInterface()
class destructor
void readOSiL(std::string &filename)
Returns array[getNumCols()] specifying if a variable is integer.
Used to read an OSiL string.
Definition: OSiLReader.h:37
const double * getRowUpper() const
Get constraint upper bounds.
double getObjectiveOffset()
Returns array[getNumCols()] specifying if a variable is integer.
OSOption * m_osoption
const double getBestKnownLB() const
Returns array[getNumCols()] specifying if a variable is integer.
OS_DipInterface()
class constructor
OSoLReader * m_osolreader
std::string * getObjectiveMaxOrMins()
Get objective maxOrMins.
CoinPackedVector * m_row
double * getObjectiveConstants()
Get objective constants.
const int getConstraintNumber() const
Get constraint number.
const double * getObjectiveConstants() const
Get objective constants.
const double * getRowLower() const
Get constraint lower bounds.
std::set< int > getCoreConstraintIndexes()
Returns array[getNumCols()] specifying if a variable is integer.
int getConstraintNumber()
Get number of constraints.
void readOSoL(std::string &filename)
Returns array[getNumCols()] specifying if a variable is integer.
std::vector< OSInstance * > getBlockOSInstances()
Returns array[getNumCols()] specifying if a variable is integer.
const std::string * getVariableNames() const
Get variable names.
Used to read an OSoL string.
Definition: OSoLReader.h:37
std::vector< std::map< int, int > > m_blockConstraintIndexes
Returns array[getNumCols()] specifying if a variable is integer.
std::vector< OSInstance * > m_blockOSInstances
Returns array[getNumCols()] specifying if a variable is integer.
std::vector< std::string > getBlockFactories()
Returns array[getNumCols()] specifying if a variable is integer.
double * getVariableUpperBounds()
Get variable upper bounds.
const char * getIntegerColumns()
Returns array[getNumCols()] specifying if a variable is integer.
bool m_blockConstraintIndexesProcessed
Returns array[getNumCols()] specifying if a variable is integer.
bool m_isProvenOptimal
Best known LB/UB.
OSInstance * m_osinstance
std::vector< std::string > m_blockFactories
Returns array[getNumCols()] specifying if a variable is integer.
const int getNumberOfIntegerVariables() const
getNumberOfIntegerVariables
The in-memory representation of an OSiL instance..
Definition: OSInstance.h:2262
std::string * getConstraintNames()
Get constraint names.
std::set< int > m_coreConstraintIndexes
Returns array[getNumCols()] specifying if a variable is integer.
bool m_blockFactoriesProcessed
Returns array[getNumCols()] specifying if a variable is integer.
std::map< int, std::vector< int > > generateInitialMaster()
Returns array[getNumCols()] specifying if a variable is integer.
int getNumberOfBinaryVariables()
getNumberOfBinaryVariables