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 virtual void generateCpp( FILE * fp) ; 00032 00034 virtual void resetModel(CbcModel * model); 00035 00037 virtual void setModel(CbcModel * model); 00038 00050 virtual int solution(double & objectiveValue, 00051 double * newSolution); 00053 int solutionFix(double & objectiveValue, 00054 double * newSolution, 00055 const int * keep); 00056 00058 inline void setSearchType(int value) 00059 { swap_=value;}; 00061 inline char * used() const 00062 { return used_;}; 00063 00064 protected: 00065 // Data 00066 00067 // Original matrix by column 00068 CoinPackedMatrix matrix_; 00069 00070 // Number of solutions so we only do after new solution 00071 int numberSolutions_; 00072 // Type of search 0=normal, 1=BAB 00073 int swap_; 00075 char * used_; 00076 00077 private: 00079 CbcHeuristicLocal & operator=(const CbcHeuristicLocal& rhs); 00080 }; 00081 00082 00083 #endif