Dip-All  0.91.0
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 // Author: Matthew Galati, Lehigh University //
8 // //
9 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, and Ted Ralphs//
10 // All Rights Reserved. //
11 //===========================================================================//
12 
13 #ifndef MCF_PARAM_INCLUDED
14 #define MCF_PARAM_INCLUDED
15 
16 //===========================================================================//
17 #include "UtilMacros.h"
18 #include "UtilMacrosDecomp.h"
19 #include "UtilParameters.h"
20 //===========================================================================//
21 
22 //===========================================================================//
29 //===========================================================================//
30 class MCF_Param {
31 public:
32  int LogLevel; //application log level
33  int UseSparse; //use sparse version of relaxations
34  string DataDir; //data directory
35  string Instance; //name of instance
36 
37 public:
38  void getSettings(UtilParameters& utilParam) {
39  static const char* common = "MCF";
40  LogLevel = utilParam.GetSetting("LogLevel", 0, common);
41  UseSparse = utilParam.GetSetting("UseSparse", 0, common);
42  DataDir = utilParam.GetSetting("DataDir", "", common);
43  Instance = utilParam.GetSetting("Instance", "", common);
44 
45  if (!checkOptions()) {
46  throw UtilException("Bad Parameter", "getSettings", "MCF_Param");
47  }
48  }
49 
50  bool checkOptions() {
51  bool optionsOk = true;
52  return optionsOk;
53  }
54 
55  void dumpSettings(ostream* os = &cout) {
56  static const char* common = "MCF";
57  (*os) << "\n=====================================================\n"
58  << "MCF_DECOMP PARAMETER SETTINGS \n";
59  (*os) << common << ": LogLevel : " << LogLevel << endl;
60  (*os) << common << ": UseSparse : " << UseSparse << endl;
61  (*os) << common << ": DataDir : " << DataDir << endl;
62  (*os) << common << ": Instance : " << Instance << endl;
63  (*os) << "=====================================================\n";
64  }
65 
66 public:
68  LogLevel (0),
69  UseSparse (0),
70  DataDir (""),
71  Instance ("") {
72  }
73  ~MCF_Param() {};
74 };
75 
76 #endif
string Instance
Definition: MCF_Param.h:35
int UseSparse
Definition: MCF_Param.h:33
~MCF_Param()
Definition: MCF_Param.h:73
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
MCF_Param()
Definition: MCF_Param.h:67
int LogLevel
Definition: MCF_Param.h:32
string DataDir
Definition: MCF_Param.h:34
void getSettings(UtilParameters &utilParam)
Definition: MCF_Param.h:38
bool checkOptions()
Definition: MCF_Param.h:50
void dumpSettings(ostream *os=&cout)
Definition: MCF_Param.h:55
#define UtilException(msg, methodN, classN)