Blis 0.95.0
Loading...
Searching...
No Matches
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-2023, 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 "BlisConfig.h"
31#include "Blis.h"
32
33//#############################################################################
34
35//** Parameters used in Blis. */
36class BLISLIB_EXPORT BlisParams : public AlpsParameterSet {
37 public:
65
136
177
184
191
192 public:
199 AlpsParameterSet(
200 static_cast<int>(endOfChrParams),
201 static_cast<int>(endOfIntParams),
202 static_cast<int>(endOfDblParams),
203 static_cast<int>(endOfStrParams),
204 static_cast<int>(endOfStrArrayParams)
205 )
206 {
207 prefix_ = "Blis";
210 }
211
212
215 virtual void createKeywordList();
217 virtual void setDefaultEntries();
219
220
221 public:
222 //===========================================================================
230 //===========================================================================
231
232
242 inline bool entry(const chrParams key) const { return bpar_[key]; }
244 inline int entry(const intParams key) const { return ipar_[key]; }
246 inline double entry(const dblParams key) const { return dpar_[key]; }
248 inline const std::string&
249 entry(const strParams key) const { return spar_[key]; }
251 inline const std::vector<std::string>&
252 entry(const strArrayParams key) const { return sapar_[key]; }
254
255 //---------------------------------------------------------------------------
257 void setEntry(const chrParams key, const char * val) {
258 bpar_[key] = atoi(val) ? true : false; }
259
260 void setEntry(const chrParams key, const char val) {
261 bpar_[key] = val ? true : false; }
262
263 void setEntry(const chrParams key, const bool val) {
264 bpar_[key] = val; }
265
266 void setEntry(const intParams key, const char * val) {
267 ipar_[key] = atoi(val); }
268
269 void setEntry(const intParams key, const int val) {
270 ipar_[key] = val; }
271
272 void setEntry(const dblParams key, const char * val) {
273 dpar_[key] = atof(val); }
274
275 void setEntry(const dblParams key, const double val) {
276 dpar_[key] = val; }
277
278 void setEntry(const strParams key, const char * val) {
279 spar_[key] = val; }
280
281 void setEntry(const strArrayParams key, const char *val) {
282 sapar_[key].push_back(val); }
283
284 //---------------------------------------------------------------------------
285
290 void pack(AlpsEncoded& buf) {
291 buf.writeRep(bpar_, endOfChrParams)
292 .writeRep(ipar_, endOfIntParams)
293 .writeRep(dpar_, endOfDblParams);
294 for (int i = 0; i < endOfStrParams; ++i)
295 buf.writeRep(spar_[i]);
296 for (int i = 0; i < endOfStrArrayParams; ++i) {
297 buf.writeRep(sapar_[i].size());
298 for (size_t j = 0; j < sapar_[i].size(); ++j)
299 buf.writeRep(sapar_[i][j]);
300 }
301 }
302
303 void unpack(AlpsEncoded& buf) {
304 int dummy;
305 // No need to allocate the arrays, they are of fixed length
306 dummy = static_cast<int>(endOfChrParams);
307 buf.readRep(bpar_, dummy, false);
308 dummy = static_cast<int>(endOfIntParams);
309 buf.readRep(ipar_, dummy, false);
310 dummy = static_cast<int>(endOfDblParams);
311 buf.readRep(dpar_, dummy, false);
312 for (int i = 0; i < endOfStrParams; ++i)
313 buf.readRep(spar_[i]);
314 for (int i = 0; i < endOfStrArrayParams; ++i) {
315 size_t str_size;
316 buf.readRep(str_size);
317 sapar_[i].reserve(str_size);
318 for (size_t j = 0; j < str_size; ++j){
319 // sapar_[i].unchecked_push_back(std::string());
320 sapar_[i].push_back(std::string());
321 buf.readRep(sapar_[i].back());
322 }
323 }
324 }
325
326
327};
328
329#endif
void setEntry(const dblParams key, const char *val)
Definition BlisParams.h:272
virtual void setDefaultEntries()
Method for setting the default values for the parameters.
void setEntry(const intParams key, const int val)
Definition BlisParams.h:269
void setEntry(const strArrayParams key, const char *val)
Definition BlisParams.h:281
virtual void createKeywordList()
Method for creating the list of keyword looked for in the parameter file.
void setEntry(const chrParams key, const bool val)
This method is the one that ever been used.
Definition BlisParams.h:263
dblParams
Double parameters.
Definition BlisParams.h:138
@ cutFactor
Limit the max number cuts applied at a node.
Definition BlisParams.h:141
@ cutoffInc
The value added to relaxation value when deciding fathom.
Definition BlisParams.h:147
@ pseudoWeight
Weight used to calculate pseudocost.
Definition BlisParams.h:167
@ tailOff
Tail off.
Definition BlisParams.h:173
@ optimalRelGap
If the relative gap between best feasible and best relaxed fall into this gap, search stops.
Definition BlisParams.h:160
@ objSense
Objective sense: min = 1.0, max = -1.0.
Definition BlisParams.h:156
@ integerTol
Tolerance to treat as an integer.
Definition BlisParams.h:153
@ optimalAbsGap
If the absolute gap between best feasible and best relaxed fall into this gap, search stops.
Definition BlisParams.h:164
@ denseConFactor
Dense constraint factor.
Definition BlisParams.h:150
@ scaleConFactor
Scaling indicator of a constraint.
Definition BlisParams.h:170
@ cutoff
Cutoff any nodes whose objective value is higher than it.
Definition BlisParams.h:144
strArrayParams
There are no string array parameters.
Definition BlisParams.h:186
@ endOfStrArrayParams
Definition BlisParams.h:189
double entry(const dblParams key) const
Definition BlisParams.h:246
void setEntry(const intParams key, const char *val)
Definition BlisParams.h:266
void setEntry(const chrParams key, const char *val)
char* is true(1) or false(0), not used
Definition BlisParams.h:257
void setEntry(const dblParams key, const double val)
Definition BlisParams.h:275
const std::vector< std::string > & entry(const strArrayParams key) const
Definition BlisParams.h:252
const std::string & entry(const strParams key) const
Definition BlisParams.h:249
chrParams
Character parameters.
Definition BlisParams.h:40
@ sharePseudocostRampUp
Share pseudocost during ramp up.
Definition BlisParams.h:54
@ presolve
Presolve or not.
Definition BlisParams.h:45
@ checkFeasibleInBranch
Whether to check whether solutions are feasible during strong branching Default: true.
Definition BlisParams.h:61
@ shareConstraints
Share constraints Default: false.
Definition BlisParams.h:48
@ cutRampUp
Generate cuts during rampup.
Definition BlisParams.h:43
@ sharePseudocostSearch
Share pseudocost during search Default: false.
Definition BlisParams.h:57
@ shareVariables
Share constraints Default: false.
Definition BlisParams.h:51
bool entry(const chrParams key) const
Definition BlisParams.h:242
BlisParams()
The default constructor creates a parameter set with from the template argument structure.
Definition BlisParams.h:198
void setEntry(const strParams key, const char *val)
Definition BlisParams.h:278
void unpack(AlpsEncoded &buf)
Unpack the parameter set from the buffer.
Definition BlisParams.h:303
int entry(const intParams key) const
Definition BlisParams.h:244
strParams
String parameters.
Definition BlisParams.h:179
void pack(AlpsEncoded &buf)
Pack the parameter set into the buffer (AlpsEncoded is used as buffer Here).
Definition BlisParams.h:290
void setEntry(const chrParams key, const char val)
char is true(1) or false(0), not used
Definition BlisParams.h:260
intParams
Integer paramters.
Definition BlisParams.h:67
@ branchStrategy
Branching strategy.
Definition BlisParams.h:76
@ cutFlowCoverStrategy
Definition BlisParams.h:93
@ heurCallFrequency
All heuristics.
Definition BlisParams.h:118
@ cutProbingStrategy
Definition BlisParams.h:97
@ cutTwoMirStrategy
Definition BlisParams.h:98
@ heurRoundStrategy
Definition BlisParams.h:119
@ cutStrategy
Cut generators control.
Definition BlisParams.h:85
@ lookAhead
The look ahead of pseudocost.
Definition BlisParams.h:123
@ sharePcostFrequency
Frequency of sharing pseudocost.
Definition BlisParams.h:130
@ cutCliqueStrategy
The pass to generate cuts for quick branching.
Definition BlisParams.h:91
@ strongCandSize
The number of candidate used in strong branching.
Definition BlisParams.h:132
@ heurStrategy
Heuristics control.
Definition BlisParams.h:117
@ difference
-1 auto, 0, no, any integer frequency
Definition BlisParams.h:109
@ cutGenerationFrequency
All constraint generators.
Definition BlisParams.h:86
@ cutOddHoleStrategy
Definition BlisParams.h:96
@ sharePcostDepth
Maximum tree depth of sharing pseudocost.
Definition BlisParams.h:128
@ pseudoRelibility
The relibility of pseudocost.
Definition BlisParams.h:125
@ branchStrategyRampUp
Definition BlisParams.h:77
@ cutKnapsackStrategy
Definition BlisParams.h:94
@ cutGomoryStrategy
Definition BlisParams.h:92
@ quickCutPass
The pass to generate cuts.
Definition BlisParams.h:89
#define BLISLIB_EXPORT
Definition config.h:5