- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/Cgl-0.55.0/Cgl/src/CglPreProcess/CglPreProcess.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2005, International Business Machines
    00002 // Corporation and others.  All Rights Reserved.
    00003 #ifndef CglPreProcess_H
    00004 #define CglPreProcess_H
    00005
    00006 #include <string>
    00007 #include <vector>
    00008
    00009 #include "CoinFinite.hpp"
    00010 #include "CoinMessageHandler.hpp"
    00011 #include "OsiSolverInterface.hpp"
    00012 #include "CglStored.hpp"
    00013 #include "OsiPresolve.hpp"
    00014 #include "CglCutGenerator.hpp"
    00015
    00016 //#############################################################################
    00017
    00035 class CglPreProcess  {
    00036
    00037 public:
    00038
    00040
    00041
    00050   OsiSolverInterface * preProcess(OsiSolverInterface & model,
    00051                                   bool makeEquality=false, int numberPasses=5);
    00063   OsiSolverInterface * preProcessNonDefault(OsiSolverInterface & model,
    00064                                   int makeEquality=0, int numberPasses=5,
    00065                                             int tuning=0);
    00067   void postProcess(OsiSolverInterface &model);
    00075   int tightenPrimalBounds(OsiSolverInterface & model,double factor=0.0);
    00082   OsiSolverInterface * someFixed(OsiSolverInterface & model,
    00083                                  double fractionToKeep=0.25,
    00084                                  bool fixContinuousAsWell=false,
    00085                                  char * keep=NULL) const;
    00087   int reducedCostFix(OsiSolverInterface & model);
    00089
    00090   //---------------------------------------------------------------------------
    00091
    00106   void setCutoff(double value) ;
    00107
    00109   double getCutoff() const;
    00111   inline OsiSolverInterface * originalModel() const
    00112   { return originalModel_;}
    00114   inline OsiSolverInterface * startModel() const
    00115   { return startModel_;}
    00117   inline OsiSolverInterface * modelAtPass(int iPass) const
    00118   { if (iPass>=0&&iPass<numberSolvers_) return model_[iPass]; else return NULL;}
    00120   inline OsiSolverInterface * modifiedModel(int iPass) const
    00121   { if (iPass>=0&&iPass<numberSolvers_) return modifiedModel_[iPass]; else return NULL;}
    00123   inline OsiPresolve * presolve(int iPass) const
    00124   { if (iPass>=0&&iPass<numberSolvers_) return presolve_[iPass]; else return NULL;}
    00127   const int * originalColumns() const;
    00130   const int * originalRows() const;
    00132   inline int numberSOS() const
    00133   { return numberSOS_;}
    00135   inline const int * typeSOS() const
    00136   { return typeSOS_;}
    00138   inline const int * startSOS() const
    00139   { return startSOS_;}
    00141   inline const int * whichSOS() const
    00142   { return whichSOS_;}
    00144   inline const double * weightSOS() const
    00145   { return weightSOS_;}
    00147   void passInProhibited(const char * prohibited,int numberColumns);
    00149   inline const char * prohibited()
    00150   { return prohibited_;}
    00152   inline int numberIterationsPre() const
    00153   { return numberIterationsPre_;}
    00155   inline int numberIterationsPost() const
    00156   { return numberIterationsPost_;}
    00163   void passInRowTypes(const char * rowTypes,int numberRows);
    00170   inline const char * rowTypes()
    00171   { return rowType_;}
    00173   inline const CglStored & cuts() const
    00174   { return cuts_;}
    00176   inline const CglStored * cutsPointer() const
    00177   { return &cuts_;}
    00179   void update(const OsiPresolve * pinfo,const OsiSolverInterface * solver);
    00181   inline void setOptions(int value)
    00182   { options_=value;}
    00184
    00186
    00187
    00188   inline int numberCutGenerators() const
    00189   { return numberCutGenerators_;}
    00191   inline CglCutGenerator ** cutGenerators() const
    00192   { return generator_;}
    00194   inline CglCutGenerator * cutGenerator(int i) const
    00195   { return generator_[i];}
    00198   void addCutGenerator(CglCutGenerator * generator);
    00200
    00210     void setApplicationData (void * appData);
    00211
    00213     void * getApplicationData() const;
    00215
    00216   //---------------------------------------------------------------------------
    00217
    00220
    00221   void passInMessageHandler(CoinMessageHandler * handler);
    00223   void newLanguage(CoinMessages::Language language);
    00224   inline void setLanguage(CoinMessages::Language language)
    00225   {newLanguage(language);}
    00227   inline CoinMessageHandler * messageHandler() const
    00228   {return handler_;}
    00230   inline CoinMessages messages()
    00231   {return messages_;}
    00233   inline CoinMessages * messagesPointer()
    00234   {return &messages_;}
    00236   //---------------------------------------------------------------------------
    00237
    00238
    00240
    00241
    00242   CglPreProcess();
    00243
    00245   CglPreProcess(const CglPreProcess & rhs);
    00246
    00248   CglPreProcess & operator=(const CglPreProcess& rhs);
    00249
    00251   ~CglPreProcess ();
    00252
    00254   void gutsOfDestructor();
    00256 private:
    00257
    00259
    00260
    00264   OsiSolverInterface * modified(OsiSolverInterface * model,
    00265                                 bool constraints,
    00266                                 int & numberChanges,
    00267                                 int iBigPass,
    00268                                 int numberPasses);
    00270   void createOriginalIndices() const;
    00272   void makeInteger();
    00274
    00275 //---------------------------------------------------------------------------
    00276
    00277 private:
    00279
    00280
    00282   OsiSolverInterface * originalModel_;
    00284   OsiSolverInterface * startModel_;
    00286   int numberSolvers_;
    00288   OsiSolverInterface ** model_;
    00290   OsiSolverInterface ** modifiedModel_;
    00292   OsiPresolve ** presolve_;
    00293
    00295   CoinMessageHandler * handler_;
    00296
    00302   bool defaultHandler_;
    00303
    00305   CoinMessages messages_;
    00306
    00308   void * appData_;
    00310   mutable int * originalColumn_;
    00312   mutable int * originalRow_;
    00314   int numberCutGenerators_;
    00316   CglCutGenerator ** generator_;
    00318   int numberSOS_;
    00320   int * typeSOS_;
    00322   int * startSOS_;
    00324   int * whichSOS_;
    00326   double * weightSOS_;
    00328   int numberProhibited_;
    00330   int numberIterationsPre_;
    00332   int numberIterationsPost_;
    00334   char * prohibited_;
    00336   int numberRowType_;
    00340   int options_;
    00347   char * rowType_;
    00349   CglStored cuts_;
    00351 };
    00352
    00353 #endif