Cbc 2.10.11
Loading...
Searching...
No Matches
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$
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$
23*/
24
25class CbcGenCtlBlk;
26
34class CbcGenParam : public CoinParam {
35
36public:
39
48 typedef enum { CBCGEN_FIRSTPARAM = 0,
49
106
108
110
112
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
170
174
178
182
184
187
191 {
192 return (paramCode_);
193 }
194
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
218private:
221
224
227
229};
230
231/*
232 Declare the utility functions.
233*/
234
235namespace CbcGenParamUtils {
236void addCbcGenParams(int &numParams, CoinParamVec &paramVec,
237 CbcGenCtlBlk *ctlBlk);
238void loadGenParamObj(const CoinParamVec paramVec, int first, int last,
239 CbcGenCtlBlk *ctlBlk);
240
241void saveSolution(const OsiSolverInterface *osi, std::string fileName);
242bool readSolution(std::string fileName,
243 int &numRows, int &numCols, double &objVal,
244 double **rowActivity, double **dualVars,
245 double **primalVars, double **reducedCosts);
246
247int doBaCParam(CoinParam *param);
248int doDebugParam(CoinParam *param);
249int doExitParam(CoinParam *param);
250int doHelpParam(CoinParam *param);
251int doImportParam(CoinParam *param);
252int doPrintMaskParam(CoinParam *param);
253int doNothingParam(CoinParam *param);
254int doSolutionParam(CoinParam *param);
255int doUnimplementedParam(CoinParam *param);
256int doVersionParam(CoinParam *param);
257
258int pushCbcGenDblParam(CoinParam *param);
259int pushCbcGenIntParam(CoinParam *param);
260int pushCbcGenKwdParam(CoinParam *param);
261int pushCbcGenStrParam(CoinParam *param);
262
263int pushCbcGenCutParam(CoinParam *param);
264}
265
266#endif
267
268/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
269*/
Class for cbc-generic control parameters.
CbcGenParam(CbcGenParamCode code, std::string name, std::string help, int lower, int upper, int dflt=0, bool display=true)
Constructor for a parameter with an integer value.
CbcGenParam(CbcGenParamCode code, std::string name, std::string help, std::string firstValue, int dflt, bool display=true)
Constructor for a parameter with keyword values.
CbcGenParam(CbcGenParamCode code, std::string name, std::string help, bool display=true)
Constructor for an action parameter.
CbcGenParamCode paramCode_
Parameter code.
CbcGenParam()
Default constructor.
CbcGenParam(const CbcGenParam &orig)
Copy constructor.
CbcGenParam(CbcGenParamCode code, std::string name, std::string help, double lower, double upper, double dflt=0.0, bool display=true)
Constructor for a parameter with a double value.
CbcGenParamCode paramCode() const
Get the parameter code
CbcGenCtlBlk * obj_
cbc-generic control object
CbcGenParam(CbcGenParamCode code, std::string name, std::string help, std::string dflt, bool display=true)
Constructor for a string parameter.
void setParamCode(CbcGenParamCode code)
Set the parameter code.
CbcGenParamCode
Enumeration for cbc-generic parameters.
CbcGenParam & operator=(const CbcGenParam &rhs)
Assignment.
CbcGenCtlBlk * obj() const
Get the underlying cbc-generic control object.
~CbcGenParam()
Destructor.
CbcGenParam * clone()
Clone.
void setObj(CbcGenCtlBlk *obj)
Set the underlying cbc-generic control object.
int pushCbcGenCutParam(CoinParam *param)
void addCbcGenParams(int &numParams, CoinParamVec &paramVec, CbcGenCtlBlk *ctlBlk)
int doNothingParam(CoinParam *param)
int doUnimplementedParam(CoinParam *param)
int doBaCParam(CoinParam *param)
int doImportParam(CoinParam *param)
int pushCbcGenStrParam(CoinParam *param)
bool readSolution(std::string fileName, int &numRows, int &numCols, double &objVal, double **rowActivity, double **dualVars, double **primalVars, double **reducedCosts)
int doDebugParam(CoinParam *param)
int pushCbcGenIntParam(CoinParam *param)
int doSolutionParam(CoinParam *param)
int doHelpParam(CoinParam *param)
void loadGenParamObj(const CoinParamVec paramVec, int first, int last, CbcGenCtlBlk *ctlBlk)
void saveSolution(const OsiSolverInterface *osi, std::string fileName)
int doVersionParam(CoinParam *param)
int pushCbcGenKwdParam(CoinParam *param)
int pushCbcGenDblParam(CoinParam *param)
int doPrintMaskParam(CoinParam *param)
int doExitParam(CoinParam *param)