CbcHeuristicGreedy.hpp
Go to the documentation of this file.
1 /* $Id: CbcHeuristicGreedy.hpp 1432 2010-02-07 19:33:53Z bjarni $ */
2 // Copyright (C) 2005, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef CbcHeuristicGreedy_H
5 #define CbcHeuristicGreedy_H
6 
7 #include "CbcHeuristic.hpp"
12 public:
13 
14  // Default Constructor
16 
17  /* Constructor with model - assumed before cuts
18  Initial version does not do Lps
19  */
21 
22  // Copy constructor
24 
25  // Destructor
27 
29  virtual CbcHeuristic * clone() const;
33  virtual void generateCpp( FILE * fp) ;
34 
36  virtual void setModel(CbcModel * model);
37 
49  virtual int solution(double & objectiveValue,
50  double * newSolution);
52  virtual void validate() ;
54  virtual void resetModel(CbcModel * model);
55  /* Algorithm
56  0 - use current upper bounds
57  1 - use original upper bounds
58  If 10 added perturb ratios more
59  if 100 added round up all >=0.5
60  */
61  inline int algorithm() const {
62  return algorithm_;
63  }
64  inline void setAlgorithm(int value) {
65  algorithm_ = value;
66  }
67  // Only do this many times
68  inline int numberTimes() const {
69  return numberTimes_;
70  }
71  inline void setNumberTimes(int value) {
72  numberTimes_ = value;
73  }
74 
75 protected:
77  void gutsOfConstructor(CbcModel * model);
78  // Data
79 
80  // Original matrix by column
81  CoinPackedMatrix matrix_;
82  // original number of rows
84  /* Algorithm
85  0 - use current upper bounds
86  1 - use original upper bounds
87  If 10 added perturb ratios more
88  */
89  int algorithm_;
91  int numberTimes_;
92 
93 };
94 
95 
97 public:
98 
99  // Default Constructor
101 
102  /* Constructor with model - assumed before cuts
103  Initial version does not do Lps
104  */
106 
107  // Copy constructor
109 
110  // Destructor
112 
114  virtual CbcHeuristic * clone() const;
118  virtual void generateCpp( FILE * fp) ;
119 
121  virtual void setModel(CbcModel * model);
122 
123  using CbcHeuristic::solution ;
134  virtual int solution(double & objectiveValue,
135  double * newSolution);
137  virtual void validate() ;
139  virtual void resetModel(CbcModel * model);
140  /* Algorithm
141  0 - use current upper bounds
142  1 - use original upper bounds
143  If 10 added perturb ratios more
144  if 100 added round up all >=0.5
145  */
146  inline int algorithm() const {
147  return algorithm_;
148  }
149  inline void setAlgorithm(int value) {
150  algorithm_ = value;
151  }
152  // Fraction of rhs to cover before branch and cut
153  inline void setFraction(double value) {
154  fraction_ = value;
155  }
156  inline double fraction() const {
157  return fraction_;
158  }
159  // Only do this many times
160  inline int numberTimes() const {
161  return numberTimes_;
162  }
163  inline void setNumberTimes(int value) {
164  numberTimes_ = value;
165  }
166 protected:
168  void gutsOfConstructor(CbcModel * model);
169  // Data
170 
171  // Original matrix by column
172  CoinPackedMatrix matrix_;
173  // Fraction of rhs to cover before branch and cut
174  double fraction_;
175  // original number of rows
177  /* Algorithm
178  0 - use current upper bounds
179  1 - use original upper bounds
180  If 10 added perturb ratios more
181  */
182  int algorithm_;
184  int numberTimes_;
185 
186 };
187 
188 
189 #endif
190