- 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 Bcps Linear 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
31 //#############################################################################
32 //#############################################################################
33
34 //** Parameters used in Blis. */
35 class BlisParams : public AlpsParameterSet {
36 public:
39 enum boolParams{
41 useCons,
43 useHeuristics,
45 cutDuringRampup,
46 //
47 endOfBoolParams
48 };
49
51 enum intParams{
53 strongCandSize,
54
57
64 branchStrategy,
65
72 heurRound,
73
80 cutClique,
81 cutGomory,
82 cutFlowCover,
83 cutKnapsack,
84 cutMir,
85 cutOddHole,
86 cutProbing,
87 cutTwoMir,
89 pseudoRelibility,
91 lookAhead,
92 //
93 endOfIntParams
94 };
95
97 enum dblParams{
99 integerTol,
100
103 cutoffInc,
104
107 optimalRelGap,
108
111 optimalAbsGap,
112
114 pseudoWeight,
115
118 cutFactor,
119
121 denseConFactor,
122
124 scaleConFactor,
125 //
126 endOfDblParams
127 };
128
130 enum strParams{
131 strDummy,
132 //
133 endOfStrParams
134 };
135
137 enum strArrayParams{
138 strArrayDummy,
139 //
140 endOfStrArrayParams
141 };
142
143 public:
149 BlisParams() :
150 AlpsParameterSet(
151 static_cast<int>(endOfBoolParams),
152 static_cast<int>(endOfIntParams),
153 static_cast<int>(endOfDblParams),
154 static_cast<int>(endOfStrParams),
155 static_cast<int>(endOfStrArrayParams)
156 )
157 {
158 createKeywordList();
159 setDefaultEntries();
160 }
165 virtual void createKeywordList();
167 virtual void setDefaultEntries();
171 public:
172 //===========================================================================
180 //===========================================================================
181
182
191 inline bool entry(const boolParams key) const { return bpar_[key]; }
194 inline int entry(const intParams key) const { return ipar_[key]; }
196 inline double entry(const dblParams key) const { return dpar_[key]; }
198 inline const std::string&
199 entry(const strParams key) const { return spar_[key]; }
201 inline const std::vector<std::string>&
202 entry(const strArrayParams key) const { return sapar_[key]; }
205 //---------------------------------------------------------------------------
207 void setEntry(const boolParams key, const char * val) {
208 bpar_[key] = atoi(val) ? true : false; }
210 void setEntry(const boolParams key, const char val) {
211 bpar_[key] = val ? true : false; }
213 void setEntry(const boolParams key, const bool val) {
214 bpar_[key] = val; }
216 void setEntry(const intParams key, const char * val) {
217 ipar_[key] = atoi(val); }
219 void setEntry(const intParams key, const int val) {
220 ipar_[key] = val; }
222 void setEntry(const dblParams key, const char * val) {
223 dpar_[key] = atof(val); }
225 void setEntry(const dblParams key, const double val) {
226 dpar_[key] = val; }
228 void setEntry(const strParams key, const char * val) {
229 spar_[key] = val; }
231 void setEntry(const strArrayParams key, const char *val) {
232 sapar_[key].push_back(val); }
233
234 //---------------------------------------------------------------------------
235
240 void pack(AlpsEncoded& buf) {
241 buf.writeRep(bpar_, endOfBoolParams)
242 .writeRep(ipar_, endOfIntParams)
243 .writeRep(dpar_, endOfDblParams);
244 for (int i = 0; i < endOfStrParams; ++i)
245 buf.writeRep(spar_[i]);
246 for (int i = 0; i < endOfStrArrayParams; ++i) {
247 buf.writeRep(sapar_[i].size());
248 for (size_t j = 0; j < sapar_[i].size(); ++j)
249 buf.writeRep(sapar_[i][j]);
250 }
251 }
253 void unpack(AlpsEncoded& buf) {
254 int dummy;
255 // No need to allocate the arrays, they are of fixed length
256 dummy = static_cast<int>(endOfBoolParams);
257 buf.readRep(bpar_, dummy, false);
258 dummy = static_cast<int>(endOfIntParams);
259 buf.readRep(ipar_, dummy, false);
260 dummy = static_cast<int>(endOfDblParams);
261 buf.readRep(dpar_, dummy, false);
262 for (int i = 0; i < endOfStrParams; ++i)
263 buf.readRep(spar_[i]);
264 for (int i = 0; i < endOfStrArrayParams; ++i) {
265 size_t str_size;
266 buf.readRep(str_size);
267 sapar_[i].reserve(str_size);
268 for (size_t j = 0; j < str_size; ++j){
269 // sapar_[i].unchecked_push_back(std::string());
270 sapar_[i].push_back(std::string());
271 buf.readRep(sapar_[i].back());
272 }
273 }
274 }
277 };
278
279 #endif
BlisParams::integerTol
Tolrence to treat as an integer.
Definition: BlisParams.h:99
BlisParams::pseudoWeight
Weight used to calculate pseudocost.
Definition: BlisParams.h:114
BlisParams::entry
int entry(const intParams key) const
Definition: BlisParams.h:194
AlpsEncoded::readRep
AlpsEncoded & readRep(T &value)
Read a single object of type T from repsentation_ .
Definition: AlpsEncoded.h:173
AlpsEncoded::writeRep
AlpsEncoded & writeRep(const T &value)
Write a single object of type T in repsentation_ .
Definition: AlpsEncoded.h:163
AlpsParameterBase.h
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:240
BlisParams::setEntry
void setEntry(const boolParams key, const char *val)
char* is true(1) or false(0), not used
Definition: BlisParams.h:207
BlisParams::cutOddHole
Definition: BlisParams.h:85
BlisParams::setEntry
void setEntry(const strArrayParams key, const char *val)
Definition: BlisParams.h:231
BlisParams::useHeuristics
Whether call heuristics. Default: true.
Definition: BlisParams.h:43
AlpsParameterSet::ipar_
int * ipar_
The integer parameters.
Definition: AlpsParameterBase.h:150
BlisParams::branchStrategy
-1: disable, 0: default, 1: verbose.
Definition: BlisParams.h:64
BlisParams::cutKnapsack
Definition: BlisParams.h:83
BlisParams::entry
const std::string & entry(const strParams key) const
Definition: BlisParams.h:199
BlisParams::endOfBoolParams
Definition: BlisParams.h:47
BlisParams::endOfIntParams
Definition: BlisParams.h:93
BlisParams::setEntry
void setEntry(const dblParams key, const double val)
Definition: BlisParams.h:225
BlisParams::cutFlowCover
Definition: BlisParams.h:82
BlisParams::scaleConFactor
Scaling indicator of a constraint.
Definition: BlisParams.h:124
BlisParams::setEntry
void setEntry(const intParams key, const int val)
Definition: BlisParams.h:219
BlisParams::entry
double entry(const dblParams key) const
Definition: BlisParams.h:196
BlisParams::cutDuringRampup
Whether generate cuts during rampup. Default: false.
Definition: BlisParams.h:45
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::cutMir
Definition: BlisParams.h:84
BlisParams::BlisParams
BlisParams()
The default constructor creates a parameter set with from the template argument structure.
Definition: BlisParams.h:149
BlisParams::optimalAbsGap
If the absolute gap between best feasible and best relaxed fall into this gap, search stops...
Definition: BlisParams.h:111
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
BlisParams::setEntry
void setEntry(const intParams key, const char *val)
Definition: BlisParams.h:216
BlisParams::setEntry
void setEntry(const strParams key, const char *val)
Definition: BlisParams.h:228
BlisParams::cutoffInc
The value added to relaxation value when deciding fathom.
Definition: BlisParams.h:103
BlisParams::endOfDblParams
Definition: BlisParams.h:126
BlisParams::strParams
strParams
String parameters.
Definition: BlisParams.h:130
BlisParams::setEntry
void setEntry(const boolParams key, const bool val)
This method is the one that ever been used.
Definition: BlisParams.h:213
BlisParams::cutProbing
Definition: BlisParams.h:86
BlisParams::endOfStrArrayParams
Definition: BlisParams.h:140
BlisParams::boolParams
boolParams
Character parameters.
Definition: BlisParams.h:39
AlpsKnowledge.h
BlisParams::useCons
Whether generate cuts at all. Default: true.
Definition: BlisParams.h:41
AlpsParameterSet::sapar_
std::vector< std::string > * sapar_
The keyword, parameter pairs.
Definition: AlpsParameterBase.h:160
AlpsParameterSet::bpar_
bool * bpar_
The bool parameters.
Definition: AlpsParameterBase.h:147
BlisParams::cutGomory
Definition: BlisParams.h:81
BlisParams::unpack
void unpack(AlpsEncoded &buf)
Unpack the parameter set from the buffer.
Definition: BlisParams.h:253
BlisParams::cutClique
Cut generators control.
Definition: BlisParams.h:80
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::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::setEntry
void setEntry(const dblParams key, const char *val)
Definition: BlisParams.h:222
BlisParams::cutTwoMir
Definition: BlisParams.h:87
BlisParams::heurRound
Heuristics control.
Definition: BlisParams.h:72
BlisParams::setEntry
void setEntry(const boolParams key, const char val)
char is true(1) or false(0), not used
Definition: BlisParams.h:210
BlisParams::entry
const std::vector< std::string > & entry(const strArrayParams key) const
Definition: BlisParams.h:202