Dip  0.92.4
MCF_Param.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the Decomp Solver Framework. //
3 // //
4 // Decomp is distributed under the Common 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, and Ted Ralphs//
12 // All Rights Reserved. //
13 //===========================================================================//
14 
15 #ifndef MCF_PARAM_INCLUDED
16 #define MCF_PARAM_INCLUDED
17 
18 //===========================================================================//
19 #include "UtilMacros.h"
20 #include "UtilMacrosDecomp.h"
21 #include "UtilParameters.h"
22 //===========================================================================//
23 
24 //===========================================================================//
31 //===========================================================================//
32 class MCF_Param {
33 public:
34  int LogLevel; //application log level
35  int UseSparse; //use sparse version of relaxations
36  string DataDir; //data directory
37  string Instance; //name of instance
38 
39 public:
40  void getSettings(UtilParameters& utilParam) {
41  static const char* common = "MCF";
42  LogLevel = utilParam.GetSetting("LogLevel", 0, common);
43  UseSparse = utilParam.GetSetting("UseSparse", 0, common);
44  DataDir = utilParam.GetSetting("DataDir", "", common);
45  Instance = utilParam.GetSetting("Instance", "", common);
46 
47  if (!checkOptions()) {
48  throw UtilException("Bad Parameter", "getSettings", "MCF_Param");
49  }
50  }
51 
52  bool checkOptions() {
53  bool optionsOk = true;
54  return optionsOk;
55  }
56 
57  void dumpSettings(ostream* os = &cout) {
58  static const char* common = "MCF";
59  (*os) << "\n=====================================================\n"
60  << "MCF_DECOMP PARAMETER SETTINGS \n";
61  (*os) << common << ": LogLevel : " << LogLevel << endl;
62  (*os) << common << ": UseSparse : " << UseSparse << endl;
63  (*os) << common << ": DataDir : " << DataDir << endl;
64  (*os) << common << ": Instance : " << Instance << endl;
65  (*os) << "=====================================================\n";
66  }
67 
68 public:
70  LogLevel (0),
71  UseSparse (0),
72  DataDir (""),
73  Instance ("") {
74  }
75  ~MCF_Param() {};
76 };
77 
78 #endif
string Instance
Definition: MCF_Param.h:37
int UseSparse
Definition: MCF_Param.h:35
~MCF_Param()
Definition: MCF_Param.h:75
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
MCF_Param()
Definition: MCF_Param.h:69
int LogLevel
Definition: MCF_Param.h:34
string DataDir
Definition: MCF_Param.h:36
void getSettings(UtilParameters &utilParam)
Definition: MCF_Param.h:40
bool checkOptions()
Definition: MCF_Param.h:52
void dumpSettings(ostream *os=&cout)
Definition: MCF_Param.h:57
#define UtilException(msg, methodN, classN)