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

Last change on this file since 2165 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
RevLine 
[640]1/*
2  Copyright (C) 2007, Lou Hafer, International Business Machines Corporation
3  and others.  All Rights Reserved.
4
[1573]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 forrest $
8*/
9/*
[640]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/*
[1854]21  $Id: CbcGenCbcParam.hpp 1899 2013-04-09 18:12:08Z forrest $
[640]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
[1286]31class CbcCbcParam : public CoinParam {
[640]32
33public:
34
[1286]35    /*! \name Subtypes */
[640]36//@{
37
[1286]38    /*! \enum CbcCbcParamCode
39        \brief Enumeration for parameters that control a CbcModel object
[640]40
[1286]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,
[640]46
[1286]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,
[640]55
[1286]56                   CBCCBC_LASTPARAM
[640]57
[1286]58                 } CbcCbcParamCode ;
59
[640]60//@}
61
[1286]62    /*! \name Constructors and Destructors
[640]63
[1286]64      Be careful how you specify parameters for the constructors! There's great
65      potential for confusion.
66    */
[640]67//@{
[1286]68    /*! \brief Default constructor */
[640]69
[1286]70    CbcCbcParam() ;
[640]71
[1286]72    /*! \brief Constructor for a parameter with a double value
[640]73
[1286]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) ;
[640]81
[1286]82    /*! \brief Constructor for a parameter with an integer value
[640]83
[1286]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) ;
[640]89
[1286]90    /*! \brief Constructor for a parameter with keyword values
[640]91
[1286]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) ;
[640]101
[1286]102    /*! \brief Constructor for a string parameter
[640]103
[1286]104      The default string value must be specified explicitly to distinguish
105      a string constructor from an action parameter constructor.
106    */
[640]107
[1286]108    CbcCbcParam(CbcCbcParamCode code, std::string name, std::string help,
109                std::string dflt, bool display = true) ;
[640]110
[1286]111    /*! \brief Constructor for an action parameter */
[640]112
[1286]113    CbcCbcParam(CbcCbcParamCode code, std::string name, std::string help,
114                bool display = true) ;
[640]115
[1286]116    /*! \brief Copy constructor */
[640]117
[1286]118    CbcCbcParam(const CbcCbcParam &orig) ;
[640]119
[1286]120    /*! \brief Clone */
[640]121
[1286]122    CbcCbcParam *clone() ;
123
124    /*! \brief Assignment */
125
126    CbcCbcParam &operator=(const CbcCbcParam &rhs) ;
127
128    /*! \brief  Destructor */
129
130    ~CbcCbcParam() ;
131
[640]132//@}
133
[1286]134    /*! \name Methods to query and manipulate a parameter object */
[640]135//@{
136
[1286]137    /*! \brief Get the parameter code  */
[640]138
[1286]139    inline CbcCbcParamCode paramCode() const {
140        return (paramCode_) ;
141    }
[640]142
[1286]143    /*! \brief Set the parameter code */
[640]144
[1286]145    inline void setParamCode(CbcCbcParamCode code) {
146        paramCode_ = code ;
147    }
[640]148
[1286]149    /*! \brief Get the underlying CbcModel object */
[640]150
[1286]151    inline CbcModel *obj() const {
152        return (obj_) ;
153    }
[640]154
[1286]155    /*! \brief Set the underlying CbcModel object */
[640]156
[1286]157    inline void setObj(CbcModel *obj) {
158        obj_ = obj ;
159    }
[640]160
161//@}
162
163private:
164
[1286]165    /*! \name Data */
[640]166//@{
167
[1286]168    /// Parameter code
169    CbcCbcParamCode paramCode_ ;
[640]170
[1286]171    /// CbcModel object
172    CbcModel *obj_ ;
[640]173
174//@}
175
176} ;
177
178
179/*
180  Declare the utility functions.
181*/
182
[1286]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) ;
[640]189
[1286]190int pushCbcCbcDbl(CoinParam *param) ;
191int pushCbcCbcInt(CoinParam *param) ;
[640]192}
193
194#endif
[1432]195
Note: See TracBrowser for help on using the repository browser.