source: trunk/Cbc/src/CbcGenParam.hpp

Last change on this file was 2465, checked in by unxusr, 10 months ago

script to format sources

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.9 KB
Line 
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
25class CbcGenCtlBlk;
26
27/*! \class CbcGenParam
28    \brief Class for cbc-generic control parameters
29
30    Adds parameter type codes and push/pull functions to the generic parameter
31    object.
32*/
33
34class CbcGenParam : public CoinParam {
35
36public:
37  /*! \name Subtypes */
38  //@{
39
40  /*! \enum CbcGenParamCode
41        \brief Enumeration for cbc-generic parameters
42
43      These are parameters that control the operation of the cbc-generic main
44      program by operating on a CbcGenCtlBlk object. CBCGEN_FIRSTPARAM and
45      CBCGEN_LASTPARM are markers to allow convenient separation of parameter
46      groups.
47    */
48  typedef enum { CBCGEN_FIRSTPARAM = 0,
49
50    GENERALQUERY,
51    FULLGENERALQUERY,
52    HELP,
53    BAB,
54    CLEARCUTS,
55    CLIQUECUTS,
56    COMBINE,
57    COSTSTRATEGY,
58    CPP,
59    CUTDEPTH,
60    CUTSTRATEGY,
61    DEBUG,
62    DIRECTORY,
63    DJFIX,
64    DUMMY,
65    ERRORSALLOWED,
66    EXIT,
67    EXPORT,
68    FLOWCUTS,
69    FPUMP,
70    FPUMPITS,
71    GOMORYCUTS,
72    GREEDY,
73    HEURISTICSTRATEGY,
74    IMPORT,
75    INTPRINT,
76    KNAPSACKCUTS,
77    LOCALTREE,
78    LOGLEVEL,
79    MESSAGES,
80    MIPLIB,
81    MIXEDCUTS,
82    ODDHOLECUTS,
83    OUTDUPROWS,
84    OUTPUTFORMAT,
85    PREPROCESS,
86    PRINTMASK,
87    PRINTOPTIONS,
88    PRINTVERSION,
89    PRIORITYIN,
90    PROBINGCUTS,
91    REDSPLITCUTS,
92    ROUNDING,
93    SOLUTION,
94    SOLVECONTINUOUS,
95    SOLVER,
96    SOS,
97    STDIN,
98    STRENGTHEN,
99    TIGHTENFACTOR,
100    TWOMIRCUTS,
101    UNITTEST,
102    USERCBC,
103    USESOLUTION,
104    VERBOSE,
105    SHOWUNIMP,
106
107    CBCGEN_LASTPARAM
108
109  } CbcGenParamCode;
110
111  //@}
112
113  /*! \name Constructors and Destructors
114
115      Be careful how you specify parameters for the constructors! There's great
116      potential for confusion.
117    */
118  //@{
119  /*! \brief Default constructor */
120
121  CbcGenParam();
122
123  /*! \brief Constructor for a parameter with a double value
124
125      The default value is 0.0. Be careful to clearly indicate that \p lower and
126      \p upper are real (double) values to distinguish this constructor from the
127      constructor for an integer parameter.
128    */
129  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
130    double lower, double upper, double dflt = 0.0,
131    bool display = true);
132
133  /*! \brief Constructor for a parameter with an integer value
134
135      The default value is 0.
136    */
137  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
138    int lower, int upper, int dflt = 0,
139    bool display = true);
140
141  /*! \brief Constructor for a parameter with keyword values
142
143      The string supplied as \p firstValue becomes the first keyword.
144      Additional keywords can be added using appendKwd(). Keywords are numbered
145      from zero. It's necessary to specify both the first keyword (\p
146      firstValue) and the default keyword index (\p dflt) in order to
147      distinguish this constructor from the string and action parameter
148      constructors.
149    */
150  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
151    std::string firstValue, int dflt, bool display = true);
152
153  /*! \brief Constructor for a string parameter
154
155      The default string value must be specified explicitly to distinguish
156      a string constructor from an action parameter constructor.
157    */
158
159  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
160    std::string dflt, bool display = true);
161
162  /*! \brief Constructor for an action parameter */
163
164  CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
165    bool display = true);
166
167  /*! \brief Copy constructor */
168
169  CbcGenParam(const CbcGenParam &orig);
170
171  /*! \brief Clone */
172
173  CbcGenParam *clone();
174
175  /*! \brief Assignment */
176
177  CbcGenParam &operator=(const CbcGenParam &rhs);
178
179  /*! \brief  Destructor */
180
181  ~CbcGenParam();
182
183  //@}
184
185  /*! \name Methods to query and manipulate a parameter object */
186  //@{
187
188  /*! \brief Get the parameter code  */
189
190  inline CbcGenParamCode paramCode() const
191  {
192    return (paramCode_);
193  }
194
195  /*! \brief Set the parameter code */
196
197  inline void setParamCode(CbcGenParamCode code)
198  {
199    paramCode_ = code;
200  }
201
202  /*! \brief Get the underlying cbc-generic control object */
203
204  inline CbcGenCtlBlk *obj() const
205  {
206    return (obj_);
207  }
208
209  /*! \brief Set the underlying cbc-generic control object */
210
211  inline void setObj(CbcGenCtlBlk *obj)
212  {
213    obj_ = obj;
214  }
215
216  //@}
217
218private:
219  /*! \name Data */
220  //@{
221
222  /// Parameter code
223  CbcGenParamCode paramCode_;
224
225  /// cbc-generic control object
226  CbcGenCtlBlk *obj_;
227
228  //@}
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*/
Note: See TracBrowser for help on using the repository browser.