source: trunk/Cbc/src/CbcGenOsiParam.hpp @ 2271

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

fixup svn properties

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.4 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: CbcGenOsiParam.hpp 1899 2013-04-09 18:12:08Z tkr $
8*/
9/*
[640]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/*
[1854]21  $Id: CbcGenOsiParam.hpp 1899 2013-04-09 18:12:08Z tkr $
[640]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
[1286]31class CbcOsiParam : public CoinParam {
[640]32
33public:
34
[1286]35    /*! \name Subtypes */
[640]36//@{
37
[1286]38    /*! \enum CbcOsiParamCode
39        \brief Enumeration for parameters that control an OsiSolverInterface
40           object
[640]41
[1286]42      These are parameters that control the operation of an OsiSolverInterface
43      object. CBCOSI_FIRSTPARAM and CBCOSI_LASTPARAM are markers to allow
44      convenient separation of parameter groups.
45    */
46    typedef enum { CBCOSI_FIRSTPARAM = CbcCbcParam::CBCCBC_LASTPARAM + 1,
[640]47
[1286]48                   ALGORITHM, ALLSLACK, AUTOSCALE, BARRIER, BARRIERSCALE,
49                   BASISIN, BASISOUT, BIASLU, CHOLESKY, CRASH, CROSSOVER,
50                   DUALBOUND, DUALPIVOT, DUALSIMPLEX, DUALTOLERANCE, FAKEBOUND,
51                   GAMMA, IDIOT, KEEPNAMES, KKT, MAXITERATION, MAXHOTITS, NETLIB_BARRIER,
52                   NETLIB_DUAL, NETLIB_PRIMAL, NETWORK, OBJSCALE, PERTURBATION,
53                   PERTVALUE, PFI, PLUSMINUS, PRESOLVE, PRESOLVEOPTIONS, PRESOLVEPASS,
54                   PRIMALPIVOT, PRIMALSIMPLEX, PRIMALTOLERANCE, REALLY_SCALE,
55                   RESTORE, REVERSE, RHSSCALE, SAVE, SCALING, SLPVALUE, SOLVERLOGLEVEL,
56                   SPARSEFACTOR, SPECIALOPTIONS, SPRINT, TIGHTEN,
[640]57
[1286]58                   CBCOSI_LASTPARAM
[640]59
[1286]60                 } CbcOsiParamCode ;
61
[640]62//@}
63
[1286]64    /*! \name Constructors and Destructors
[640]65
[1286]66      Be careful how you specify parameters for the constructors! There's great
67      potential for confusion.
68    */
[640]69//@{
[1286]70    /*! \brief Default constructor */
[640]71
[1286]72    CbcOsiParam() ;
[640]73
[1286]74    /*! \brief Constructor for a parameter with a double value
[640]75
[1286]76      The default value is 0.0. Be careful to clearly indicate that \p lower and
77      \p upper are real (double) values to distinguish this constructor from the
78      constructor for an integer parameter.
79    */
80    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
81                double lower, double upper, double dflt = 0.0,
82                bool display = true) ;
[640]83
[1286]84    /*! \brief Constructor for a parameter with an integer value
[640]85
[1286]86      The default value is 0.
87    */
88    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
89                int lower, int upper, int dflt = 0,
90                bool display = true) ;
[640]91
[1286]92    /*! \brief Constructor for a parameter with keyword values
[640]93
[1286]94      The string supplied as \p firstValue becomes the first keyword.
95      Additional keywords can be added using appendKwd(). Keywords are numbered
96      from zero. It's necessary to specify both the first keyword (\p
97      firstValue) and the default keyword index (\p dflt) in order to
98      distinguish this constructor from the string and action parameter
99      constructors.
100    */
101    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
102                std::string firstValue, int dflt, bool display = true) ;
[640]103
[1286]104    /*! \brief Constructor for a string parameter
[640]105
[1286]106      The default string value must be specified explicitly to distinguish
107      a string constructor from an action parameter constructor.
108    */
[640]109
[1286]110    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
111                std::string dflt, bool display = true) ;
[640]112
[1286]113    /*! \brief Constructor for an action parameter */
[640]114
[1286]115    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
116                bool display = true) ;
[640]117
[1286]118    /*! \brief Copy constructor */
[640]119
[1286]120    CbcOsiParam(const CbcOsiParam &orig) ;
[640]121
[1286]122    /*! \brief Clone */
[640]123
[1286]124    CbcOsiParam *clone() ;
125
126    /*! \brief Assignment */
127
128    CbcOsiParam &operator=(const CbcOsiParam &rhs) ;
129
130    /*! \brief  Destructor */
131
132    ~CbcOsiParam() ;
133
[640]134//@}
135
[1286]136    /*! \name Methods to query and manipulate a parameter object */
[640]137//@{
138
[1286]139    /*! \brief Get the parameter code  */
[640]140
[1286]141    inline CbcOsiParamCode paramCode() const {
142        return (paramCode_) ;
143    }
[640]144
[1286]145    /*! \brief Set the parameter code */
[640]146
[1286]147    inline void setParamCode(CbcOsiParamCode code) {
148        paramCode_ = code ;
149    }
[640]150
[1286]151    /*! \brief Get the underlying OsiSolverInterface object */
[640]152
[1286]153    inline OsiSolverInterface *obj() const {
154        return (obj_) ;
155    }
[640]156
[1286]157    /*! \brief Set the underlying OsiSolverInterace object */
[640]158
[1286]159    inline void setObj(OsiSolverInterface *obj) {
160        obj_ = obj ;
161    }
[640]162
163//@}
164
165
166private:
167
[1286]168    /*! \name Data */
[640]169//@{
170
[1286]171    /// Parameter code
172    CbcOsiParamCode paramCode_ ;
[640]173
[1286]174    /// OsiSolverInterface object
175    OsiSolverInterface *obj_ ;
[640]176
177//@}
178
179} ;
180
181
182
183/*
184  Declare the utility functions.
185*/
186
[1286]187namespace CbcOsiParamUtils {
188void addCbcOsiParams(int &numParams, CoinParamVec &paramVec,
189                     OsiSolverInterface *osi) ;
190void loadOsiParamObj(const CoinParamVec paramVec,
191                     CbcGenCtlBlk *ctlBlk) ;
192void setOsiSolverInterfaceDefaults(OsiSolverInterface *osi) ;
[640]193
[1286]194int pushCbcOsiLogLevel(CoinParam *param) ;
195int pushCbcOsiInt(CoinParam *param) ;
196int pushCbcOsiDbl(CoinParam *param) ;
197int pushCbcOsiKwd(CoinParam *param) ;
198int pushCbcOsiHint(CoinParam *param) ;
[640]199}
200
201
202#endif
[1432]203
Note: See TracBrowser for help on using the repository browser.