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

Last change on this file since 1460 was 1432, checked in by bjarni, 10 years ago

Added extra return at end of each source file where needed, to remove possible linefeed conflicts (NightlyBuild? errors)

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
5  This file is part of cbc-generic.
6*/
7
8#ifndef CbcOsiParam_H
9#define CbcOsiParam_H
10
11/* \file CbcGenOsiParam.hpp
12   \brief Declarations for parameters that act on a OsiSolverInterface object.
13*/
14
15/*
[1271]16  $Id: CbcGenOsiParam.hpp 1173 2009-06-04 09:44:10Z forrest $
[640]17*/
18
19/*! \class CbcOsiParam
20    \brief Class for control parameters that act on a OsiSolverInterface object.
21
22    Adds parameter type codes and push/pull functions to the generic parameter
23    object.
24*/
25
[1286]26class CbcOsiParam : public CoinParam {
[640]27
28public:
29
[1286]30    /*! \name Subtypes */
[640]31//@{
32
[1286]33    /*! \enum CbcOsiParamCode
34        \brief Enumeration for parameters that control an OsiSolverInterface
35           object
[640]36
[1286]37      These are parameters that control the operation of an OsiSolverInterface
38      object. CBCOSI_FIRSTPARAM and CBCOSI_LASTPARAM are markers to allow
39      convenient separation of parameter groups.
40    */
41    typedef enum { CBCOSI_FIRSTPARAM = CbcCbcParam::CBCCBC_LASTPARAM + 1,
[640]42
[1286]43                   ALGORITHM, ALLSLACK, AUTOSCALE, BARRIER, BARRIERSCALE,
44                   BASISIN, BASISOUT, BIASLU, CHOLESKY, CRASH, CROSSOVER,
45                   DUALBOUND, DUALPIVOT, DUALSIMPLEX, DUALTOLERANCE, FAKEBOUND,
46                   GAMMA, IDIOT, KEEPNAMES, KKT, MAXITERATION, MAXHOTITS, NETLIB_BARRIER,
47                   NETLIB_DUAL, NETLIB_PRIMAL, NETWORK, OBJSCALE, PERTURBATION,
48                   PERTVALUE, PFI, PLUSMINUS, PRESOLVE, PRESOLVEOPTIONS, PRESOLVEPASS,
49                   PRIMALPIVOT, PRIMALSIMPLEX, PRIMALTOLERANCE, REALLY_SCALE,
50                   RESTORE, REVERSE, RHSSCALE, SAVE, SCALING, SLPVALUE, SOLVERLOGLEVEL,
51                   SPARSEFACTOR, SPECIALOPTIONS, SPRINT, TIGHTEN,
[640]52
[1286]53                   CBCOSI_LASTPARAM
[640]54
[1286]55                 } CbcOsiParamCode ;
56
[640]57//@}
58
[1286]59    /*! \name Constructors and Destructors
[640]60
[1286]61      Be careful how you specify parameters for the constructors! There's great
62      potential for confusion.
63    */
[640]64//@{
[1286]65    /*! \brief Default constructor */
[640]66
[1286]67    CbcOsiParam() ;
[640]68
[1286]69    /*! \brief Constructor for a parameter with a double value
[640]70
[1286]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    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
76                double lower, double upper, double dflt = 0.0,
77                bool display = true) ;
[640]78
[1286]79    /*! \brief Constructor for a parameter with an integer value
[640]80
[1286]81      The default value is 0.
82    */
83    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
84                int lower, int upper, int dflt = 0,
85                bool display = true) ;
[640]86
[1286]87    /*! \brief Constructor for a parameter with keyword values
[640]88
[1286]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    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
97                std::string firstValue, int dflt, bool display = true) ;
[640]98
[1286]99    /*! \brief Constructor for a string parameter
[640]100
[1286]101      The default string value must be specified explicitly to distinguish
102      a string constructor from an action parameter constructor.
103    */
[640]104
[1286]105    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
106                std::string dflt, bool display = true) ;
[640]107
[1286]108    /*! \brief Constructor for an action parameter */
[640]109
[1286]110    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
111                bool display = true) ;
[640]112
[1286]113    /*! \brief Copy constructor */
[640]114
[1286]115    CbcOsiParam(const CbcOsiParam &orig) ;
[640]116
[1286]117    /*! \brief Clone */
[640]118
[1286]119    CbcOsiParam *clone() ;
120
121    /*! \brief Assignment */
122
123    CbcOsiParam &operator=(const CbcOsiParam &rhs) ;
124
125    /*! \brief  Destructor */
126
127    ~CbcOsiParam() ;
128
[640]129//@}
130
[1286]131    /*! \name Methods to query and manipulate a parameter object */
[640]132//@{
133
[1286]134    /*! \brief Get the parameter code  */
[640]135
[1286]136    inline CbcOsiParamCode paramCode() const {
137        return (paramCode_) ;
138    }
[640]139
[1286]140    /*! \brief Set the parameter code */
[640]141
[1286]142    inline void setParamCode(CbcOsiParamCode code) {
143        paramCode_ = code ;
144    }
[640]145
[1286]146    /*! \brief Get the underlying OsiSolverInterface object */
[640]147
[1286]148    inline OsiSolverInterface *obj() const {
149        return (obj_) ;
150    }
[640]151
[1286]152    /*! \brief Set the underlying OsiSolverInterace object */
[640]153
[1286]154    inline void setObj(OsiSolverInterface *obj) {
155        obj_ = obj ;
156    }
[640]157
158//@}
159
160
161private:
162
[1286]163    /*! \name Data */
[640]164//@{
165
[1286]166    /// Parameter code
167    CbcOsiParamCode paramCode_ ;
[640]168
[1286]169    /// OsiSolverInterface object
170    OsiSolverInterface *obj_ ;
[640]171
172//@}
173
174} ;
175
176
177
178/*
179  Declare the utility functions.
180*/
181
[1286]182namespace CbcOsiParamUtils {
183void addCbcOsiParams(int &numParams, CoinParamVec &paramVec,
184                     OsiSolverInterface *osi) ;
185void loadOsiParamObj(const CoinParamVec paramVec,
186                     CbcGenCtlBlk *ctlBlk) ;
187void setOsiSolverInterfaceDefaults(OsiSolverInterface *osi) ;
[640]188
[1286]189int pushCbcOsiLogLevel(CoinParam *param) ;
190int pushCbcOsiInt(CoinParam *param) ;
191int pushCbcOsiDbl(CoinParam *param) ;
192int pushCbcOsiKwd(CoinParam *param) ;
193int pushCbcOsiHint(CoinParam *param) ;
[640]194}
195
196
197#endif
[1432]198
Note: See TracBrowser for help on using the repository browser.