source: stable/2.5/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
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 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/*
16  $Id: CbcGenOsiParam.hpp 1173 2009-06-04 09:44:10Z forrest $
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
26class CbcOsiParam : public CoinParam {
27
28public:
29
30    /*! \name Subtypes */
31//@{
32
33    /*! \enum CbcOsiParamCode
34        \brief Enumeration for parameters that control an OsiSolverInterface
35           object
36
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,
42
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,
52
53                   CBCOSI_LASTPARAM
54
55                 } CbcOsiParamCode ;
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    CbcOsiParam() ;
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    CbcOsiParam(CbcOsiParamCode 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    CbcOsiParam(CbcOsiParamCode 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    CbcOsiParam(CbcOsiParamCode 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    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
106                std::string dflt, bool display = true) ;
107
108    /*! \brief Constructor for an action parameter */
109
110    CbcOsiParam(CbcOsiParamCode code, std::string name, std::string help,
111                bool display = true) ;
112
113    /*! \brief Copy constructor */
114
115    CbcOsiParam(const CbcOsiParam &orig) ;
116
117    /*! \brief Clone */
118
119    CbcOsiParam *clone() ;
120
121    /*! \brief Assignment */
122
123    CbcOsiParam &operator=(const CbcOsiParam &rhs) ;
124
125    /*! \brief  Destructor */
126
127    ~CbcOsiParam() ;
128
129//@}
130
131    /*! \name Methods to query and manipulate a parameter object */
132//@{
133
134    /*! \brief Get the parameter code  */
135
136    inline CbcOsiParamCode paramCode() const {
137        return (paramCode_) ;
138    }
139
140    /*! \brief Set the parameter code */
141
142    inline void setParamCode(CbcOsiParamCode code) {
143        paramCode_ = code ;
144    }
145
146    /*! \brief Get the underlying OsiSolverInterface object */
147
148    inline OsiSolverInterface *obj() const {
149        return (obj_) ;
150    }
151
152    /*! \brief Set the underlying OsiSolverInterace object */
153
154    inline void setObj(OsiSolverInterface *obj) {
155        obj_ = obj ;
156    }
157
158//@}
159
160
161private:
162
163    /*! \name Data */
164//@{
165
166    /// Parameter code
167    CbcOsiParamCode paramCode_ ;
168
169    /// OsiSolverInterface object
170    OsiSolverInterface *obj_ ;
171
172//@}
173
174} ;
175
176
177
178/*
179  Declare the utility functions.
180*/
181
182namespace CbcOsiParamUtils {
183void addCbcOsiParams(int &numParams, CoinParamVec &paramVec,
184                     OsiSolverInterface *osi) ;
185void loadOsiParamObj(const CoinParamVec paramVec,
186                     CbcGenCtlBlk *ctlBlk) ;
187void setOsiSolverInterfaceDefaults(OsiSolverInterface *osi) ;
188
189int pushCbcOsiLogLevel(CoinParam *param) ;
190int pushCbcOsiInt(CoinParam *param) ;
191int pushCbcOsiDbl(CoinParam *param) ;
192int pushCbcOsiKwd(CoinParam *param) ;
193int pushCbcOsiHint(CoinParam *param) ;
194}
195
196
197#endif
198
Note: See TracBrowser for help on using the repository browser.