Cbc trunk
|
00001 /* 00002 Copyright (C) 2007, Lou Hafer, International Business Machines Corporation 00003 and others. All Rights Reserved. 00004 00005 This code is licensed under the terms of the Eclipse Public License (EPL). 00006 00007 $Id$ 00008 */ 00009 /* 00010 This file is part of cbc-generic. 00011 */ 00012 00013 #ifndef CbcGenParam_H 00014 #define CbcGenParam_H 00015 00016 /* \file CbcGenParam.hpp 00017 \brief Declarations for parameters that control the cbc-generic main 00018 program. 00019 */ 00020 00021 /* 00022 $Id: CbcGenParam.hpp 1173 2009-06-04 09:44:10Z forrest $ 00023 */ 00024 00025 class CbcGenCtlBlk ; 00026 00034 class CbcGenParam : public CoinParam { 00035 00036 public: 00037 00040 00049 typedef enum { CBCGEN_FIRSTPARAM = 0, 00050 00051 GENERALQUERY, FULLGENERALQUERY, HELP, 00052 BAB, CLEARCUTS, CLIQUECUTS, COMBINE, COSTSTRATEGY, 00053 CPP, CUTDEPTH, CUTSTRATEGY, 00054 DEBUG, DIRECTORY, DJFIX, DUMMY, 00055 ERRORSALLOWED, EXIT, EXPORT, 00056 FLOWCUTS, FPUMP, FPUMPITS, GOMORYCUTS, GREEDY, HEURISTICSTRATEGY, 00057 IMPORT, INTPRINT, KNAPSACKCUTS, LOCALTREE, LOGLEVEL, 00058 MESSAGES, MIPLIB, MIXEDCUTS, ODDHOLECUTS, OUTDUPROWS, OUTPUTFORMAT, 00059 PREPROCESS, PRINTMASK, PRINTOPTIONS, PRINTVERSION, PRIORITYIN, PROBINGCUTS, 00060 REDSPLITCUTS, ROUNDING, 00061 SOLUTION, SOLVECONTINUOUS, SOLVER, SOS, STDIN, STRENGTHEN, 00062 TIGHTENFACTOR, TWOMIRCUTS, 00063 UNITTEST, USERCBC, USESOLUTION, VERBOSE, SHOWUNIMP, 00064 00065 CBCGEN_LASTPARAM 00066 00067 } CbcGenParamCode ; 00068 00070 00079 CbcGenParam() ; 00080 00087 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 00088 double lower, double upper, double dflt = 0.0, 00089 bool display = true) ; 00090 00095 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 00096 int lower, int upper, int dflt = 0, 00097 bool display = true) ; 00098 00108 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 00109 std::string firstValue, int dflt, bool display = true) ; 00110 00117 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 00118 std::string dflt, bool display = true) ; 00119 00122 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 00123 bool display = true) ; 00124 00127 CbcGenParam(const CbcGenParam &orig) ; 00128 00131 CbcGenParam *clone() ; 00132 00135 CbcGenParam &operator=(const CbcGenParam &rhs) ; 00136 00139 ~CbcGenParam() ; 00140 00142 00145 00148 inline CbcGenParamCode paramCode() const { 00149 return (paramCode_) ; 00150 } 00151 00154 inline void setParamCode(CbcGenParamCode code) { 00155 paramCode_ = code ; 00156 } 00157 00160 inline CbcGenCtlBlk *obj() const { 00161 return (obj_) ; 00162 } 00163 00166 inline void setObj(CbcGenCtlBlk *obj) { 00167 obj_ = obj ; 00168 } 00169 00171 00172 00173 private: 00174 00177 00179 CbcGenParamCode paramCode_ ; 00180 00182 CbcGenCtlBlk *obj_ ; 00183 00185 00186 } ; 00187 00188 /* 00189 Declare the utility functions. 00190 */ 00191 00192 namespace CbcGenParamUtils { 00193 void addCbcGenParams(int &numParams, CoinParamVec ¶mVec, 00194 CbcGenCtlBlk *ctlBlk) ; 00195 void loadGenParamObj(const CoinParamVec paramVec, int first, int last, 00196 CbcGenCtlBlk *ctlBlk) ; 00197 00198 void saveSolution(const OsiSolverInterface *osi, std::string fileName) ; 00199 bool readSolution(std::string fileName, 00200 int &numRows, int &numCols, double &objVal, 00201 double **rowActivity, double **dualVars, 00202 double **primalVars, double **reducedCosts) ; 00203 00204 int doBaCParam(CoinParam *param) ; 00205 int doDebugParam(CoinParam *param) ; 00206 int doExitParam(CoinParam *param) ; 00207 int doHelpParam(CoinParam *param) ; 00208 int doImportParam(CoinParam *param) ; 00209 int doPrintMaskParam(CoinParam *param) ; 00210 int doNothingParam(CoinParam *param) ; 00211 int doSolutionParam(CoinParam *param) ; 00212 int doUnimplementedParam(CoinParam *param) ; 00213 int doVersionParam(CoinParam *param) ; 00214 00215 int pushCbcGenDblParam(CoinParam *param) ; 00216 int pushCbcGenIntParam(CoinParam *param) ; 00217 int pushCbcGenKwdParam(CoinParam *param) ; 00218 int pushCbcGenStrParam(CoinParam *param) ; 00219 00220 int pushCbcGenCutParam(CoinParam *param) ; 00221 } 00222 00223 00224 #endif