00001 
00002 
00003 #ifndef CbcTreeLocal_H
00004 #define CbcTreeLocal_H
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 #include "CbcTree.hpp"
00032 #include "CbcNode.hpp"
00033 #include "OsiRowCut.hpp"
00034 class CbcModel;
00035 
00036 
00037 class CbcTreeLocal : public CbcTree {
00038 
00039 public:
00040 
00041   
00042   CbcTreeLocal ();
00043 
00044   
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057   CbcTreeLocal (CbcModel * model,const double * solution ,int range=10,
00058                    int typeCuts=0,int maxDiversification=0,
00059                    int timeLimit=1000000, int nodeLimit=1000000,bool refine=true);
00060   
00061   CbcTreeLocal ( const CbcTreeLocal & rhs);
00062 
00063   
00064   CbcTreeLocal & operator=(const CbcTreeLocal & rhs);
00065    
00066   virtual ~CbcTreeLocal();
00067 
00069   virtual CbcTree * clone() const;
00071   virtual void generateCpp( FILE * fp) ;
00072 
00075 
00077   virtual CbcNode * top() const;
00078 
00080   virtual void push(CbcNode * x);
00081 
00083   virtual void pop() ;
00084 
00086 
00088 
00090   int createCut(const double * solution, OsiRowCut & cut);
00091 
00093   virtual bool empty() ;
00094 
00096   virtual void endSearch() ;
00098   void reverseCut(int state, double bias=0.0);
00100   void deleteCut(OsiRowCut & cut);
00102   void passInSolution(const double * solution, double solutionValue);
00103   
00104   inline int range() const
00105   { return range_;}
00106   
00107   inline void setRange(int value)
00108   { range_ = value;}
00109   
00110   inline int typeCuts() const
00111   { return typeCuts_;}
00112   
00113   inline void setTypeCuts(int value)
00114   { typeCuts_ = value;}
00115   
00116   inline int maxDiversification() const
00117   { return maxDiversification_;}
00118   
00119   inline void setMaxDiversification(int value)
00120   { maxDiversification_ = value;}
00121   
00122   inline int timeLimit() const
00123   { return timeLimit_;}
00124   
00125   inline void setTimeLimit(int value)
00126   { timeLimit_ = value;}
00127   
00128   inline int nodeLimit() const
00129   { return nodeLimit_;}
00130   
00131   inline void setNodeLimit(int value)
00132   { nodeLimit_ = value;}
00133   
00134   inline bool refine() const
00135   { return refine_;}
00136   
00137   inline void setRefine(bool yesNo)
00138     { refine_ = yesNo;}
00139 
00141 private:
00142   
00143   CbcNode * localNode_;
00144   
00145   double * bestSolution_;
00146   
00147   double * savedSolution_;
00148   
00149   int saveNumberSolutions_;
00150   
00151   OsiRowCut cut_;
00152   
00153   OsiRowCut fixedCut_;
00154   
00155   CbcModel * model_;
00156   
00157   double * originalLower_;
00158   
00159   double * originalUpper_;
00160   
00161   int range_;
00162   
00163   int typeCuts_;
00164   
00165   int maxDiversification_;
00166   
00167   int diversification_;
00168   
00169   bool nextStrong_;
00170   
00171   double rhs_;
00172   
00173   double savedGap_;
00174   
00175   double bestCutoff_;
00176   
00177   int timeLimit_;
00178   
00179   int startTime_;
00180   
00181   int nodeLimit_;
00182   
00183   int startNode_;
00184   
00185   int searchType_;
00186   
00187   bool refine_;
00188 
00189 };
00190 #endif
00191