source: trunk/Cbc/src/CbcGenCbcParam.hpp @ 862

Last change on this file since 862 was 706, checked in by forrest, 12 years ago

take out };

File size: 4.4 KB
Line 
1/*
2  Copyright (C) 2007, Lou Hafer, International Business Machines Corporation
3  and others.  All Rights Reserved.
4
5  This file is part of cbc-generic.
6*/
7
8#ifndef CbcCbcParam_H
9#define CbcCbcParam_H
10
11/* \file CbcGenCbcParam.hpp
12   \brief Declarations for parameters that act on a CbcModel object.
13*/
14
15/*
16  $Id$
17*/
18
19/*! \class CbcCbcParam
20    \brief Class for control parameters that act on a CbcModel object.
21
22    Adds parameter type codes and push/pull functions to the generic parameter
23    object.
24*/
25
26class CbcCbcParam : public CoinParam
27{
28
29public:
30
31/*! \name Subtypes */
32//@{
33
34  /*! \enum CbcCbcParamCode
35      \brief Enumeration for parameters that control a CbcModel object
36
37    These are parameters that control the operation of a CbcModel object.
38    CBCCBC_FIRSTPARAM and CBCCBC_LASTPARAM are markers to allow convenient
39    separation of parameter groups.
40  */
41  typedef enum
42  { CBCCBC_FIRSTPARAM = CbcGenParam::CBCGEN_LASTPARAM+1,
43 
44    ALLOWABLEGAP, COSTSTRATEGY,
45    CUTDEPTH, CUTOFF, CUTPASS, DIRECTION,
46    GAPRATIO,
47    INCREMENT, INFEASIBILITYWEIGHT, INTEGERTOLERANCE,
48    LOGLEVEL, MAXIMIZE, MAXNODES, MINIMIZE,
49    MIPOPTIONS, MOREMIPOPTIONS, NUMBERANALYZE,
50    NUMBERBEFORE, NUMBERMINI,
51    STRONGBRANCHING, TIMELIMIT_BAB,
52
53    CBCCBC_LASTPARAM
54
55  } CbcCbcParamCode ;
56
57//@}
58
59/*! \name Constructors and Destructors
60
61  Be careful how you specify parameters for the constructors! There's great
62  potential for confusion.
63*/
64//@{
65  /*! \brief Default constructor */
66
67  CbcCbcParam() ;
68
69  /*! \brief Constructor for a parameter with a double value
70 
71    The default value is 0.0. Be careful to clearly indicate that \p lower and
72    \p upper are real (double) values to distinguish this constructor from the
73    constructor for an integer parameter.
74  */
75  CbcCbcParam(CbcCbcParamCode code, std::string name, std::string help,
76               double lower, double upper, double dflt = 0.0,
77               bool display = true) ;
78
79  /*! \brief Constructor for a parameter with an integer value
80 
81    The default value is 0.
82  */
83  CbcCbcParam(CbcCbcParamCode code, std::string name, std::string help,
84               int lower, int upper, int dflt = 0,
85               bool display = true) ;
86
87  /*! \brief Constructor for a parameter with keyword values
88 
89    The string supplied as \p firstValue becomes the first keyword.
90    Additional keywords can be added using appendKwd(). Keywords are numbered
91    from zero. It's necessary to specify both the first keyword (\p
92    firstValue) and the default keyword index (\p dflt) in order to
93    distinguish this constructor from the string and action parameter
94    constructors.
95  */
96  CbcCbcParam(CbcCbcParamCode code, std::string name, std::string help,
97               std::string firstValue, int dflt, bool display = true) ;
98
99  /*! \brief Constructor for a string parameter
100 
101    The default string value must be specified explicitly to distinguish
102    a string constructor from an action parameter constructor.
103  */
104
105  CbcCbcParam(CbcCbcParamCode code, std::string name, std::string help,
106               std::string dflt, bool display = true) ;
107
108  /*! \brief Constructor for an action parameter */
109
110  CbcCbcParam(CbcCbcParamCode code, std::string name, std::string help,
111               bool display = true) ;
112
113  /*! \brief Copy constructor */
114
115  CbcCbcParam(const CbcCbcParam &orig) ;
116
117  /*! \brief Clone */
118
119  CbcCbcParam *clone() ;
120
121  /*! \brief Assignment */
122 
123  CbcCbcParam &operator=(const CbcCbcParam &rhs) ;
124
125  /*! \brief  Destructor */
126
127  ~CbcCbcParam() ;
128
129//@}
130
131/*! \name Methods to query and manipulate a parameter object */
132//@{
133
134  /*! \brief Get the parameter code  */
135
136  inline CbcCbcParamCode paramCode() const { return (paramCode_) ; } 
137
138  /*! \brief Set the parameter code */
139
140  inline void setParamCode(CbcCbcParamCode code) { paramCode_ = code ; } 
141
142  /*! \brief Get the underlying CbcModel object */
143
144  inline CbcModel *obj() const { return (obj_) ; } 
145
146  /*! \brief Set the underlying CbcModel object */
147
148  inline void setObj(CbcModel *obj) { obj_ = obj ; } 
149
150//@}
151
152private:
153
154/*! \name Data */
155//@{
156
157  /// Parameter code
158  CbcCbcParamCode paramCode_ ;
159
160  /// CbcModel object
161  CbcModel *obj_ ;
162
163//@}
164
165} ;
166
167
168/*
169  Declare the utility functions.
170*/
171
172namespace CbcCbcParamUtils
173{ void addCbcCbcParams(int &numParams, CoinParamVec &paramVec,
174                       CbcModel *model) ;
175  void loadCbcParamObj(const CoinParamVec paramVec, int first, int last,
176                       CbcModel *model) ;
177  void setCbcModelDefaults (CbcModel *model) ;
178
179  int pushCbcCbcDbl(CoinParam *param) ;
180  int pushCbcCbcInt(CoinParam *param) ;
181}
182
183#endif
Note: See TracBrowser for help on using the repository browser.