Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
opt
build
coinor-cbc
coinor-cbc-2.5.0
Cbc
src
CbcHeuristicLocal.hpp
Go to the documentation of this file.
1
/* $Id: CbcHeuristicLocal.hpp 1432 2010-02-07 19:33:53Z bjarni $ */
2
// Copyright (C) 2002, International Business Machines
3
// Corporation and others. All Rights Reserved.
4
#ifndef CbcHeuristicLocal_H
5
#define CbcHeuristicLocal_H
6
7
#include "
CbcHeuristic.hpp
"
11
class
CbcHeuristicLocal
:
public
CbcHeuristic
{
12
public
:
13
14
// Default Constructor
15
CbcHeuristicLocal
();
16
17
/* Constructor with model - assumed before cuts
18
Initial version does not do Lps
19
*/
20
CbcHeuristicLocal
(
CbcModel
& model);
21
22
// Copy constructor
23
CbcHeuristicLocal
(
const
CbcHeuristicLocal
&);
24
25
// Destructor
26
~CbcHeuristicLocal
();
27
29
virtual
CbcHeuristic
*
clone
()
const
;
30
32
CbcHeuristicLocal
&
operator=
(
const
CbcHeuristicLocal
& rhs);
33
35
virtual
void
generateCpp
( FILE * fp) ;
36
38
virtual
void
resetModel
(
CbcModel
* model);
39
41
virtual
void
setModel
(
CbcModel
* model);
42
43
using
CbcHeuristic::solution
;
55
virtual
int
solution
(
double
& objectiveValue,
56
double
* newSolution);
58
int
solutionFix
(
double
& objectiveValue,
59
double
* newSolution,
60
const
int
* keep);
61
63
inline
void
setSearchType
(
int
value) {
64
swap_
= value;
65
}
67
inline
int
*
used
()
const
{
68
return
used_
;
69
}
70
71
protected
:
72
// Data
73
74
// Original matrix by column
75
CoinPackedMatrix
matrix_
;
76
77
// Number of solutions so we only do after new solution
78
int
numberSolutions_
;
79
// Type of search 0=normal, 1=BAB
80
int
swap_
;
82
int
*
used_
;
83
};
84
85
92
class
CbcHeuristicNaive
:
public
CbcHeuristic
{
93
public
:
94
95
// Default Constructor
96
CbcHeuristicNaive
();
97
98
/* Constructor with model - assumed before cuts
99
Initial version does not do Lps
100
*/
101
CbcHeuristicNaive
(
CbcModel
& model);
102
103
// Copy constructor
104
CbcHeuristicNaive
(
const
CbcHeuristicNaive
&);
105
106
// Destructor
107
~CbcHeuristicNaive
();
108
110
virtual
CbcHeuristic
*
clone
()
const
;
111
113
CbcHeuristicNaive
&
operator=
(
const
CbcHeuristicNaive
& rhs);
114
116
virtual
void
generateCpp
( FILE * fp) ;
117
119
virtual
void
resetModel
(
CbcModel
* model);
120
122
virtual
void
setModel
(
CbcModel
* model);
123
124
using
CbcHeuristic::solution
;
128
virtual
int
solution
(
double
& objectiveValue,
129
double
* newSolution);
130
132
inline
void
setLargeValue
(
double
value) {
133
large_
= value;
134
}
136
inline
double
largeValue
()
const
{
137
return
large_
;
138
}
139
140
protected
:
143
double
large_
;
144
};
145
149
class
CbcHeuristicCrossover
:
public
CbcHeuristic
{
150
public
:
151
152
// Default Constructor
153
CbcHeuristicCrossover
();
154
155
/* Constructor with model - assumed before cuts
156
Initial version does not do Lps
157
*/
158
CbcHeuristicCrossover
(
CbcModel
& model);
159
160
// Copy constructor
161
CbcHeuristicCrossover
(
const
CbcHeuristicCrossover
&);
162
163
// Destructor
164
~CbcHeuristicCrossover
();
165
167
virtual
CbcHeuristic
*
clone
()
const
;
168
170
CbcHeuristicCrossover
&
operator=
(
const
CbcHeuristicCrossover
& rhs);
171
173
virtual
void
generateCpp
( FILE * fp) ;
174
176
virtual
void
resetModel
(
CbcModel
* model);
177
179
virtual
void
setModel
(
CbcModel
* model);
180
181
using
CbcHeuristic::solution
;
187
virtual
int
solution
(
double
& objectiveValue,
188
double
* newSolution);
189
191
inline
void
setNumberSolutions
(
int
value) {
192
if
(value > 0 && value <= 10)
193
useNumber_
= value;
194
}
195
196
protected
:
197
// Data
199
std::vector <double>
attempts_
;
201
double
random_
[10];
203
int
numberSolutions_
;
205
int
useNumber_
;
206
};
207
208
#endif
209
Generated on Tue Mar 1 2016 22:38:12 by
1.8.4