Changeset 1286 for branches/sandbox/Cbc/src/CbcGenParam.hpp
- Timestamp:
- Nov 9, 2009 6:33:07 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sandbox/Cbc/src/CbcGenParam.hpp
r1271 r1286 27 27 */ 28 28 29 class CbcGenParam : public CoinParam 30 { 29 class CbcGenParam : public CoinParam { 31 30 32 31 public: 33 32 34 /*! \name Subtypes */ 35 //@{ 36 37 /*! \enum CbcGenParamCode 38 \brief Enumeration for cbc-generic parameters 39 40 These are parameters that control the operation of the cbc-generic main 41 program by operating on a CbcGenCtlBlk object. CBCGEN_FIRSTPARAM and 42 CBCGEN_LASTPARM are markers to allow convenient separation of parameter 43 groups. 44 */ 45 typedef enum 46 { CBCGEN_FIRSTPARAM = 0, 47 48 GENERALQUERY, FULLGENERALQUERY, HELP, 49 BAB, CLEARCUTS, CLIQUECUTS, COMBINE, COSTSTRATEGY, 50 CPP, CUTDEPTH, CUTSTRATEGY, 51 DEBUG, DIRECTORY, DJFIX, DUMMY, 52 ERRORSALLOWED, EXIT, EXPORT, 53 FLOWCUTS, FPUMP, FPUMPITS, GOMORYCUTS, GREEDY, HEURISTICSTRATEGY, 54 IMPORT, INTPRINT, KNAPSACKCUTS, LOCALTREE, LOGLEVEL, 55 MESSAGES, MIPLIB, MIXEDCUTS, ODDHOLECUTS, OUTDUPROWS, OUTPUTFORMAT, 56 PREPROCESS, PRINTMASK, PRINTOPTIONS, PRINTVERSION, PRIORITYIN, PROBINGCUTS, 57 REDSPLITCUTS, ROUNDING, 58 SOLUTION, SOLVECONTINUOUS, SOLVER, SOS, STDIN, STRENGTHEN, 59 TIGHTENFACTOR, TWOMIRCUTS, 60 UNITTEST, USERCBC, USESOLUTION, VERBOSE, SHOWUNIMP, 61 62 CBCGEN_LASTPARAM 63 64 } CbcGenParamCode ; 65 66 //@} 67 68 /*! \name Constructors and Destructors 69 70 Be careful how you specify parameters for the constructors! There's great 71 potential for confusion. 72 */ 73 //@{ 74 /*! \brief Default constructor */ 75 76 CbcGenParam() ; 77 78 /*! \brief Constructor for a parameter with a double value 79 80 The default value is 0.0. Be careful to clearly indicate that \p lower and 81 \p upper are real (double) values to distinguish this constructor from the 82 constructor for an integer parameter. 83 */ 84 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 85 double lower, double upper, double dflt = 0.0, 86 bool display = true) ; 87 88 /*! \brief Constructor for a parameter with an integer value 89 90 The default value is 0. 91 */ 92 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 93 int lower, int upper, int dflt = 0, 94 bool display = true) ; 95 96 /*! \brief Constructor for a parameter with keyword values 97 98 The string supplied as \p firstValue becomes the first keyword. 99 Additional keywords can be added using appendKwd(). Keywords are numbered 100 from zero. It's necessary to specify both the first keyword (\p 101 firstValue) and the default keyword index (\p dflt) in order to 102 distinguish this constructor from the string and action parameter 103 constructors. 104 */ 105 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 106 std::string firstValue, int dflt, bool display = true) ; 107 108 /*! \brief Constructor for a string parameter 109 110 The default string value must be specified explicitly to distinguish 111 a string constructor from an action parameter constructor. 112 */ 113 114 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 115 std::string dflt, bool display = true) ; 116 117 /*! \brief Constructor for an action parameter */ 118 119 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 120 bool display = true) ; 121 122 /*! \brief Copy constructor */ 123 124 CbcGenParam(const CbcGenParam &orig) ; 125 126 /*! \brief Clone */ 127 128 CbcGenParam *clone() ; 129 130 /*! \brief Assignment */ 131 132 CbcGenParam &operator=(const CbcGenParam &rhs) ; 133 134 /*! \brief Destructor */ 135 136 ~CbcGenParam() ; 137 138 //@} 139 140 /*! \name Methods to query and manipulate a parameter object */ 141 //@{ 142 143 /*! \brief Get the parameter code */ 144 145 inline CbcGenParamCode paramCode() const { return (paramCode_) ; } 146 147 /*! \brief Set the parameter code */ 148 149 inline void setParamCode(CbcGenParamCode code) { paramCode_ = code ; } 150 151 /*! \brief Get the underlying cbc-generic control object */ 152 153 inline CbcGenCtlBlk *obj() const { return (obj_) ; } 154 155 /*! \brief Set the underlying cbc-generic control object */ 156 157 inline void setObj(CbcGenCtlBlk *obj) { obj_ = obj ; } 33 /*! \name Subtypes */ 34 //@{ 35 36 /*! \enum CbcGenParamCode 37 \brief Enumeration for cbc-generic parameters 38 39 These are parameters that control the operation of the cbc-generic main 40 program by operating on a CbcGenCtlBlk object. CBCGEN_FIRSTPARAM and 41 CBCGEN_LASTPARM are markers to allow convenient separation of parameter 42 groups. 43 */ 44 typedef enum { CBCGEN_FIRSTPARAM = 0, 45 46 GENERALQUERY, FULLGENERALQUERY, HELP, 47 BAB, CLEARCUTS, CLIQUECUTS, COMBINE, COSTSTRATEGY, 48 CPP, CUTDEPTH, CUTSTRATEGY, 49 DEBUG, DIRECTORY, DJFIX, DUMMY, 50 ERRORSALLOWED, EXIT, EXPORT, 51 FLOWCUTS, FPUMP, FPUMPITS, GOMORYCUTS, GREEDY, HEURISTICSTRATEGY, 52 IMPORT, INTPRINT, KNAPSACKCUTS, LOCALTREE, LOGLEVEL, 53 MESSAGES, MIPLIB, MIXEDCUTS, ODDHOLECUTS, OUTDUPROWS, OUTPUTFORMAT, 54 PREPROCESS, PRINTMASK, PRINTOPTIONS, PRINTVERSION, PRIORITYIN, PROBINGCUTS, 55 REDSPLITCUTS, ROUNDING, 56 SOLUTION, SOLVECONTINUOUS, SOLVER, SOS, STDIN, STRENGTHEN, 57 TIGHTENFACTOR, TWOMIRCUTS, 58 UNITTEST, USERCBC, USESOLUTION, VERBOSE, SHOWUNIMP, 59 60 CBCGEN_LASTPARAM 61 62 } CbcGenParamCode ; 63 64 //@} 65 66 /*! \name Constructors and Destructors 67 68 Be careful how you specify parameters for the constructors! There's great 69 potential for confusion. 70 */ 71 //@{ 72 /*! \brief Default constructor */ 73 74 CbcGenParam() ; 75 76 /*! \brief Constructor for a parameter with a double value 77 78 The default value is 0.0. Be careful to clearly indicate that \p lower and 79 \p upper are real (double) values to distinguish this constructor from the 80 constructor for an integer parameter. 81 */ 82 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 83 double lower, double upper, double dflt = 0.0, 84 bool display = true) ; 85 86 /*! \brief Constructor for a parameter with an integer value 87 88 The default value is 0. 89 */ 90 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 91 int lower, int upper, int dflt = 0, 92 bool display = true) ; 93 94 /*! \brief Constructor for a parameter with keyword values 95 96 The string supplied as \p firstValue becomes the first keyword. 97 Additional keywords can be added using appendKwd(). Keywords are numbered 98 from zero. It's necessary to specify both the first keyword (\p 99 firstValue) and the default keyword index (\p dflt) in order to 100 distinguish this constructor from the string and action parameter 101 constructors. 102 */ 103 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 104 std::string firstValue, int dflt, bool display = true) ; 105 106 /*! \brief Constructor for a string parameter 107 108 The default string value must be specified explicitly to distinguish 109 a string constructor from an action parameter constructor. 110 */ 111 112 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 113 std::string dflt, bool display = true) ; 114 115 /*! \brief Constructor for an action parameter */ 116 117 CbcGenParam(CbcGenParamCode code, std::string name, std::string help, 118 bool display = true) ; 119 120 /*! \brief Copy constructor */ 121 122 CbcGenParam(const CbcGenParam &orig) ; 123 124 /*! \brief Clone */ 125 126 CbcGenParam *clone() ; 127 128 /*! \brief Assignment */ 129 130 CbcGenParam &operator=(const CbcGenParam &rhs) ; 131 132 /*! \brief Destructor */ 133 134 ~CbcGenParam() ; 135 136 //@} 137 138 /*! \name Methods to query and manipulate a parameter object */ 139 //@{ 140 141 /*! \brief Get the parameter code */ 142 143 inline CbcGenParamCode paramCode() const { 144 return (paramCode_) ; 145 } 146 147 /*! \brief Set the parameter code */ 148 149 inline void setParamCode(CbcGenParamCode code) { 150 paramCode_ = code ; 151 } 152 153 /*! \brief Get the underlying cbc-generic control object */ 154 155 inline CbcGenCtlBlk *obj() const { 156 return (obj_) ; 157 } 158 159 /*! \brief Set the underlying cbc-generic control object */ 160 161 inline void setObj(CbcGenCtlBlk *obj) { 162 obj_ = obj ; 163 } 158 164 159 165 //@} … … 162 168 private: 163 169 164 /*! \name Data */165 //@{ 166 167 /// Parameter code168 CbcGenParamCode paramCode_ ;169 170 /// cbc-generic control object171 CbcGenCtlBlk *obj_ ;170 /*! \name Data */ 171 //@{ 172 173 /// Parameter code 174 CbcGenParamCode paramCode_ ; 175 176 /// cbc-generic control object 177 CbcGenCtlBlk *obj_ ; 172 178 173 179 //@} … … 179 185 */ 180 186 181 namespace CbcGenParamUtils 182 {void addCbcGenParams(int &numParams, CoinParamVec ¶mVec,183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 187 namespace CbcGenParamUtils { 188 void addCbcGenParams(int &numParams, CoinParamVec ¶mVec, 189 CbcGenCtlBlk *ctlBlk) ; 190 void loadGenParamObj(const CoinParamVec paramVec, int first, int last, 191 CbcGenCtlBlk *ctlBlk) ; 192 193 void saveSolution(const OsiSolverInterface *osi, std::string fileName) ; 194 bool readSolution(std::string fileName, 195 int &numRows, int &numCols, double &objVal, 196 double **rowActivity, double **dualVars, 197 double **primalVars, double **reducedCosts) ; 198 199 int doBaCParam(CoinParam *param) ; 200 int doDebugParam(CoinParam *param) ; 201 int doExitParam(CoinParam *param) ; 202 int doHelpParam(CoinParam *param) ; 203 int doImportParam(CoinParam *param) ; 204 int doPrintMaskParam(CoinParam *param) ; 205 int doNothingParam(CoinParam *param) ; 206 int doSolutionParam(CoinParam *param) ; 207 int doUnimplementedParam(CoinParam *param) ; 208 int doVersionParam(CoinParam *param) ; 209 210 int pushCbcGenDblParam(CoinParam *param) ; 211 int pushCbcGenIntParam(CoinParam *param) ; 212 int pushCbcGenKwdParam(CoinParam *param) ; 213 int pushCbcGenStrParam(CoinParam *param) ; 214 215 int pushCbcGenCutParam(CoinParam *param) ; 210 216 } 211 217
Note: See TracChangeset
for help on using the changeset viewer.