- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

BlisParams.h
Go to the documentation of this file.
1 /*===========================================================================*
2 * This file is part of the BiCePS Linear Integer Solver (BLIS). *
3 * *
4 * BLIS is distributed under the Eclipse Public License as part of the *
5 * COIN-OR repository (http://www.coin-or.org). *
6 * *
7 * Authors: *
8 * *
9 * Yan Xu, Lehigh University *
10 * Ted Ralphs, Lehigh University *
11 * *
12 * Conceptual Design: *
13 * *
14 * Yan Xu, Lehigh University *
15 * Ted Ralphs, Lehigh University *
16 * Laszlo Ladanyi, IBM T.J. Watson Research Center *
17 * Matthew Saltzman, Clemson University *
18 * *
19 * *
20 * Copyright (C) 2001-2013, Lehigh University, Yan Xu, and Ted Ralphs. *
21 * All Rights Reserved. *
22 *===========================================================================*/
23
24 #ifndef BlisParams_h
25 #define BlisParams_h
26
27 #include "AlpsKnowledge.h"
28 #include "AlpsParameterBase.h"
29
30 #include "Blis.h"
31
32 //#############################################################################
33
34 //** Parameters used in Blis. */
35 class BlisParams : public AlpsParameterSet {
36 public:
39 enum chrParams{
42 cutRampUp,
44 presolve,
47 shareConstraints,
50 shareVariables,
53 sharePseudocostRampUp,
56 sharePseudocostSearch,
57 //
58 endOfChrParams
59 };
60
62 enum intParams{
63
71 branchStrategy,
72 branchStrategyRampUp,
73
80 cutStrategy,
81 cutGenerationFrequency,
82
83 cutPass,
84 quickCutPass,
86 cutCliqueStrategy,
87 cutGomoryStrategy,
88 cutFlowCoverStrategy,
89 cutKnapsackStrategy,
90 cutMirStrategy,
91 cutOddHoleStrategy,
92 cutProbingStrategy,
93 cutTwoMirStrategy,
94 cutCliqueFreq,
95 cutGomoryFreq,
96 cutFlowCoverFreq,
97 cutKnapsackFreq,
98 cutMirFreq,
99 cutOddHoleFreq,
100 cutProbingFreq,
101 cutTwoMirFreq,
102
104 difference,
105
112 heurStrategy,
113 heurCallFrequency,
114 heurRoundStrategy,
115 heurRoundFreq,
116
118 lookAhead,
120 pseudoRelibility,
121
123 sharePcostDepth,
125 sharePcostFrequency,
127 strongCandSize,
129 endOfIntParams
130 };
131
133 enum dblParams{
136 cutFactor,
137
139 cutoff,
142 cutoffInc,
143
145 denseConFactor,
146
148 integerTol,
149
151 objSense,
152
155 optimalRelGap,
156
159 optimalAbsGap,
160
162 pseudoWeight,
163
165 scaleConFactor,
166
168 tailOff,
170 endOfDblParams
171 };
172
174 enum strParams{
175 strDummy,
176 //
177 endOfStrParams
178 };
179
181 enum strArrayParams{
182 strArrayDummy,
184 endOfStrArrayParams
185 };
186
187 public:
193 BlisParams() :
194 AlpsParameterSet(
195 static_cast<int>(endOfChrParams),
196 static_cast<int>(endOfIntParams),
197 static_cast<int>(endOfDblParams),
198 static_cast<int>(endOfStrParams),
199 static_cast<int>(endOfStrArrayParams)
200 )
201 {
202 createKeywordList();
203 setDefaultEntries();
204 }
209 virtual void createKeywordList();
211 virtual void setDefaultEntries();
215 public:
216 //===========================================================================
224 //===========================================================================
225
226
235 inline bool entry(const chrParams key) const { return bpar_[key]; }
238 inline int entry(const intParams key) const { return ipar_[key]; }
240 inline double entry(const dblParams key) const { return dpar_[key]; }
242 inline const std::string&
243 entry(const strParams key) const { return spar_[key]; }
245 inline const std::vector<std::string>&
246 entry(const strArrayParams key) const { return sapar_[key]; }
249 //---------------------------------------------------------------------------
251 void setEntry(const chrParams key, const char * val) {
252 bpar_[key] = atoi(val) ? true : false; }
254 void setEntry(const chrParams key, const char val) {
255 bpar_[key] = val ? true : false; }
257 void setEntry(const chrParams key, const bool val) {
258 bpar_[key] = val; }
260 void setEntry(const intParams key, const char * val) {
261 ipar_[key] = atoi(val); }
263 void setEntry(const intParams key, const int val) {
264 ipar_[key] = val; }
266 void setEntry(const dblParams key, const char * val) {
267 dpar_[key] = atof(val); }
269 void setEntry(const dblParams key, const double val) {
270 dpar_[key] = val; }
272 void setEntry(const strParams key, const char * val) {
273 spar_[key] = val; }
275 void setEntry(const strArrayParams key, const char *val) {
276 sapar_[key].push_back(val); }
277
278 //---------------------------------------------------------------------------
279
284 void pack(AlpsEncoded& buf) {
285 buf.writeRep(bpar_, endOfChrParams)
286 .writeRep(ipar_, endOfIntParams)
287 .writeRep(dpar_, endOfDblParams);
288 for (int i = 0; i < endOfStrParams; ++i)
289 buf.writeRep(spar_[i]);
290 for (int i = 0; i < endOfStrArrayParams; ++i) {
291 buf.writeRep(sapar_[i].size());
292 for (size_t j = 0; j < sapar_[i].size(); ++j)
293 buf.writeRep(sapar_[i][j]);
294 }
295 }
297 void unpack(AlpsEncoded& buf) {
298 int dummy;
299 // No need to allocate the arrays, they are of fixed length
300 dummy = static_cast<int>(endOfChrParams);
301 buf.readRep(bpar_, dummy, false);
302 dummy = static_cast<int>(endOfIntParams);
303 buf.readRep(ipar_, dummy, false);
304 dummy = static_cast<int>(endOfDblParams);
305 buf.readRep(dpar_, dummy, false);
306 for (int i = 0; i < endOfStrParams; ++i)
307 buf.readRep(spar_[i]);
308 for (int i = 0; i < endOfStrArrayParams; ++i) {
309 size_t str_size;
310 buf.readRep(str_size);
311 sapar_[i].reserve(str_size);
312 for (size_t j = 0; j < str_size; ++j){
313 // sapar_[i].unchecked_push_back(std::string());
314 sapar_[i].push_back(std::string());
315 buf.readRep(sapar_[i].back());
316 }
317 }
318 }
321 };
322
323 #endif
BlisParams::integerTol
Tolrence to treat as an integer.
Definition: BlisParams.h:99
BlisParams::cutGenerationFrequency
All constraint generators.
Definition: BlisParams.h:81
BlisParams::shareConstraints
Share constraints Default: false.
Definition: BlisParams.h:47
BlisParams::pseudoWeight
Weight used to calculate pseudocost.
Definition: BlisParams.h:114
BlisParams::heurStrategy
Heuristics control.
Definition: BlisParams.h:112
BlisParams::entry
int entry(const intParams key) const
Definition: BlisParams.h:238
BlisParams::cutProbingStrategy
Definition: BlisParams.h:92
AlpsEncoded::readRep
AlpsEncoded & readRep(T &value)
Read a single object of type T from repsentation_ .
Definition: AlpsEncoded.h:173
BlisParams::cutFlowCoverFreq
Definition: BlisParams.h:96
AlpsEncoded::writeRep
AlpsEncoded & writeRep(const T &value)
Write a single object of type T in repsentation_ .
Definition: AlpsEncoded.h:163
BlisParams::cutOddHoleStrategy
Definition: BlisParams.h:91
AlpsParameterBase.h
BlisParams::setEntry
void setEntry(const chrParams key, const bool val)
This method is the one that ever been used.
Definition: BlisParams.h:257
AlpsParameterSet
This is the class serves as a holder for a set of parameters.
Definition: AlpsParameterBase.h:134
BlisParams::pack
void pack(AlpsEncoded &buf)
Pack the parameter set into the buffer (AlpsEncoded is used as buffer Here).
Definition: BlisParams.h:284
BlisParams::cutGomoryStrategy
Definition: BlisParams.h:87
BlisParams::setEntry
void setEntry(const strArrayParams key, const char *val)
Definition: BlisParams.h:275
BlisParams::sharePseudocostSearch
Share pseudocost during search Default: false.
Definition: BlisParams.h:56
AlpsParameterSet::ipar_
int * ipar_
The integer parameters.
Definition: AlpsParameterBase.h:150
BlisParams::branchStrategy
-1: disable, 0: default, 1: verbose.
Definition: BlisParams.h:64
BlisParams::cutStrategy
Cut generators control.
Definition: BlisParams.h:80
BlisParams::tailOff
Tail off.
Definition: BlisParams.h:168
BlisParams::cutMirFreq
Definition: BlisParams.h:98
BlisParams::entry
const std::string & entry(const strParams key) const
Definition: BlisParams.h:243
BlisParams::sharePseudocostRampUp
Share pseudocost during ramp up.
Definition: BlisParams.h:53
BlisParams::endOfIntParams
Definition: BlisParams.h:93
BlisParams::objSense
Objective sense: min = 1.0, max = -1.0.
Definition: BlisParams.h:151
BlisParams::setEntry
void setEntry(const dblParams key, const double val)
Definition: BlisParams.h:269
BlisParams::scaleConFactor
Scaling indicator of a constraint.
Definition: BlisParams.h:124
BlisParams::setEntry
void setEntry(const intParams key, const int val)
Definition: BlisParams.h:263
BlisParams::heurRoundStrategy
Definition: BlisParams.h:114
BlisParams::entry
double entry(const dblParams key) const
Definition: BlisParams.h:240
BlisParams::presolve
Presolve or not.
Definition: BlisParams.h:44
BlisParams::quickCutPass
The pass to generate cuts.
Definition: BlisParams.h:84
AlpsEncoded
This data structure is to contain the packed form of an encodable knowledge.
Definition: AlpsEncoded.h:25
BlisParams::createKeywordList
virtual void createKeywordList()
Method for creating the list of keyword looked for in the parameter file.
BlisParams::endOfStrParams
Definition: BlisParams.h:133
BlisParams::strDummy
Definition: BlisParams.h:131
BlisParams::dblParams
dblParams
Double parameters.
Definition: BlisParams.h:97
BlisParams::cutoff
Cutoff any nodes whose objective value is higher than it.
Definition: BlisParams.h:139
BlisParams::sharePcostFrequency
Frequency of sharing pseudocost.
Definition: BlisParams.h:125
BlisParams::BlisParams
BlisParams()
The default constructor creates a parameter set with from the template argument structure.
Definition: BlisParams.h:193
BlisParams::optimalAbsGap
If the absolute gap between best feasible and best relaxed fall into this gap, search stops...
Definition: BlisParams.h:111
BlisParams::heurCallFrequency
All heuristics.
Definition: BlisParams.h:113
BlisParams::strArrayParams
strArrayParams
There are no string array parameters.
Definition: BlisParams.h:137
AlpsParameterSet::spar_
std::string * spar_
The string (actually, std::string) parameters.
Definition: AlpsParameterBase.h:156
BlisParams::lookAhead
The look ahead of pseudocost.
Definition: BlisParams.h:91
Blis.h
BlisParams::cutMirStrategy
Definition: BlisParams.h:90
BlisParams::setEntry
void setEntry(const intParams key, const char *val)
Definition: BlisParams.h:260
BlisParams::setEntry
void setEntry(const strParams key, const char *val)
Definition: BlisParams.h:272
BlisParams::cutoffInc
The value added to relaxation value when deciding fathom.
Definition: BlisParams.h:103
BlisParams::heurRoundFreq
Definition: BlisParams.h:115
BlisParams::branchStrategyRampUp
Definition: BlisParams.h:72
BlisParams::endOfDblParams
Definition: BlisParams.h:126
BlisParams::strParams
strParams
String parameters.
Definition: BlisParams.h:130
BlisParams::cutKnapsackFreq
Definition: BlisParams.h:97
BlisParams::endOfStrArrayParams
Definition: BlisParams.h:140
BlisParams::cutKnapsackStrategy
Definition: BlisParams.h:89
BlisParams::cutCliqueStrategy
The pass to generate cuts for quick branching.
Definition: BlisParams.h:86
BlisParams::cutTwoMirStrategy
Definition: BlisParams.h:93
BlisParams::cutTwoMirFreq
Definition: BlisParams.h:101
BlisParams::cutFlowCoverStrategy
Definition: BlisParams.h:88
BlisParams::difference
-1 auto, 0, no, any integer frequency
Definition: BlisParams.h:104
BlisParams::cutProbingFreq
Definition: BlisParams.h:100
AlpsKnowledge.h
AlpsParameterSet::sapar_
std::vector< std::string > * sapar_
The keyword, parameter pairs.
Definition: AlpsParameterBase.h:160
BlisParams::setEntry
void setEntry(const chrParams key, const char *val)
char* is true(1) or false(0), not used
Definition: BlisParams.h:251
BlisParams::cutRampUp
Generate cuts during rampup.
Definition: BlisParams.h:42
AlpsParameterSet::bpar_
bool * bpar_
The bool parameters.
Definition: AlpsParameterBase.h:147
BlisParams::cutPass
Definition: BlisParams.h:83
BlisParams::unpack
void unpack(AlpsEncoded &buf)
Unpack the parameter set from the buffer.
Definition: BlisParams.h:297
BlisParams::chrParams
chrParams
Character parameters.
Definition: BlisParams.h:39
BlisParams::setEntry
void setEntry(const chrParams key, const char val)
char is true(1) or false(0), not used
Definition: BlisParams.h:254
BlisParams::cutGomoryFreq
Definition: BlisParams.h:95
BlisParams::endOfChrParams
Definition: BlisParams.h:58
BlisParams::setDefaultEntries
virtual void setDefaultEntries()
Method for setting the default values for the parameters.
BlisParams::optimalRelGap
If the relative gap between best feasible and best relaxed fall into this gap, search stops...
Definition: BlisParams.h:107
BlisParams
Definition: BlisParams.h:35
BlisParams::cutFactor
Limit the max number cuts applied at a node.
Definition: BlisParams.h:118
BlisParams::cutOddHoleFreq
Definition: BlisParams.h:99
BlisParams::strArrayDummy
Definition: BlisParams.h:138
BlisParams::entry
bool entry(const boolParams key) const
Definition: BlisParams.h:192
AlpsParameterSet::dpar_
double * dpar_
The double parameters.
Definition: AlpsParameterBase.h:153
BlisParams::intParams
intParams
Integer paramters.
Definition: BlisParams.h:51
BlisParams::pseudoRelibility
The relibility of pseudocost.
Definition: BlisParams.h:89
BlisParams::strongCandSize
The number of candidate used in strong branching.
Definition: BlisParams.h:53
BlisParams::denseConFactor
Dense constraint factor.
Definition: BlisParams.h:121
BlisParams::shareVariables
Share constraints Default: false.
Definition: BlisParams.h:50
BlisParams::setEntry
void setEntry(const dblParams key, const char *val)
Definition: BlisParams.h:266
BlisParams::cutCliqueFreq
Definition: BlisParams.h:94
BlisParams::entry
const std::vector< std::string > & entry(const strArrayParams key) const
Definition: BlisParams.h:246
BlisParams::sharePcostDepth
Maximum tree depth of sharing pseudocost.
Definition: BlisParams.h:123