Cgl trunk
CglGomory.hpp
Go to the documentation of this file.
00001 // Copyright (C) 2002, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 // This code is licensed under the terms of the Eclipse Public License (EPL).
00004 
00005 #ifndef CglGomory_H
00006 #define CglGomory_H
00007 
00008 #include <string>
00009 
00010 #include "CglCutGenerator.hpp"
00011 
00012 class CoinWarmStartBasis;
00014 class CglGomory : public CglCutGenerator {
00015    friend void CglGomoryUnitTest(const OsiSolverInterface * siP,
00016                                   const std::string mpdDir );
00017  
00018 public:
00019     
00020   
00034   virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
00035                              const CglTreeInfo info = CglTreeInfo()) const;
00038   int generateCuts( const OsiRowCutDebugger * debugger, 
00039                     OsiCuts & cs,
00040                     const CoinPackedMatrix & columnCopy,
00041                     const CoinPackedMatrix & rowCopy,
00042                     const double * colsol,
00043                     const double * colLower, const double * colUpper,
00044                     const double * rowLower, const double * rowUpper,
00045                     const char * intVar ,
00046                     const CoinWarmStartBasis* warm,
00047                     const CglTreeInfo info = CglTreeInfo()) const;
00050   int generateCuts( const OsiRowCutDebugger * debugger, 
00051                     OsiCuts & cs,
00052                     const CoinPackedMatrix & columnCopy,
00053                     const double * colsol,
00054                     const double * colLower, const double * colUpper,
00055                     const double * rowLower, const double * rowUpper,
00056                     const char * intVar ,
00057                     const CoinWarmStartBasis* warm,
00058                     const CglTreeInfo info = CglTreeInfo()) const;
00059 
00061   virtual bool needsOptimalBasis() const;
00063 
00066 
00067   void passInOriginalSolver(OsiSolverInterface * solver);
00069   inline OsiSolverInterface * originalSolver() const
00070   { return originalSolver_;}
00072   inline void setGomoryType(int type)
00073   { gomoryType_=type;}
00075   inline int gomoryType() const
00076   { return gomoryType_;}
00078 
00081 
00082   void setLimit(int limit);
00084   int getLimit() const;
00086   void setLimitAtRoot(int limit);
00088   int getLimitAtRoot() const;
00090   virtual int maximumLengthOfCutInTree() const;
00092 
00097 
00098   void setAway(double value);
00100   double getAway() const;
00102   void setAwayAtRoot(double value);
00104   double getAwayAtRoot() const;
00106 
00116 
00117   void setConditionNumberMultiplier(double value);
00119   double getConditionNumberMultiplier() const;
00121   void setLargestFactorMultiplier(double value);
00123   double getLargestFactorMultiplier() const;
00125 
00128 
00129    inline void useAlternativeFactorization(bool yes=true)
00130    { alternateFactorization_= (yes) ? 1 : 0;} 
00132    inline bool alternativeFactorization() const
00133    { return (alternateFactorization_!=0);} 
00135 
00138 
00139   CglGomory ();
00140  
00142   CglGomory (
00143     const CglGomory &);
00144 
00146   virtual CglCutGenerator * clone() const;
00147 
00149   CglGomory &
00150     operator=(
00151     const CglGomory& rhs);
00152   
00154   virtual
00155     ~CglGomory ();
00157   virtual std::string generateCpp( FILE * fp);
00159       
00160 private:
00161   
00162  // Private member methods
00163 
00164   // Private member data
00165 
00168 
00169   double away_;
00171   double awayAtRoot_;
00173   double conditionNumberMultiplier_;
00175   double largestFactorMultiplier_;
00177   mutable OsiSolverInterface * originalSolver_;
00179   int limit_;
00181   int limitAtRoot_;
00183   mutable int dynamicLimitInTree_;
00185   mutable int numberTimesStalled_;
00187   int alternateFactorization_;
00189   int gomoryType_;
00191 };
00192 
00193 //#############################################################################
00199 void CglGomoryUnitTest(const OsiSolverInterface * siP,
00200                         const std::string mpdDir );
00201   
00202 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines