Cbc 2.10.10
CbcHeuristicLocal.hpp
Go to the documentation of this file.
1/* $Id$ */
2// Copyright (C) 2002, International Business Machines
3// Corporation and others. All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6#ifndef CbcHeuristicLocal_H
7#define CbcHeuristicLocal_H
8
9#include "CbcHeuristic.hpp"
14public:
15 // Default Constructor
17
18 /* Constructor with model - assumed before cuts
19 Initial version does not do Lps
20 */
22
23 // Copy constructor
25
26 // Destructor
28
30 virtual CbcHeuristic *clone() const;
31
34
36 virtual void generateCpp(FILE *fp);
37
39 virtual void resetModel(CbcModel *model);
40
42 virtual void setModel(CbcModel *model);
43
56 virtual int solution(double &objectiveValue,
57 double *newSolution);
59 int solutionFix(double &objectiveValue,
60 double *newSolution,
61 const int *keep);
62
64 inline void setSearchType(int value)
65 {
66 swap_ = value;
67 }
69 inline int *used() const
70 {
71 return used_;
72 }
73
74protected:
75 // Data
76
77 // Original matrix by column
78 CoinPackedMatrix matrix_;
79
80 // Number of solutions so we only do after new solution
82 // Type of search 0=normal, 1=BAB
83 int swap_;
85 int *used_;
86};
87
92public:
93 // Default Constructor
95
96 /* Constructor with model - assumed before cuts
97 */
99
100 // Copy constructor
102
103 // Destructor
105
107 virtual CbcHeuristic *clone() const;
108
111
113 virtual void generateCpp(FILE *fp);
114
116 virtual void resetModel(CbcModel *model);
117
119 virtual void setModel(CbcModel *model);
120
125 virtual int solution(double &objectiveValue,
126 double *newSolution);
128 inline void setIncrement(double value)
129 {
130 increment_ = value;
131 }
133 inline int *used() const
134 {
135 return used_;
136 }
137
138protected:
139 // Data
147 int *used_;
148};
149
157public:
158 // Default Constructor
160
161 /* Constructor with model - assumed before cuts
162 Initial version does not do Lps
163 */
165
166 // Copy constructor
168
169 // Destructor
171
173 virtual CbcHeuristic *clone() const;
174
177
179 virtual void generateCpp(FILE *fp);
180
182 virtual void resetModel(CbcModel *model);
183
185 virtual void setModel(CbcModel *model);
186
191 virtual int solution(double &objectiveValue,
192 double *newSolution);
193
195 inline void setLargeValue(double value)
196 {
197 large_ = value;
198 }
200 inline double largeValue() const
201 {
202 return large_;
203 }
204
205protected:
208 double large_;
209};
210
215public:
216 // Default Constructor
218
219 /* Constructor with model - assumed before cuts
220 Initial version does not do Lps
221 */
223
224 // Copy constructor
226
227 // Destructor
229
231 virtual CbcHeuristic *clone() const;
232
235
237 virtual void generateCpp(FILE *fp);
238
240 virtual void resetModel(CbcModel *model);
241
243 virtual void setModel(CbcModel *model);
244
251 virtual int solution(double &objectiveValue,
252 double *newSolution);
253
255 inline void setNumberSolutions(int value)
256 {
257 if (value > 0 && value <= 10)
258 useNumber_ = value;
259 }
260
261protected:
262 // Data
264 std::vector< double > attempts_;
266 double random_[10];
271};
272
273#endif
274
275/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
276*/
Crossover Search class.
virtual CbcHeuristic * clone() const
Clone.
int numberSolutions_
Number of solutions so we only do after new solution.
CbcHeuristicCrossover(CbcModel &model)
CbcHeuristicCrossover(const CbcHeuristicCrossover &)
double random_[10]
Random numbers to stop same search happening.
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
std::vector< double > attempts_
Attempts.
CbcHeuristicCrossover & operator=(const CbcHeuristicCrossover &rhs)
Assignment operator.
int useNumber_
Number of solutions to use.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
void setNumberSolutions(int value)
Sets number of solutions to use.
Feasibility Pump class.
LocalSearch class.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
int * used() const
Used array so we can set.
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
int solutionFix(double &objectiveValue, double *newSolution, const int *keep)
This version fixes stuff and does IP.
CbcHeuristicLocal & operator=(const CbcHeuristicLocal &rhs)
Assignment operator.
CbcHeuristicLocal(const CbcHeuristicLocal &)
CoinPackedMatrix matrix_
int * used_
Whether a variable has been in a solution (also when)
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
CbcHeuristicLocal(CbcModel &model)
void setSearchType(int value)
Sets type of search.
virtual CbcHeuristic * clone() const
Clone.
Naive class a) Fix all ints as close to zero as possible b) Fix all ints with nonzero costs and < lar...
CbcHeuristicNaive & operator=(const CbcHeuristicNaive &rhs)
Assignment operator.
virtual CbcHeuristic * clone() const
Clone.
CbcHeuristicNaive(CbcModel &model)
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
CbcHeuristicNaive(const CbcHeuristicNaive &)
double large_
Data Large value.
double largeValue() const
Gets large cost value.
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
void setLargeValue(double value)
Sets large cost value.
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
int * used() const
Used array so we can set.
CbcHeuristicProximity & operator=(const CbcHeuristicProximity &rhs)
Assignment operator.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
CbcHeuristicProximity(CbcModel &model)
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
CbcHeuristicFPump * feasibilityPump_
Copy of Feasibility pump.
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
void setIncrement(double value)
Set extra increment.
double increment_
Increment to use if no change.
int numberSolutions_
Number of solutions so we only do after new solution.
int * used_
Whether a variable has been in a solution (also when)
CbcHeuristicProximity(const CbcHeuristicProximity &)
virtual CbcHeuristic * clone() const
Clone.
Heuristic base class.
virtual int solution(double &objectiveValue, double *newSolution)=0
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
Simple Branch and bound class.
Definition: CbcModel.hpp:100