Cbc  2.10.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 code is licensed under the terms of the Eclipse Public License (EPL).
6 
7  $Id: CbcGenParam.hpp 2465 2019-01-03 19:26:52Z unxusr $
8 */
9 /*
10  This file is part of cbc-generic.
11 */
12 
13 #ifndef CbcGenParam_H
14 #define CbcGenParam_H
15 
16 /* \file CbcGenParam.hpp
17  \brief Declarations for parameters that control the cbc-generic main
18  program.
19 */
20 
21 /*
22  $Id: CbcGenParam.hpp 2465 2019-01-03 19:26:52Z unxusr $
23 */
24 
25 class CbcGenCtlBlk;
26 
34 class CbcGenParam : public CoinParam {
35 
36 public:
39 
48  typedef enum { CBCGEN_FIRSTPARAM = 0,
49 
53  BAB,
58  CPP,
96  SOS,
106 
108 
109  } CbcGenParamCode;
110 
112 
121  CbcGenParam();
122 
129  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
130  double lower, double upper, double dflt = 0.0,
131  bool display = true);
132 
137  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
138  int lower, int upper, int dflt = 0,
139  bool display = true);
140 
150  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
151  std::string firstValue, int dflt, bool display = true);
152 
159  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
160  std::string dflt, bool display = true);
161 
164  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
165  bool display = true);
166 
169  CbcGenParam(const CbcGenParam &orig);
170 
173  CbcGenParam *clone();
174 
177  CbcGenParam &operator=(const CbcGenParam &rhs);
178 
181  ~CbcGenParam();
182 
184 
187 
190  inline CbcGenParamCode paramCode() const
191  {
192  return (paramCode_);
193  }
194 
197  inline void setParamCode(CbcGenParamCode code)
198  {
199  paramCode_ = code;
200  }
201 
204  inline CbcGenCtlBlk *obj() const
205  {
206  return (obj_);
207  }
208 
211  inline void setObj(CbcGenCtlBlk *obj)
212  {
213  obj_ = obj;
214  }
215 
217 
218 private:
221 
224 
227 
229 };
230 
231 /*
232  Declare the utility functions.
233 */
234 
235 namespace CbcGenParamUtils {
236 void addCbcGenParams(int &numParams, CoinParamVec &paramVec,
237  CbcGenCtlBlk *ctlBlk);
238 void loadGenParamObj(const CoinParamVec paramVec, int first, int last,
239  CbcGenCtlBlk *ctlBlk);
240 
241 void saveSolution(const OsiSolverInterface *osi, std::string fileName);
242 bool readSolution(std::string fileName,
243  int &numRows, int &numCols, double &objVal,
244  double **rowActivity, double **dualVars,
245  double **primalVars, double **reducedCosts);
246 
247 int doBaCParam(CoinParam *param);
248 int doDebugParam(CoinParam *param);
249 int doExitParam(CoinParam *param);
250 int doHelpParam(CoinParam *param);
251 int doImportParam(CoinParam *param);
252 int doPrintMaskParam(CoinParam *param);
253 int doNothingParam(CoinParam *param);
254 int doSolutionParam(CoinParam *param);
255 int doUnimplementedParam(CoinParam *param);
256 int doVersionParam(CoinParam *param);
257 
258 int pushCbcGenDblParam(CoinParam *param);
259 int pushCbcGenIntParam(CoinParam *param);
260 int pushCbcGenKwdParam(CoinParam *param);
261 int pushCbcGenStrParam(CoinParam *param);
262 
263 int pushCbcGenCutParam(CoinParam *param);
264 }
265 
266 #endif
267 
268 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
269 */
int pushCbcGenDblParam(CoinParam *param)
CbcGenParam & operator=(const CbcGenParam &rhs)
Assignment.
int pushCbcGenStrParam(CoinParam *param)
~CbcGenParam()
Destructor.
CbcGenParam * clone()
Clone.
CbcGenParam()
Default constructor.
A base class for `keyword value' command line parameters.
Definition: CoinParam.hpp:75
int doUnimplementedParam(CoinParam *param)
int doPrintMaskParam(CoinParam *param)
void setObj(CbcGenCtlBlk *obj)
Set the underlying cbc-generic control object.
Abstract Base Class for describing an interface to a solver.
void saveSolution(const OsiSolverInterface *osi, std::string fileName)
std::string name() const
Return the parameter keyword (name) string.
Definition: CoinParam.hpp:298
int doSolutionParam(CoinParam *param)
int doNothingParam(CoinParam *param)
CbcGenParamCode paramCode() const
Get the parameter code.
Class for cbc-generic control parameters.
Definition: CbcGenParam.hpp:34
int doDebugParam(CoinParam *param)
bool readSolution(std::string fileName, int &numRows, int &numCols, double &objVal, double **rowActivity, double **dualVars, double **primalVars, double **reducedCosts)
int pushCbcGenKwdParam(CoinParam *param)
bool display() const
Get visibility of parameter.
Definition: CoinParam.hpp:335
CbcGenCtlBlk * obj_
cbc-generic control object
CbcGenParamCode paramCode_
Parameter code.
int doVersionParam(CoinParam *param)
void setParamCode(CbcGenParamCode code)
Set the parameter code.
CbcGenCtlBlk * obj() const
Get the underlying cbc-generic control object.
void addCbcGenParams(int &numParams, CoinParamVec &paramVec, CbcGenCtlBlk *ctlBlk)
void loadGenParamObj(const CoinParamVec paramVec, int first, int last, CbcGenCtlBlk *ctlBlk)
int pushCbcGenIntParam(CoinParam *param)
CbcGenParamCode
Enumeration for cbc-generic parameters.
Definition: CbcGenParam.hpp:48
int doBaCParam(CoinParam *param)
int doExitParam(CoinParam *param)
int doImportParam(CoinParam *param)
int pushCbcGenCutParam(CoinParam *param)
int doHelpParam(CoinParam *param)