Dip  0.92.4
MILPBlock_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 MILPBLOCK_PARAM_INCLUDED
16 #define MILPBLOCK_PARAM_INCLUDED
17 
18 //===========================================================================//
19 #include "UtilParameters.h"
20 
21 using namespace std;
22 
23 //===========================================================================//
25 public:
26  int LogLevel;
27  string DataDir;
28  string Instance;
29 
30  /*
31  * The file defining which rows are in which blocks.
32  */
33  string BlockFile;
34 
54 
55  string PermuteFile;
57  int UseNames; //col/row names for debugging
58  int UseSparse; //create all blocks sparsely
59  int FullModel; //create full model for CPM or direct
60  double BestKnownLB;
61  double BestKnownUB;
62  double ColumnUB; //hack since missing extreme rays
63  double ColumnLB; //hack since missing extreme rays
64 
65  //TOOD: better solution for this
66  int ObjectiveSense; //1=min, -1=max
67 
68 public:
69  void getSettings(UtilParameters & utilParam){
70  static const char * common = "MILPBlock";
71  LogLevel = utilParam.GetSetting("LogLevel", 0, common);
72  DataDir = utilParam.GetSetting("DataDir", "", common);
73  Instance = utilParam.GetSetting("Instance", "", common);
74  BlockFile = utilParam.GetSetting("BlockFile", "", common);
75  PermuteFile = utilParam.GetSetting("PermuteFile", "", common);
76  BlockFileFormat
77  = utilParam.GetSetting("BlockFileFormat", "", common);
78  InitSolutionFile
79  = utilParam.GetSetting("InitSolutionFile", "", common);
80  UseNames = utilParam.GetSetting("UseNames", 0, common);
81  UseSparse = utilParam.GetSetting("UseSparse", 1, common);
82  FullModel = utilParam.GetSetting("FullModel", 0, common);
83  BestKnownLB = utilParam.GetSetting("BestKnownLB", -1.e100, common);
84  BestKnownUB = utilParam.GetSetting("BestKnownUB", 1.e100, common);
85  ColumnUB = utilParam.GetSetting("ColumnUB", 1.e20, common);
86  ColumnLB = utilParam.GetSetting("ColumnLB", -1.e20, common);
87  ObjectiveSense= utilParam.GetSetting("ObjectiveSense", 1, common);
88  }
89 
90  void dumpSettings(ostream * os = &cout){
91  static const char * common = "MILPBlock";
92  (*os) << "\n=====================================================\n"
93  << "MILPBlock_DECOMP PARAMETER SETTINGS \n";
94  (*os) << common << ": LogLevel : " << LogLevel << endl;
95  (*os) << common << ": DataDir : " << DataDir << endl;
96  (*os) << common << ": Instance : " << Instance << endl;
97  (*os) << common << ": BlockFile : " << BlockFile << endl;
98  (*os) << common << ": PermuteFile : " << PermuteFile << endl;
99  (*os) << common << ": BlockFileFormat : " << BlockFileFormat << endl;
100  (*os) << common << ": InitSolutionFile : " << InitSolutionFile << endl;
101  (*os) << common << ": UseNames : " << UseNames << endl;
102  (*os) << common << ": UseSparse : " << UseSparse << endl;
103  (*os) << common << ": FullModel : " << FullModel << endl;
104  (*os) << common << ": BestKnownLB : " << BestKnownLB << endl;
105  (*os) << common << ": BestKnownUB : " << BestKnownUB << endl;
106  (*os) << common << ": ColumnUB : " << ColumnUB << endl;
107  (*os) << common << ": ColumnLB : " << ColumnLB << endl;
108  (*os) << common << ": ObjectiveSense : " << ObjectiveSense << endl;
109  (*os) << "\n=====================================================\n";
110  }
111 
112 public:
114  LogLevel (0 ),
115  DataDir (""),
116  Instance (""),
117  BlockFile (""),
118  BlockFileFormat (""),
119  PermuteFile (""),
120  InitSolutionFile(""),
121  UseNames (0),
122  UseSparse (1),
123  FullModel (0),
124  BestKnownLB (-1.e100),
125  BestKnownUB ( 1.e100),
126  ColumnUB ( 1.e20),
127  ColumnLB (-1.e20),
128  ObjectiveSense (1)
129 {};
131 };
132 
133 #endif
string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)
void getSettings(UtilParameters &utilParam)
void dumpSettings(ostream *os=&cout)
string BlockFileFormat
The format of BlockFile.