Ignore:
Timestamp:
Nov 9, 2009 6:33:07 PM (11 years ago)
Author:
EdwinStraver
Message:

Changed formatting using AStyle -A4 -p

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/Cbc/src/CbcGenParam.hpp

    r1271 r1286  
    2727*/
    2828
    29 class CbcGenParam : public CoinParam
    30 {
     29class CbcGenParam : public CoinParam {
    3130
    3231public:
    3332
    34 /*! \name Subtypes */
    35 //@{
    36 
    37   /*! \enum CbcGenParamCode
    38       \brief Enumeration for cbc-generic parameters
    39 
    40     These are parameters that control the operation of the cbc-generic main
    41     program by operating on a CbcGenCtlBlk object. CBCGEN_FIRSTPARAM and
    42     CBCGEN_LASTPARM are markers to allow convenient separation of parameter
    43     groups.
    44   */
    45   typedef enum
    46   { CBCGEN_FIRSTPARAM = 0,
    47  
    48     GENERALQUERY, FULLGENERALQUERY, HELP,
    49     BAB, CLEARCUTS, CLIQUECUTS, COMBINE, COSTSTRATEGY,
    50     CPP, CUTDEPTH, CUTSTRATEGY,
    51     DEBUG, DIRECTORY, DJFIX, DUMMY,
    52     ERRORSALLOWED, EXIT, EXPORT,
    53     FLOWCUTS, FPUMP, FPUMPITS, GOMORYCUTS, GREEDY, HEURISTICSTRATEGY,
    54     IMPORT, INTPRINT, KNAPSACKCUTS, LOCALTREE, LOGLEVEL,
    55     MESSAGES, MIPLIB, MIXEDCUTS, ODDHOLECUTS, OUTDUPROWS, OUTPUTFORMAT,
    56     PREPROCESS, PRINTMASK, PRINTOPTIONS, PRINTVERSION, PRIORITYIN, PROBINGCUTS,
    57     REDSPLITCUTS, ROUNDING,
    58     SOLUTION, SOLVECONTINUOUS, SOLVER, SOS, STDIN, STRENGTHEN,
    59     TIGHTENFACTOR, TWOMIRCUTS,
    60     UNITTEST, USERCBC, USESOLUTION, VERBOSE, SHOWUNIMP,
    61 
    62     CBCGEN_LASTPARAM
    63 
    64   } CbcGenParamCode ;
    65 
    66 //@}
    67 
    68 /*! \name Constructors and Destructors
    69 
    70   Be careful how you specify parameters for the constructors! There's great
    71   potential for confusion.
    72 */
    73 //@{
    74   /*! \brief Default constructor */
    75 
    76   CbcGenParam() ;
    77 
    78   /*! \brief Constructor for a parameter with a double value
    79  
    80     The default value is 0.0. Be careful to clearly indicate that \p lower and
    81     \p upper are real (double) values to distinguish this constructor from the
    82     constructor for an integer parameter.
    83   */
    84   CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
    85                double lower, double upper, double dflt = 0.0,
    86                bool display = true) ;
    87 
    88   /*! \brief Constructor for a parameter with an integer value
    89  
    90     The default value is 0.
    91   */
    92   CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
    93                int lower, int upper, int dflt = 0,
    94                bool display = true) ;
    95 
    96   /*! \brief Constructor for a parameter with keyword values
    97  
    98     The string supplied as \p firstValue becomes the first keyword.
    99     Additional keywords can be added using appendKwd(). Keywords are numbered
    100     from zero. It's necessary to specify both the first keyword (\p
    101     firstValue) and the default keyword index (\p dflt) in order to
    102     distinguish this constructor from the string and action parameter
    103     constructors.
    104   */
    105   CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
    106                std::string firstValue, int dflt, bool display = true) ;
    107 
    108   /*! \brief Constructor for a string parameter
    109  
    110     The default string value must be specified explicitly to distinguish
    111     a string constructor from an action parameter constructor.
    112   */
    113 
    114   CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
    115                std::string dflt, bool display = true) ;
    116 
    117   /*! \brief Constructor for an action parameter */
    118 
    119   CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
    120                bool display = true) ;
    121 
    122   /*! \brief Copy constructor */
    123 
    124   CbcGenParam(const CbcGenParam &orig) ;
    125 
    126   /*! \brief Clone */
    127 
    128   CbcGenParam *clone() ;
    129 
    130   /*! \brief Assignment */
    131  
    132   CbcGenParam &operator=(const CbcGenParam &rhs) ;
    133 
    134   /*! \brief  Destructor */
    135 
    136   ~CbcGenParam() ;
    137 
    138 //@}
    139 
    140 /*! \name Methods to query and manipulate a parameter object */
    141 //@{
    142 
    143   /*! \brief Get the parameter code  */
    144 
    145   inline CbcGenParamCode paramCode() const { return (paramCode_) ; }
    146 
    147   /*! \brief Set the parameter code */
    148 
    149   inline void setParamCode(CbcGenParamCode code) { paramCode_ = code ; }
    150 
    151   /*! \brief Get the underlying cbc-generic control object */
    152 
    153   inline CbcGenCtlBlk *obj() const { return (obj_) ; }
    154 
    155   /*! \brief Set the underlying cbc-generic control object */
    156 
    157   inline void setObj(CbcGenCtlBlk *obj) { obj_ = obj ; }
     33    /*! \name Subtypes */
     34//@{
     35
     36    /*! \enum CbcGenParamCode
     37        \brief Enumeration for cbc-generic parameters
     38
     39      These are parameters that control the operation of the cbc-generic main
     40      program by operating on a CbcGenCtlBlk object. CBCGEN_FIRSTPARAM and
     41      CBCGEN_LASTPARM are markers to allow convenient separation of parameter
     42      groups.
     43    */
     44    typedef enum { CBCGEN_FIRSTPARAM = 0,
     45
     46                   GENERALQUERY, FULLGENERALQUERY, HELP,
     47                   BAB, CLEARCUTS, CLIQUECUTS, COMBINE, COSTSTRATEGY,
     48                   CPP, CUTDEPTH, CUTSTRATEGY,
     49                   DEBUG, DIRECTORY, DJFIX, DUMMY,
     50                   ERRORSALLOWED, EXIT, EXPORT,
     51                   FLOWCUTS, FPUMP, FPUMPITS, GOMORYCUTS, GREEDY, HEURISTICSTRATEGY,
     52                   IMPORT, INTPRINT, KNAPSACKCUTS, LOCALTREE, LOGLEVEL,
     53                   MESSAGES, MIPLIB, MIXEDCUTS, ODDHOLECUTS, OUTDUPROWS, OUTPUTFORMAT,
     54                   PREPROCESS, PRINTMASK, PRINTOPTIONS, PRINTVERSION, PRIORITYIN, PROBINGCUTS,
     55                   REDSPLITCUTS, ROUNDING,
     56                   SOLUTION, SOLVECONTINUOUS, SOLVER, SOS, STDIN, STRENGTHEN,
     57                   TIGHTENFACTOR, TWOMIRCUTS,
     58                   UNITTEST, USERCBC, USESOLUTION, VERBOSE, SHOWUNIMP,
     59
     60                   CBCGEN_LASTPARAM
     61
     62                 } CbcGenParamCode ;
     63
     64//@}
     65
     66    /*! \name Constructors and Destructors
     67
     68      Be careful how you specify parameters for the constructors! There's great
     69      potential for confusion.
     70    */
     71//@{
     72    /*! \brief Default constructor */
     73
     74    CbcGenParam() ;
     75
     76    /*! \brief Constructor for a parameter with a double value
     77
     78      The default value is 0.0. Be careful to clearly indicate that \p lower and
     79      \p upper are real (double) values to distinguish this constructor from the
     80      constructor for an integer parameter.
     81    */
     82    CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
     83                double lower, double upper, double dflt = 0.0,
     84                bool display = true) ;
     85
     86    /*! \brief Constructor for a parameter with an integer value
     87
     88      The default value is 0.
     89    */
     90    CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
     91                int lower, int upper, int dflt = 0,
     92                bool display = true) ;
     93
     94    /*! \brief Constructor for a parameter with keyword values
     95
     96      The string supplied as \p firstValue becomes the first keyword.
     97      Additional keywords can be added using appendKwd(). Keywords are numbered
     98      from zero. It's necessary to specify both the first keyword (\p
     99      firstValue) and the default keyword index (\p dflt) in order to
     100      distinguish this constructor from the string and action parameter
     101      constructors.
     102    */
     103    CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
     104                std::string firstValue, int dflt, bool display = true) ;
     105
     106    /*! \brief Constructor for a string parameter
     107
     108      The default string value must be specified explicitly to distinguish
     109      a string constructor from an action parameter constructor.
     110    */
     111
     112    CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
     113                std::string dflt, bool display = true) ;
     114
     115    /*! \brief Constructor for an action parameter */
     116
     117    CbcGenParam(CbcGenParamCode code, std::string name, std::string help,
     118                bool display = true) ;
     119
     120    /*! \brief Copy constructor */
     121
     122    CbcGenParam(const CbcGenParam &orig) ;
     123
     124    /*! \brief Clone */
     125
     126    CbcGenParam *clone() ;
     127
     128    /*! \brief Assignment */
     129
     130    CbcGenParam &operator=(const CbcGenParam &rhs) ;
     131
     132    /*! \brief  Destructor */
     133
     134    ~CbcGenParam() ;
     135
     136//@}
     137
     138    /*! \name Methods to query and manipulate a parameter object */
     139//@{
     140
     141    /*! \brief Get the parameter code  */
     142
     143    inline CbcGenParamCode paramCode() const {
     144        return (paramCode_) ;
     145    }
     146
     147    /*! \brief Set the parameter code */
     148
     149    inline void setParamCode(CbcGenParamCode code) {
     150        paramCode_ = code ;
     151    }
     152
     153    /*! \brief Get the underlying cbc-generic control object */
     154
     155    inline CbcGenCtlBlk *obj() const {
     156        return (obj_) ;
     157    }
     158
     159    /*! \brief Set the underlying cbc-generic control object */
     160
     161    inline void setObj(CbcGenCtlBlk *obj) {
     162        obj_ = obj ;
     163    }
    158164
    159165//@}
     
    162168private:
    163169
    164 /*! \name Data */
    165 //@{
    166 
    167   /// Parameter code
    168   CbcGenParamCode paramCode_ ;
    169 
    170   /// cbc-generic control object
    171   CbcGenCtlBlk *obj_ ;
     170    /*! \name Data */
     171//@{
     172
     173    /// Parameter code
     174    CbcGenParamCode paramCode_ ;
     175
     176    /// cbc-generic control object
     177    CbcGenCtlBlk *obj_ ;
    172178
    173179//@}
     
    179185*/
    180186
    181 namespace CbcGenParamUtils
    182 { void addCbcGenParams(int &numParams, CoinParamVec &paramVec,
    183                        CbcGenCtlBlk *ctlBlk) ;
    184   void loadGenParamObj(const CoinParamVec paramVec, int first, int last,
    185                        CbcGenCtlBlk *ctlBlk) ;
    186  
    187   void saveSolution(const OsiSolverInterface *osi, std::string fileName) ;
    188   bool readSolution(std::string fileName,
    189                     int &numRows, int &numCols, double &objVal,
    190                     double **rowActivity, double **dualVars,
    191                     double **primalVars, double **reducedCosts) ;
    192 
    193   int doBaCParam(CoinParam *param) ;
    194   int doDebugParam(CoinParam *param) ;
    195   int doExitParam(CoinParam *param) ;
    196   int doHelpParam(CoinParam *param) ;
    197   int doImportParam(CoinParam *param) ;
    198   int doPrintMaskParam(CoinParam *param) ;
    199   int doNothingParam(CoinParam *param) ;
    200   int doSolutionParam(CoinParam *param) ;
    201   int doUnimplementedParam(CoinParam *param) ;
    202   int doVersionParam(CoinParam *param) ;
    203 
    204   int pushCbcGenDblParam(CoinParam *param) ;
    205   int pushCbcGenIntParam(CoinParam *param) ;
    206   int pushCbcGenKwdParam(CoinParam *param) ;
    207   int pushCbcGenStrParam(CoinParam *param) ;
    208 
    209   int pushCbcGenCutParam(CoinParam *param) ;
     187namespace CbcGenParamUtils {
     188void addCbcGenParams(int &numParams, CoinParamVec &paramVec,
     189                     CbcGenCtlBlk *ctlBlk) ;
     190void loadGenParamObj(const CoinParamVec paramVec, int first, int last,
     191                     CbcGenCtlBlk *ctlBlk) ;
     192
     193void saveSolution(const OsiSolverInterface *osi, std::string fileName) ;
     194bool readSolution(std::string fileName,
     195                  int &numRows, int &numCols, double &objVal,
     196                  double **rowActivity, double **dualVars,
     197                  double **primalVars, double **reducedCosts) ;
     198
     199int doBaCParam(CoinParam *param) ;
     200int doDebugParam(CoinParam *param) ;
     201int doExitParam(CoinParam *param) ;
     202int doHelpParam(CoinParam *param) ;
     203int doImportParam(CoinParam *param) ;
     204int doPrintMaskParam(CoinParam *param) ;
     205int doNothingParam(CoinParam *param) ;
     206int doSolutionParam(CoinParam *param) ;
     207int doUnimplementedParam(CoinParam *param) ;
     208int doVersionParam(CoinParam *param) ;
     209
     210int pushCbcGenDblParam(CoinParam *param) ;
     211int pushCbcGenIntParam(CoinParam *param) ;
     212int pushCbcGenKwdParam(CoinParam *param) ;
     213int pushCbcGenStrParam(CoinParam *param) ;
     214
     215int pushCbcGenCutParam(CoinParam *param) ;
    210216}
    211217
Note: See TracChangeset for help on using the changeset viewer.