Dip  0.92.4
AlpsDecompParam.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the DIP Solver Framework. //
3 // //
4 // DIP is distributed under the Eclipse Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Authors: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // Ted Ralphs, Lehigh University (ted@lehigh.edu) //
9 // Jiadong Wang, Lehigh University (jiw408@lehigh.edu) //
10 // //
11 // Copyright (C) 2002-2019, Lehigh University, Matthew Galati, Ted Ralphs //
12 // All Rights Reserved. //
13 //===========================================================================//
14 
15 //===========================================================================//
16 #ifndef AlpsDecompParam_h_
17 #define AlpsDecompParam_h_
18 
19 //===========================================================================//
20 #include "UtilParameters.h"
21 
22 //===========================================================================//
28 //===========================================================================//
29 
30 //===========================================================================//
32 
33  //----------------------------------------------------------------------//
38  //----------------------------------------------------------------------//
39 
40 public:
48 
54 
59 
68  int msgLevel;
69 
73  int nodeLimit;
74 
79 
80 
81  //-----------------------------------------------------------------------//
86  //-----------------------------------------------------------------------//
87 public:
88  void getSettings(UtilParameters& param) {
89  static const char* sec = "ALPS";
90  logFileLevel = param.GetSetting("logFileLevel", 0, sec);
91  printSolution = param.GetSetting("printSolution", false, sec);
92  checkMemory = param.GetSetting("checkMemory", false, sec);
93  msgLevel = param.GetSetting("msgLevel", 2, sec);
94  nodeLimit = param.GetSetting("nodeLimit", ALPS_INT_MAX, sec);
95  nodeLogInterval = param.GetSetting("nodeLogInterval", 10, sec);
96 
97  if (msgLevel > 2) {
98  dumpSettings();
99  }
100  }
101 
102  void dumpSettings(std::ostream* os = &std::cout) {
103  static const char* sec = "ALPS";
104  (*os) << "\n========================================================\n"
105  << "ALPS PARAMETER SETTINGS \n";
106  (*os) << sec << ": logFileLevel = " << logFileLevel << std::endl;
107  (*os) << sec << ": printSolution = " << printSolution << std::endl;
108  (*os) << sec << ": checkMemory = " << checkMemory << std::endl;
109  (*os) << sec << ": msgLevel = " << msgLevel << std::endl;
110  (*os) << sec << ": nodeLimit = " << nodeLimit << std::endl;
111  (*os) << sec << ": nodeLogInterval = " << nodeLogInterval << std::endl;
112  }
117  //-----------------------------------------------------------------------//
122  //-----------------------------------------------------------------------//
123 public:
128 
130  getSettings(utilParam);
131  }
132 
140 };
141 
142 #endif
AlpsDecompParam(UtilParameters &utilParam)
Default constructors.
#define ALPS_INT_MAX
Definition: Alps.h:150
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
bool checkMemory
Check memory.
AlpsDecompParam()
Default constructors.
Parameters passed through to Alps.
int msgLevel
The level of printing messages on screen.
void getSettings(UtilParameters &param)
bool printSolution
Print solution to screen and log if have a solution and msgLevel and logFileLevel permits...
int nodeLogInterval
Node log interval.
void dumpSettings(std::ostream *os=&std::cout)
int logFileLevel
The level of log file.
int nodeLimit
The max number of nodes can be processed.
~AlpsDecompParam()
Destructor.