Dip-All  0.91.0
SDPUC_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 SDPUC_PARAM_INCLUDED
14 #define SDPUC_PARAM_INCLUDED
15 
16 //===========================================================================//
17 #include "UtilMacros.h"
18 #include "UtilMacrosDecomp.h"
19 #include "UtilParameters.h"
20 //===========================================================================//
21 
22 //===========================================================================//
29 //===========================================================================//
30 class SDPUC_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  if(!checkOptions())
45  throw UtilException("Bad Parameter", "getSettings", "MCF_Param");
46  }
47 
48  bool checkOptions(){
49  bool optionsOk = true;
50  return optionsOk;
51  }
52 
53  void dumpSettings(ostream * os = &cout){
54  static const char * common = "MCF";
55  (*os) << "\n=====================================================\n"
56  << "MCF_DECOMP PARAMETER SETTINGS \n";
57  (*os) << common << ": LogLevel : " << LogLevel << endl;
58  (*os) << common << ": UseSparse : " << UseSparse << endl;
59  (*os) << common << ": DataDir : " << DataDir << endl;
60  (*os) << common << ": Instance : " << Instance << endl;
61  (*os) << "=====================================================\n";
62  }
63 
64 public:
66  LogLevel (0),
67  UseSparse (0),
68  DataDir (""),
69  Instance ("")
70  {}
72 };
73 
74 #endif
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
void dumpSettings(ostream *os=&cout)
Definition: SDPUC_Param.h:53
string Instance
Definition: SDPUC_Param.h:35
void getSettings(UtilParameters &utilParam)
Definition: SDPUC_Param.h:38
bool checkOptions()
Definition: SDPUC_Param.h:48
string DataDir
Definition: SDPUC_Param.h:34
#define UtilException(msg, methodN, classN)