/home/coin/SVN-release/OS-2.3.2/ApplicationTemplates/osDip/OSDipInterface.h

Go to the documentation of this file.
00001 /* $Id: OSDipInterface.h 3038 2009-11-07 11:43:44Z Gassmann $ */
00018 #ifndef OSDIPINTERFACE_H
00019 #define OSDIPINTERFACE_H
00020 
00021 //===========================================================================//
00022 #include "UtilMacros.h"
00023 #include "OSInstance.h"
00024 #include "OSCoinSolver.h"
00025 #include "OSConfig.h"
00026 #include "OSResult.h" 
00027 #include "OSOption.h"
00028 #include "OSiLReader.h"        
00029 #include "OSiLWriter.h" 
00030 #include "OSoLReader.h"        
00031 #include "OSoLWriter.h" 
00032 #include "OSrLReader.h"          
00033 #include "OSrLWriter.h"      
00034 #include "OSInstance.h"  
00035 #include "OSFileUtil.h"  
00036 #include "CoinError.hpp"
00037 #include "OSDefaultSolver.h"  
00038 #include "OSWSUtil.h"     
00039 #include "OSErrorClass.h"
00040 #include "OSMathUtil.h"
00041 #include "CoinHelperFunctions.hpp"
00042 
00043 
00044 
00045 #include <set>
00046 #include <map>
00047 #include <vector>
00048 
00049 //===========================================================================//
00058 //===========================================================================//
00059 class OS_DipInterface {
00060 
00061 
00062 public:
00063 
00065         bool      m_isProvenOptimal;
00066         double    m_bestKnownLB;
00067         double    m_bestKnownUB;
00068 
00069 
00070 
00071         OSInstance *m_osinstance;
00072         OSOption *m_osoption;   
00073         OSiLReader *m_osilreader;
00074         OSoLReader *m_osolreader;
00075         char* m_integerVars;
00076         CoinPackedMatrix *m_coinpm;
00077         CoinPackedVector *m_row ;
00078 
00079 
00081         void readOSiL(string & filename);
00082         
00083         void readOSoL(string & filename);
00084 
00085         CoinPackedVector *getRow( int i);
00086         
00087         //return a CoinPackedMatrix
00088         CoinPackedMatrix *getCoinPackedMatrix( );
00089         
00095         const char* getIntegerColumns();
00096         
00097         //get the objective function constant
00098         double getObjectiveOffset()     ;
00099         
00100         
00101         //get the set of variable indexes for each block in the model
00102         std::vector<std::set<int> > getBlockVarIndexes();
00103         std::vector<std::set<int> > m_blockVariableIndexes;
00104         bool m_blockVariableIndexesProcessed;
00105                 
00106         //get the set of core constraint indexes
00107         std::set<int>  getCoreConstraintIndexes();
00108         std::set<int> m_coreConstraintIndexes;
00109         bool m_coreConstraintIndexesProcessed;
00110         
00111         //get a map of constraint indexes for each block in the model
00112         //the key is the index of the constraint in the original problem
00113         //the key points to the index number in the block
00114         std::vector<std::map<int, int> > getBlockConstraintIndexes();
00115         std::vector<std::map<int, int> > m_blockConstraintIndexes;
00116         bool m_blockConstraintIndexesProcessed;
00117         
00118         //get and osinstance that corresponds to each block in the model
00119         std::vector<OSInstance* > getBlockOSInstances();
00120         std::vector<OSInstance* > m_blockOSInstances;
00121         bool m_blockOSInstancesProcessed;
00122         
00123         
00124         //get factory solver for each block in the model
00125         std::vector<std::string > getBlockFactories();
00126         std::vector<std::string > m_blockFactories;
00127         bool m_blockFactoriesProcessed;
00128         
00129         
00130         //get the objective function coefficients
00131         double *getObjectiveFunctionCoeff();
00132         
00133 
00134         inline const double getBestKnownLB() const {return m_bestKnownLB;} //kipp can we get rid of this
00135         inline const double getBestKnownUB() const {return m_bestKnownUB;} // kipp can we get rid of this
00136 
00137 
00138         //some OS wrapper methods
00139 
00146         inline const std::string* getObjectiveMaxOrMins() const {return m_osinstance->getObjectiveMaxOrMins();} 
00147 
00148 
00155         inline const double* getObjectiveConstants() const {return m_osinstance->getObjectiveConstants();} 
00156 
00163         inline const double* getObjectiveWeights() const {return m_osinstance->getObjectiveWeights();} 
00164 
00169         inline const int getNumberOfIntegerVariables() const {return m_osinstance->getNumberOfIntegerVariables();} 
00170 
00175         inline const int getNumberOfBinaryVariables() const {return m_osinstance->getNumberOfBinaryVariables();}
00176         
00177 
00183         inline const int getVariableNumber() const {return m_osinstance->getVariableNumber();} 
00184 
00190         inline const int getConstraintNumber() const {return m_osinstance->getConstraintNumber();} 
00191         
00197         inline const double* getColLower() const {return m_osinstance->getVariableLowerBounds();} 
00198         
00199                 
00205         inline const double* getColUpper() const {return m_osinstance->getVariableUpperBounds();} 
00206         
00207         
00213         inline const std::string* getVariableNames() const {return m_osinstance->getVariableNames();} 
00214         
00215         
00221         inline const double* getRowLower() const {return m_osinstance->getConstraintLowerBounds();} 
00222         
00223 
00229         inline const double* getRowUpper() const {return m_osinstance->getConstraintUpperBounds();} 
00230         
00231         
00237         inline const std::string* getConstraintNames() const {return m_osinstance->getConstraintNames();} 
00238         
00239         
00240         std::map<int, std::vector< int> > generateInitialMaster();
00241         
00242         //end wrapper methods
00243 
00245         OS_DipInterface();
00246         
00248         ~OS_DipInterface();
00249 };
00250 
00251 #endif

Generated on Fri Jan 7 03:24:38 2011 by  doxygen 1.4.7