Dip  0.92.4
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 // 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 SDPUC_PARAM_INCLUDED
16 #define SDPUC_PARAM_INCLUDED
17 
18 //===========================================================================//
19 #include "UtilMacros.h"
20 #include "UtilMacrosDecomp.h"
21 #include "UtilParameters.h"
22 //===========================================================================//
23 
24 //===========================================================================//
31 //===========================================================================//
32 class SDPUC_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  if(!checkOptions())
47  throw UtilException("Bad Parameter", "getSettings", "MCF_Param");
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  {}
74 };
75 
76 #endif
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
void dumpSettings(ostream *os=&cout)
Definition: SDPUC_Param.h:55
string Instance
Definition: SDPUC_Param.h:37
void getSettings(UtilParameters &utilParam)
Definition: SDPUC_Param.h:40
bool checkOptions()
Definition: SDPUC_Param.h:50
string DataDir
Definition: SDPUC_Param.h:36
#define UtilException(msg, methodN, classN)