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

Last change on this file since 1899 was 1899, checked in by stefan, 6 years ago

fixup svn properties

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