- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/Blis-0.91.0/Blis/src/BlisParams.h

Go to the documentation of this file.

    00001 /*===========================================================================*
    00002  * This file is part of the BiCePS Linear Integer Solver (BLIS).             *
    00003  *                                                                           *
    00004  * BLIS is distributed under the Common Public License as part of the        *
    00005  * COIN-OR repository (http://www.coin-or.org).                              *
    00006  *                                                                           *
    00007  * Authors:                                                                  *
    00008  *                                                                           *
    00009  *          Yan Xu, Lehigh University                                        *
    00010  *          Ted Ralphs, Lehigh University                                    *
    00011  *                                                                           *
    00012  * Conceptual Design:                                                        *
    00013  *                                                                           *
    00014  *          Yan Xu, Lehigh University                                        *
    00015  *          Ted Ralphs, Lehigh University                                    *
    00016  *          Laszlo Ladanyi, IBM T.J. Watson Research Center                  *
    00017  *          Matthew Saltzman, Clemson University                             *
    00018  *                                                                           *
    00019  *                                                                           *
    00020  * Copyright (C) 2001-2009, Lehigh University, Yan Xu, and Ted Ralphs.       *
    00021  * All Rights Reserved.                                                      *
    00022  *===========================================================================*/
    00023
    00024 #ifndef BlisParams_h
    00025 #define BlisParams_h
    00026
    00027 #include "AlpsKnowledge.h"
    00028 #include "AlpsParameterBase.h"
    00029
    00030 #include "Blis.h"
    00031
    00032 //#############################################################################
    00033
    00034 //** Parameters used in Blis. */
    00035 class BlisParams : public AlpsParameterSet {
    00036  public:
    00039   enum chrParams{
    00042       cutRampUp,
    00044       presolve,
    00047       shareConstraints,
    00050       shareVariables,
    00053       sharePseudocostRampUp,
    00056       sharePseudocostSearch,
    00057       //
    00058       endOfChrParams
    00059   };
    00060
    00062   enum intParams{
    00063
    00070       branchStrategy,
    00071       branchStrategyRampUp,
    00072
    00079       cutStrategy,
    00080       cutGenerationFrequency,
    00081
    00082       cutPass,
    00083       quickCutPass,
    00085       cutCliqueStrategy,
    00086       cutGomoryStrategy,
    00087       cutFlowCoverStrategy,
    00088       cutKnapsackStrategy,
    00089       cutMirStrategy,
    00090       cutOddHoleStrategy,
    00091       cutProbingStrategy,
    00092       cutTwoMirStrategy,
    00093       cutCliqueFreq,
    00094       cutGomoryFreq,
    00095       cutFlowCoverFreq,
    00096       cutKnapsackFreq,
    00097       cutMirFreq,
    00098       cutOddHoleFreq,
    00099       cutProbingFreq,
    00100       cutTwoMirFreq,
    00101
    00103       difference,
    00104
    00111       heurStrategy,
    00112       heurCallFrequency,
    00113       heurRoundStrategy,
    00114       heurRoundFreq,
    00115
    00117       lookAhead,
    00119       pseudoRelibility,
    00120
    00122       sharePcostDepth,
    00124       sharePcostFrequency,
    00126       strongCandSize,
    00128       endOfIntParams
    00129   };
    00130
    00132   enum dblParams{
    00135       cutFactor,
    00136
    00138       cutoff,
    00141       cutoffInc,
    00142
    00144       denseConFactor,
    00145
    00147       integerTol,
    00148
    00150       objSense,
    00151
    00154       optimalRelGap,
    00155
    00158       optimalAbsGap,
    00159
    00161       pseudoWeight,
    00162
    00164       scaleConFactor,
    00165
    00167       tailOff,
    00169       endOfDblParams
    00170   };
    00171
    00173   enum strParams{
    00174       strDummy,
    00175       //
    00176       endOfStrParams
    00177   };
    00178
    00180   enum strArrayParams{
    00181       strArrayDummy,
    00183       endOfStrArrayParams
    00184   };
    00185
    00186  public:
    00192   BlisParams() :
    00193     AlpsParameterSet(
    00194                      static_cast<int>(endOfChrParams),
    00195                      static_cast<int>(endOfIntParams),
    00196                      static_cast<int>(endOfDblParams),
    00197                      static_cast<int>(endOfStrParams),
    00198                      static_cast<int>(endOfStrArrayParams)
    00199                      )
    00200     {
    00201       createKeywordList();
    00202       setDefaultEntries();
    00203     }
    00208   virtual void createKeywordList();
    00210   virtual void setDefaultEntries();
    00214  public:
    00215   //===========================================================================
    00223   //===========================================================================
    00224
    00225
    00234
    00235   inline bool entry(const chrParams key) const { return bpar_[key]; }
    00237   inline int entry(const intParams key) const { return ipar_[key]; }
    00239   inline double  entry(const dblParams key) const { return dpar_[key]; }
    00241   inline const std::string&
    00242     entry(const strParams key) const { return spar_[key]; }
    00244   inline const std::vector<std::string>&
    00245     entry(const strArrayParams key) const { return sapar_[key]; }
    00248   //---------------------------------------------------------------------------
    00250   void setEntry(const chrParams key, const char * val) {
    00251           bpar_[key] = atoi(val) ? true : false; }
    00253   void setEntry(const chrParams key, const char val) {
    00254           bpar_[key] = val ? true : false; }
    00256   void setEntry(const chrParams key, const bool val) {
    00257     bpar_[key] = val; }
    00259   void setEntry(const intParams key, const char * val) {
    00260     ipar_[key] = atoi(val); }
    00262   void setEntry(const intParams key, const int val) {
    00263     ipar_[key] = val; }
    00265   void setEntry(const dblParams key, const char * val) {
    00266     dpar_[key] = atof(val); }
    00268   void setEntry(const dblParams key, const double val) {
    00269     dpar_[key] = val; }
    00271   void setEntry(const strParams key, const char * val) {
    00272     spar_[key] = val; }
    00274   void setEntry(const strArrayParams key, const char *val) {
    00275     sapar_[key].push_back(val); }
    00276
    00277   //---------------------------------------------------------------------------
    00278
    00283   void pack(AlpsEncoded& buf) {
    00284     buf.writeRep(bpar_, endOfChrParams)
    00285       .writeRep(ipar_, endOfIntParams)
    00286       .writeRep(dpar_, endOfDblParams);
    00287     for (int i = 0; i < endOfStrParams; ++i)
    00288       buf.writeRep(spar_[i]);
    00289     for (int i = 0; i < endOfStrArrayParams; ++i) {
    00290       buf.writeRep(sapar_[i].size());
    00291       for (size_t j = 0; j < sapar_[i].size(); ++j)
    00292         buf.writeRep(sapar_[i][j]);
    00293     }
    00294   }
    00296   void unpack(AlpsEncoded& buf) {
    00297     int dummy;
    00298     // No need to allocate the arrays, they are of fixed length
    00299     dummy = static_cast<int>(endOfChrParams);
    00300     buf.readRep(bpar_, dummy, false);
    00301     dummy = static_cast<int>(endOfIntParams);
    00302     buf.readRep(ipar_, dummy, false);
    00303     dummy = static_cast<int>(endOfDblParams);
    00304     buf.readRep(dpar_, dummy, false);
    00305     for (int i = 0; i < endOfStrParams; ++i)
    00306       buf.readRep(spar_[i]);
    00307     for (int i = 0; i < endOfStrArrayParams; ++i) {
    00308       size_t str_size;
    00309       buf.readRep(str_size);
    00310       sapar_[i].reserve(str_size);
    00311       for (size_t j = 0; j < str_size; ++j){
    00312         //      sapar_[i].unchecked_push_back(std::string());
    00313         sapar_[i].push_back(std::string());
    00314         buf.readRep(sapar_[i].back());
    00315       }
    00316     }
    00317   }
    00320 };
    00321
    00322 #endif