Cbc  2.9.9
 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 1899 2013-04-09 18:12:08Z stefan $
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 1899 2013-04-09 18:12:08Z stefan $
23 */
24 
25 class CbcGenCtlBlk ;
26 
34 class CbcGenParam : public CoinParam {
35 
36 public:
37 
40 
49  typedef enum { CBCGEN_FIRSTPARAM = 0,
50 
64 
66 
67  } CbcGenParamCode ;
68 
70 
79  CbcGenParam() ;
80 
87  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
88  double lower, double upper, double dflt = 0.0,
89  bool display = true) ;
90 
95  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
96  int lower, int upper, int dflt = 0,
97  bool display = true) ;
98 
108  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
109  std::string firstValue, int dflt, bool display = true) ;
110 
117  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
118  std::string dflt, bool display = true) ;
119 
122  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
123  bool display = true) ;
124 
127  CbcGenParam(const CbcGenParam &orig) ;
128 
131  CbcGenParam *clone() ;
132 
135  CbcGenParam &operator=(const CbcGenParam &rhs) ;
136 
139  ~CbcGenParam() ;
140 
142 
145 
148  inline CbcGenParamCode paramCode() const {
149  return (paramCode_) ;
150  }
151 
154  inline void setParamCode(CbcGenParamCode code) {
155  paramCode_ = code ;
156  }
157 
160  inline CbcGenCtlBlk *obj() const {
161  return (obj_) ;
162  }
163 
166  inline void setObj(CbcGenCtlBlk *obj) {
167  obj_ = obj ;
168  }
169 
171 
172 
173 private:
174 
177 
180 
183 
185 
186 } ;
187 
188 /*
189  Declare the utility functions.
190 */
191 
192 namespace CbcGenParamUtils {
193 void addCbcGenParams(int &numParams, CoinParamVec &paramVec,
194  CbcGenCtlBlk *ctlBlk) ;
195 void loadGenParamObj(const CoinParamVec paramVec, int first, int last,
196  CbcGenCtlBlk *ctlBlk) ;
197 
198 void saveSolution(const OsiSolverInterface *osi, std::string fileName) ;
199 bool readSolution(std::string fileName,
200  int &numRows, int &numCols, double &objVal,
201  double **rowActivity, double **dualVars,
202  double **primalVars, double **reducedCosts) ;
203 
204 int doBaCParam(CoinParam *param) ;
205 int doDebugParam(CoinParam *param) ;
206 int doExitParam(CoinParam *param) ;
207 int doHelpParam(CoinParam *param) ;
208 int doImportParam(CoinParam *param) ;
209 int doPrintMaskParam(CoinParam *param) ;
210 int doNothingParam(CoinParam *param) ;
211 int doSolutionParam(CoinParam *param) ;
212 int doUnimplementedParam(CoinParam *param) ;
213 int doVersionParam(CoinParam *param) ;
214 
215 int pushCbcGenDblParam(CoinParam *param) ;
216 int pushCbcGenIntParam(CoinParam *param) ;
217 int pushCbcGenKwdParam(CoinParam *param) ;
218 int pushCbcGenStrParam(CoinParam *param) ;
219 
220 int pushCbcGenCutParam(CoinParam *param) ;
221 }
222 
223 
224 #endif
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:301
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:334
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:49
int doBaCParam(CoinParam *param)
int doExitParam(CoinParam *param)
int doImportParam(CoinParam *param)
int pushCbcGenCutParam(CoinParam *param)
int doHelpParam(CoinParam *param)