/home/coin/SVN-release/Cbc-2.3.1/Cbc/src/CbcHeuristicLocal.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2002, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef CbcHeuristicLocal_H
00004 #define CbcHeuristicLocal_H
00005 
00006 #include "CbcHeuristic.hpp"
00010 class CbcHeuristicLocal : public CbcHeuristic {
00011 public:
00012 
00013   // Default Constructor 
00014   CbcHeuristicLocal ();
00015 
00016   /* Constructor with model - assumed before cuts
00017      Initial version does not do Lps
00018   */
00019   CbcHeuristicLocal (CbcModel & model);
00020   
00021   // Copy constructor 
00022   CbcHeuristicLocal ( const CbcHeuristicLocal &);
00023    
00024   // Destructor 
00025   ~CbcHeuristicLocal ();
00026   
00028   virtual CbcHeuristic * clone() const;
00029 
00031   CbcHeuristicLocal & operator=(const CbcHeuristicLocal& rhs);
00032 
00034   virtual void generateCpp( FILE * fp) ;
00035 
00037   virtual void resetModel(CbcModel * model);
00038 
00040   virtual void setModel(CbcModel * model);
00041   
00042   using CbcHeuristic::solution ;
00054   virtual int solution(double & objectiveValue,
00055                        double * newSolution);
00057   int solutionFix(double & objectiveValue,
00058                   double * newSolution,
00059                   const int * keep);
00060 
00062   inline void setSearchType(int value)
00063   { swap_=value;}
00065   inline char * used() const
00066   { return used_;}
00067 
00068 protected:
00069   // Data
00070 
00071   // Original matrix by column
00072   CoinPackedMatrix matrix_;
00073 
00074   // Number of solutions so we only do after new solution
00075   int numberSolutions_;
00076   // Type of search 0=normal, 1=BAB
00077   int swap_;
00079   char * used_;
00080 };
00081 
00082 
00089 class CbcHeuristicNaive : public CbcHeuristic {
00090 public:
00091 
00092   // Default Constructor 
00093   CbcHeuristicNaive ();
00094 
00095   /* Constructor with model - assumed before cuts
00096      Initial version does not do Lps
00097   */
00098   CbcHeuristicNaive (CbcModel & model);
00099   
00100   // Copy constructor 
00101   CbcHeuristicNaive ( const CbcHeuristicNaive &);
00102    
00103   // Destructor 
00104   ~CbcHeuristicNaive ();
00105   
00107   virtual CbcHeuristic * clone() const;
00108 
00110   CbcHeuristicNaive & operator=(const CbcHeuristicNaive& rhs);
00111 
00113   virtual void generateCpp( FILE * fp) ;
00114 
00116   virtual void resetModel(CbcModel * model);
00117 
00119   virtual void setModel(CbcModel * model);
00120   
00121   using CbcHeuristic::solution ;
00125   virtual int solution(double & objectiveValue,
00126                        double * newSolution);
00127 
00129   inline void setLargeValue(double value)
00130   { large_=value;}
00132   inline double largeValue() const
00133   { return large_;}
00134 
00135 protected:
00138   double large_;
00139 };
00140 
00141 
00142 #endif

Generated on Mon Sep 14 03:01:35 2009 by  doxygen 1.4.7