source: branches/devel/Cbc/src/CbcHeuristicLocal.hpp @ 592

Last change on this file since 592 was 502, checked in by forrest, 13 years ago

mostly for rins

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef CbcHeuristicLocal_H
4#define CbcHeuristicLocal_H
5
6#include "CbcHeuristic.hpp"
7/** LocalSearch class
8 */
9
10class CbcHeuristicLocal : public CbcHeuristic {
11public:
12
13  // Default Constructor
14  CbcHeuristicLocal ();
15
16  /* Constructor with model - assumed before cuts
17     Initial version does not do Lps
18  */
19  CbcHeuristicLocal (CbcModel & model);
20 
21  // Copy constructor
22  CbcHeuristicLocal ( const CbcHeuristicLocal &);
23   
24  // Destructor
25  ~CbcHeuristicLocal ();
26 
27  /// Clone
28  virtual CbcHeuristic * clone() const;
29
30  /// Assignment operator
31  CbcHeuristicLocal & operator=(const CbcHeuristicLocal& rhs);
32
33  /// Create C++ lines to get to current state
34  virtual void generateCpp( FILE * fp) ;
35
36  /// Resets stuff if model changes
37  virtual void resetModel(CbcModel * model);
38
39  /// update model (This is needed if cliques update matrix etc)
40  virtual void setModel(CbcModel * model);
41 
42  /** returns 0 if no solution, 1 if valid solution.
43      Sets solution values if good, sets objective value (only if good)
44      This is called after cuts have been added - so can not add cuts
45      First tries setting a variable to better value.  If feasible then
46      tries setting others.  If not feasible then tries swaps
47
48      ********
49
50      This first version does not do LP's and does swaps of two integer
51      variables.  Later versions could do Lps.
52  */
53  virtual int solution(double & objectiveValue,
54                       double * newSolution);
55  /// This version fixes stuff and does IP
56  int solutionFix(double & objectiveValue,
57                  double * newSolution,
58                  const int * keep);
59
60  /// Sets type of search
61  inline void setSearchType(int value)
62  { swap_=value;};
63  /// Used array so we can set
64  inline char * used() const
65  { return used_;};
66
67protected:
68  // Data
69
70  // Original matrix by column
71  CoinPackedMatrix matrix_;
72
73  // Number of solutions so we only do after new solution
74  int numberSolutions_;
75  // Type of search 0=normal, 1=BAB
76  int swap_;
77  /// Whether a variable has been in a solution
78  char * used_;
79};
80
81
82#endif
Note: See TracBrowser for help on using the repository browser.