MCF_Param.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the Decomp Solver Framework.                         //
00003 //                                                                           //
00004 // Decomp is distributed under the Common Public License as part of the      //
00005 // COIN-OR repository (http://www.coin-or.org).                              //
00006 //                                                                           //
00007 // Author: Matthew Galati, Lehigh University                                 //
00008 //                                                                           //
00009 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, and Ted Ralphs//
00010 // All Rights Reserved.                                                      //
00011 //===========================================================================//
00012 
00013 #ifndef MCF_PARAM_INCLUDED
00014 #define MCF_PARAM_INCLUDED
00015 
00016 //===========================================================================//
00017 #include "UtilMacros.h"
00018 #include "UtilMacrosDecomp.h"
00019 #include "UtilParameters.h"
00020 //===========================================================================//
00021 
00022 //===========================================================================//
00029 //===========================================================================//
00030 class MCF_Param {
00031 public:
00032    int    LogLevel;           //application log level
00033    int    UseSparse;          //use sparse version of relaxations
00034    string DataDir;            //data directory
00035    string Instance;           //name of instance
00036 
00037 public:
00038    void getSettings(UtilParameters& utilParam) {
00039       static const char* common = "MCF";
00040       LogLevel       = utilParam.GetSetting("LogLevel",        0,      common);
00041       UseSparse      = utilParam.GetSetting("UseSparse",       0,      common);
00042       DataDir        = utilParam.GetSetting("DataDir",        "",      common);
00043       Instance       = utilParam.GetSetting("Instance",       "",      common);
00044 
00045       if (!checkOptions()) {
00046          throw UtilException("Bad Parameter", "getSettings", "MCF_Param");
00047       }
00048    }
00049 
00050    bool checkOptions() {
00051       bool optionsOk = true;
00052       return optionsOk;
00053    }
00054 
00055    void dumpSettings(ostream* os = &cout) {
00056       static const char* common = "MCF";
00057       (*os) << "\n=====================================================\n"
00058             << "MCF_DECOMP PARAMETER SETTINGS \n";
00059       (*os) << common << ": LogLevel          : " << LogLevel      << endl;
00060       (*os) << common << ": UseSparse         : " << UseSparse     << endl;
00061       (*os) << common << ": DataDir           : " << DataDir       << endl;
00062       (*os) << common << ": Instance          : " << Instance      << endl;
00063       (*os) <<   "=====================================================\n";
00064    }
00065 
00066 public:
00067    MCF_Param() :
00068       LogLevel          (0),
00069       UseSparse         (0),
00070       DataDir           (""),
00071       Instance          ("") {
00072    }
00073    ~MCF_Param() {};
00074 };
00075 
00076 #endif

Generated on 5 Apr 2015 for Dip-All by  doxygen 1.6.1