Dip
0.95.0
src
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
//===========================================================================//
31
class
AlpsDecompParam
{
32
33
//----------------------------------------------------------------------//
38
//----------------------------------------------------------------------//
39
40
public
:
47
int
logFileLevel
;
48
53
bool
printSolution
;
54
58
bool
checkMemory
;
59
68
int
msgLevel
;
69
73
int
nodeLimit
;
74
78
int
nodeLogInterval
;
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
:
127
AlpsDecompParam
() {}
128
129
AlpsDecompParam
(
UtilParameters
& utilParam) {
130
getSettings
(utilParam);
131
}
132
136
~AlpsDecompParam
() {}
140
};
141
142
#endif
AlpsDecompParam::~AlpsDecompParam
~AlpsDecompParam()
Destructor.
Definition:
AlpsDecompParam.h:136
UtilParameters
Definition:
UtilParameters.h:26
ALPS_INT_MAX
#define ALPS_INT_MAX
AlpsDecompParam::getSettings
void getSettings(UtilParameters ¶m)
Definition:
AlpsDecompParam.h:88
AlpsDecompParam::printSolution
bool printSolution
Print solution to screen and log if have a solution and msgLevel and logFileLevel permits.
Definition:
AlpsDecompParam.h:53
AlpsDecompParam
Parameters passed through to Alps.
Definition:
AlpsDecompParam.h:31
AlpsDecompParam::AlpsDecompParam
AlpsDecompParam()
Default constructors.
Definition:
AlpsDecompParam.h:127
AlpsDecompParam::dumpSettings
void dumpSettings(std::ostream *os=&std::cout)
Definition:
AlpsDecompParam.h:102
AlpsDecompParam::nodeLimit
int nodeLimit
The max number of nodes can be processed.
Definition:
AlpsDecompParam.h:73
UtilParameters::GetSetting
std::string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
AlpsDecompParam::nodeLogInterval
int nodeLogInterval
Node log interval.
Definition:
AlpsDecompParam.h:78
AlpsDecompParam::logFileLevel
int logFileLevel
The level of log file.
Definition:
AlpsDecompParam.h:47
AlpsDecompParam::msgLevel
int msgLevel
The level of printing messages on screen.
Definition:
AlpsDecompParam.h:68
UtilParameters.h
AlpsDecompParam::checkMemory
bool checkMemory
Check memory.
Definition:
AlpsDecompParam.h:58
AlpsDecompParam::AlpsDecompParam
AlpsDecompParam(UtilParameters &utilParam)
Definition:
AlpsDecompParam.h:129
Generated by
1.8.17