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{
57  //
59  };
60 
62  enum intParams{
63 
73 
82 
102 
105 
116 
118  lookAhead,
121 
130  };
131 
133  enum dblParams{
136  cutFactor,
137 
142  cutoffInc,
143 
146 
148  integerTol,
149 
152 
156 
160 
162  pseudoWeight,
163 
166 
171  };
172 
174  enum strParams{
175  strDummy,
176  //
178  };
179 
185  };
186 
187  public:
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  {
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) {
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
Tolrence to treat as an integer.
Definition: BlisParams.h:99
All constraint generators.
Definition: BlisParams.h:81
Share constraints Default: false.
Definition: BlisParams.h:47
Weight used to calculate pseudocost.
Definition: BlisParams.h:114
Heuristics control.
Definition: BlisParams.h:112
int entry(const intParams key) const
Definition: BlisParams.h:238
AlpsEncoded & readRep(T &value)
Read a single object of type T from repsentation_ .
Definition: AlpsEncoded.h:173
AlpsEncoded & writeRep(const T &value)
Write a single object of type T in repsentation_ .
Definition: AlpsEncoded.h:163
void setEntry(const chrParams key, const bool val)
This method is the one that ever been used.
Definition: BlisParams.h:257
This is the class serves as a holder for a set of parameters.
void pack(AlpsEncoded &buf)
Pack the parameter set into the buffer (AlpsEncoded is used as buffer Here).
Definition: BlisParams.h:284
void setEntry(const strArrayParams key, const char *val)
Definition: BlisParams.h:275
Share pseudocost during search Default: false.
Definition: BlisParams.h:56
int * ipar_
The integer parameters.
-1: disable, 0: default, 1: verbose.
Definition: BlisParams.h:64
Cut generators control.
Definition: BlisParams.h:80
const std::string & entry(const strParams key) const
Definition: BlisParams.h:243
Share pseudocost during ramp up.
Definition: BlisParams.h:53
Objective sense: min = 1.0, max = -1.0.
Definition: BlisParams.h:151
void setEntry(const dblParams key, const double val)
Definition: BlisParams.h:269
Scaling indicator of a constraint.
Definition: BlisParams.h:124
void setEntry(const intParams key, const int val)
Definition: BlisParams.h:263
double entry(const dblParams key) const
Definition: BlisParams.h:240
Presolve or not.
Definition: BlisParams.h:44
The pass to generate cuts.
Definition: BlisParams.h:84
This data structure is to contain the packed form of an encodable knowledge.
Definition: AlpsEncoded.h:25
virtual void createKeywordList()
Method for creating the list of keyword looked for in the parameter file.
dblParams
Double parameters.
Definition: BlisParams.h:97
Cutoff any nodes whose objective value is higher than it.
Definition: BlisParams.h:139
Frequency of sharing pseudocost.
Definition: BlisParams.h:125
BlisParams()
The default constructor creates a parameter set with from the template argument structure.
Definition: BlisParams.h:193
If the absolute gap between best feasible and best relaxed fall into this gap, search stops...
Definition: BlisParams.h:111
strArrayParams
There are no string array parameters.
Definition: BlisParams.h:137
std::string * spar_
The string (actually, std::string) parameters.
The look ahead of pseudocost.
Definition: BlisParams.h:91
void setEntry(const intParams key, const char *val)
Definition: BlisParams.h:260
void setEntry(const strParams key, const char *val)
Definition: BlisParams.h:272
The value added to relaxation value when deciding fathom.
Definition: BlisParams.h:103
strParams
String parameters.
Definition: BlisParams.h:130
The pass to generate cuts for quick branching.
Definition: BlisParams.h:86
-1 auto, 0, no, any integer frequency
Definition: BlisParams.h:104
std::vector< std::string > * sapar_
The keyword, parameter pairs.
void setEntry(const chrParams key, const char *val)
char* is true(1) or false(0), not used
Definition: BlisParams.h:251
Generate cuts during rampup.
Definition: BlisParams.h:42
bool * bpar_
The bool parameters.
void unpack(AlpsEncoded &buf)
Unpack the parameter set from the buffer.
Definition: BlisParams.h:297
chrParams
Character parameters.
Definition: BlisParams.h:39
void setEntry(const chrParams key, const char val)
char is true(1) or false(0), not used
Definition: BlisParams.h:254
virtual void setDefaultEntries()
Method for setting the default values for the parameters.
If the relative gap between best feasible and best relaxed fall into this gap, search stops...
Definition: BlisParams.h:107
Limit the max number cuts applied at a node.
Definition: BlisParams.h:118
bool entry(const boolParams key) const
Definition: BlisParams.h:192
double * dpar_
The double parameters.
intParams
Integer paramters.
Definition: BlisParams.h:51
The relibility of pseudocost.
Definition: BlisParams.h:89
The number of candidate used in strong branching.
Definition: BlisParams.h:53
Dense constraint factor.
Definition: BlisParams.h:121
Share constraints Default: false.
Definition: BlisParams.h:50
void setEntry(const dblParams key, const char *val)
Definition: BlisParams.h:266
const std::vector< std::string > & entry(const strArrayParams key) const
Definition: BlisParams.h:246
Maximum tree depth of sharing pseudocost.
Definition: BlisParams.h:123