CbcGenParam.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2007, Lou Hafer, International Business Machines Corporation
3  and others. All Rights Reserved.
4 
5  This file is part of cbc-generic.
6 */
7 
8 #ifndef CbcGenParam_H
9 #define CbcGenParam_H
10 
11 /* \file CbcGenParam.hpp
12  \brief Declarations for parameters that control the cbc-generic main
13  program.
14 */
15 
16 /*
17  $Id: CbcGenParam.hpp 1173 2009-06-04 09:44:10Z forrest $
18 */
19 
20 class CbcGenCtlBlk ;
21 
29 class CbcGenParam : public CoinParam {
30 
31 public:
32 
35 
44  typedef enum { CBCGEN_FIRSTPARAM = 0,
45 
59 
61 
62  } CbcGenParamCode ;
63 
65 
74  CbcGenParam() ;
75 
82  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
83  double lower, double upper, double dflt = 0.0,
84  bool display = true) ;
85 
90  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
91  int lower, int upper, int dflt = 0,
92  bool display = true) ;
93 
103  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
104  std::string firstValue, int dflt, bool display = true) ;
105 
112  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
113  std::string dflt, bool display = true) ;
114 
117  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
118  bool display = true) ;
119 
122  CbcGenParam(const CbcGenParam &orig) ;
123 
126  CbcGenParam *clone() ;
127 
130  CbcGenParam &operator=(const CbcGenParam &rhs) ;
131 
134  ~CbcGenParam() ;
135 
137 
140 
143  inline CbcGenParamCode paramCode() const {
144  return (paramCode_) ;
145  }
146 
149  inline void setParamCode(CbcGenParamCode code) {
150  paramCode_ = code ;
151  }
152 
155  inline CbcGenCtlBlk *obj() const {
156  return (obj_) ;
157  }
158 
161  inline void setObj(CbcGenCtlBlk *obj) {
162  obj_ = obj ;
163  }
164 
166 
167 
168 private:
169 
172 
175 
178 
180 
181 } ;
182 
183 /*
184  Declare the utility functions.
185 */
186 
187 namespace CbcGenParamUtils {
188 void addCbcGenParams(int &numParams, CoinParamVec &paramVec,
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) ;
216 }
217 
218 
219 #endif