source: trunk/Cbc/src/CbcGenOsiParam.hpp

Last change on this file was 2465, checked in by unxusr, 6 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.3 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: CbcGenOsiParam.hpp 2465 2019-01-03 19:26:52Z tkr $
8*/
9/*
10  This file is part of cbc-generic.
11*/
12
13#ifndef CbcOsiParam_H
14#define CbcOsiParam_H
15
16/* \file CbcGenOsiParam.hpp
17   \brief Declarations for parameters that act on a OsiSolverInterface object.
18*/
19
20/*
21  $Id: CbcGenOsiParam.hpp 2465 2019-01-03 19:26:52Z tkr $
22*/
23
24/*! \class CbcOsiParam
25    \brief Class for control parameters that act on a OsiSolverInterface object.
26
27    Adds parameter type codes and push/pull functions to the generic parameter
28    object.
29*/
30
31class CbcOsiParam : public CoinParam {
32
33public:
34  /*! \name Subtypes */
35  //@{
36
37  /*! \enum CbcOsiParamCode
38        \brief Enumeration for parameters that control an OsiSolverInterface
39           object
40
41      These are parameters that control the operation of an OsiSolverInterface
42      object. CBCOSI_FIRSTPARAM and CBCOSI_LASTPARAM are markers to allow
43      convenient separation of parameter groups.
44    */
45  typedef enum { CBCOSI_FIRSTPARAM = CbcCbcParam::CBCCBC_LASTPARAM + 1,
46
47    ALGORITHM,
48    ALLSLACK,
49    AUTOSCALE,
50    BARRIER,
51    BARRIERSCALE,
52    BASISIN,
53    BASISOUT,
54    BIASLU,
55    CHOLESKY,
56    CRASH,
57    CROSSOVER,
58    DUALBOUND,
59    DUALPIVOT,
60    DUALSIMPLEX,
61    DUALTOLERANCE,
62    FAKEBOUND,
63    GAMMA,
64    IDIOT,
65    KEEPNAMES,
66    KKT,
67    MAXITERATION,
68    MAXHOTITS,
69    NETLIB_BARRIER,
70    NETLIB_DUAL,
71    NETLIB_PRIMAL,
72    NETWORK,
73    OBJSCALE,
74    PERTURBATION,
75    PERTVALUE,
76    PFI,
77    PLUSMINUS,
78    PRESOLVE,
79    PRESOLVEOPTIONS,
80    PRESOLVEPASS,
81    PRIMALPIVOT,
82    PRIMALSIMPLEX,
83    PRIMALTOLERANCE,
84    REALLY_SCALE,
85    RESTORE,
86    REVERSE,
87    RHSSCALE,
88    SAVE,
89    SCALING,
90    SLPVALUE,
91    SOLVERLOGLEVEL,
92    SPARSEFACTOR,
93    SPECIALOPTIONS,
94    SPRINT,
95    TIGHTEN,
96
97    CBCOSI_LASTPARAM
98
99  } CbcOsiParamCode;
100
101  //@}
102
103  /*! \name Constructors and Destructors
104
105      Be careful how you specify parameters for the constructors! There's great
106      potential for confusion.
107    */
108  //@{
109  /*! \brief Default constructor */
110
111  CbcOsiParam();
112
113  /*! \brief Constructor for a parameter with a double value
114
115      The default value is 0.0. Be careful to clearly indicate that \p lower and
116      \p upper are real (double) values to distinguish this constructor from the
117      constructor for an integer parameter.
118    */
119  CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
120    double lower, double upper, double dflt = 0.0,
121    bool display = true);
122
123  /*! \brief Constructor for a parameter with an integer value
124
125      The default value is 0.
126    */
127  CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
128    int lower, int upper, int dflt = 0,
129    bool display = true);
130
131  /*! \brief Constructor for a parameter with keyword values
132
133      The string supplied as \p firstValue becomes the first keyword.
134      Additional keywords can be added using appendKwd(). Keywords are numbered
135      from zero. It's necessary to specify both the first keyword (\p
136      firstValue) and the default keyword index (\p dflt) in order to
137      distinguish this constructor from the string and action parameter
138      constructors.
139    */
140  CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
141    std::string firstValue, int dflt, bool display = true);
142
143  /*! \brief Constructor for a string parameter
144
145      The default string value must be specified explicitly to distinguish
146      a string constructor from an action parameter constructor.
147    */
148
149  CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
150    std::string dflt, bool display = true);
151
152  /*! \brief Constructor for an action parameter */
153
154  CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
155    bool display = true);
156
157  /*! \brief Copy constructor */
158
159  CbcOsiParam(const CbcOsiParam &orig);
160
161  /*! \brief Clone */
162
163  CbcOsiParam *clone();
164
165  /*! \brief Assignment */
166
167  CbcOsiParam &operator=(const CbcOsiParam &rhs);
168
169  /*! \brief  Destructor */
170
171  ~CbcOsiParam();
172
173  //@}
174
175  /*! \name Methods to query and manipulate a parameter object */
176  //@{
177
178  /*! \brief Get the parameter code  */
179
180  inline CbcOsiParamCode paramCode() const
181  {
182    return (paramCode_);
183  }
184
185  /*! \brief Set the parameter code */
186
187  inline void setParamCode(CbcOsiParamCode code)
188  {
189    paramCode_ = code;
190  }
191
192  /*! \brief Get the underlying OsiSolverInterface object */
193
194  inline OsiSolverInterface *obj() const
195  {
196    return (obj_);
197  }
198
199  /*! \brief Set the underlying OsiSolverInterace object */
200
201  inline void setObj(OsiSolverInterface *obj)
202  {
203    obj_ = obj;
204  }
205
206  //@}
207
208private:
209  /*! \name Data */
210  //@{
211
212  /// Parameter code
213  CbcOsiParamCode paramCode_;
214
215  /// OsiSolverInterface object
216  OsiSolverInterface *obj_;
217
218  //@}
219};
220
221/*
222  Declare the utility functions.
223*/
224
225namespace CbcOsiParamUtils {
226void addCbcOsiParams(int &numParams, CoinParamVec &paramVec,
227  OsiSolverInterface *osi);
228void loadOsiParamObj(const CoinParamVec paramVec,
229  CbcGenCtlBlk *ctlBlk);
230void setOsiSolverInterfaceDefaults(OsiSolverInterface *osi);
231
232int pushCbcOsiLogLevel(CoinParam *param);
233int pushCbcOsiInt(CoinParam *param);
234int pushCbcOsiDbl(CoinParam *param);
235int pushCbcOsiKwd(CoinParam *param);
236int pushCbcOsiHint(CoinParam *param);
237}
238
239#endif
240
241/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
242*/
Note: See TracBrowser for help on using the repository browser.