Dip  0.92.4
MAD_DecompParam.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 MAD_DECOMP_PARAM_INCLUDED
16 #define MAD_DECOMP_PARAM_INCLUDED
17 
18 // --------------------------------------------------------------------- //
19 #include "UtilParameters.h"
20 
21 using namespace std;
22 
23 // --------------------------------------------------------------------- //
33 // --------------------------------------------------------------------- //
35  public:
36  string DataDir;
37  string DataSubDir;
38  string Instance;
39  int NumBlocks;
40  int Capacity;
41 
42  public:
43  void getSettings(UtilParameters & utilParam){
44  static const char * common = "MAD";
45  DataDir = utilParam.GetSetting("DataDir", ".", common);
46  DataSubDir = utilParam.GetSetting("DataSubDir", ".", common);
47  Instance = utilParam.GetSetting("Instance", ".", common);
48  NumBlocks = utilParam.GetSetting("NumBlocks", 2, common);
49  Capacity = utilParam.GetSetting("Capacity", -1, common);
50  }
51 
52  void dumpSettings(ostream * os = &cout){
53  static const char * common = "MAD";
54  (*os) << "\n=====================================================\n"
55  << "MAD_DECOMP PARAMETER SETTINGS \n";
56  (*os) << common << ": DataDir : " << DataDir << endl;
57  (*os) << common << ": DataSubDir : " << DataSubDir << endl;
58  (*os) << common << ": Instance : " << Instance << endl;
59  (*os) << common << ": NumBlocks : " << NumBlocks << endl;
60  (*os) << common << ": Capacity : " << Capacity << endl;
61  (*os) << "=====================================================\n";
62  }
63 
64  public:
66  DataDir ("."),
67  DataSubDir("."),
68  Instance ("."),
69  NumBlocks (2 ),
70  Capacity (-1 )
71  {
72  };
74 };
75 
76 #endif
void getSettings(UtilParameters &utilParam)
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
void dumpSettings(ostream *os=&cout)