/home/coin/SVN-release/Cbc-2.4.0/Cbc/src/CbcParam.hpp

Go to the documentation of this file.
00001 /* $Id: CbcParam.hpp 1271 2009-11-05 15:57:25Z forrest $ */
00002 // Copyright (C) 2002, International Business Machines
00003 // Corporation and others.  All Rights Reserved.
00004 
00005 #ifndef CbcParam_H
00006 #define CbcParam_H
00007 
00008 #include "OsiSolverInterface.hpp"
00009 #include "CbcModel.hpp"
00010 class ClpSimplex;
00030 enum CbcParameterType
00031 
00032   { GENERALQUERY = -100,FULLGENERALQUERY,
00033   
00034     PRIMALTOLERANCE = 1, DUALTOLERANCE,CUTOFF,TIMELIMIT,
00035     DUALBOUND, PRIMALWEIGHT,  OBJSCALE, RHSSCALE,
00036 
00037   INFEASIBILITYWEIGHT = 51, INTEGERTOLERANCE,INCREMENT,ALLOWABLEGAP,
00038 
00039   DJFIX = 81, GAPRATIO,TIGHTENFACTOR,
00040 
00041   LOGLEVEL = 101, SOLVERLOGLEVEL, MAXNODES,STRONGBRANCHING,
00042     MAXFACTOR,PERTVALUE,MAXITERATION,PRESOLVEPASS,IDIOT,SPRINT,
00043     OUTPUTFORMAT,SLPVALUE,PRESOLVEOPTIONS,PRINTOPTIONS,SPECIALOPTIONS,
00044   
00045   DIRECTION=201,DUALPIVOT,SCALING,ERRORSALLOWED,KEEPNAMES,SPARSEFACTOR,
00046   PRIMALPIVOT,PRESOLVE,CRASH,BIASLU,PERTURBATION,MESSAGES,AUTOSCALE,
00047   CHOLESKY,KKT,BARRIERSCALE,GAMMA,CROSSOVER,PFI,ALGORITHM,
00048 
00049   NODESTRATEGY = 251,BRANCHSTRATEGY,ADDCUTSSTRATEGY,
00050   GOMORYCUTS,PROBINGCUTS,KNAPSACKCUTS,ODDHOLECUTS,
00051   ROUNDING,SOLVER,CLIQUECUTS,COSTSTRATEGY,FLOWCUTS,MIXEDCUTS,
00052     TWOMIRCUTS,PREPROCESS,
00053   
00054   DIRECTORY=301,IMPORT,EXPORT,RESTORE,SAVE,DUALSIMPLEX,PRIMALSIMPLEX,
00055   MAXIMIZE,MINIMIZE,EXIT,STDIN,UNITTEST,NETLIB_DUAL,NETLIB_PRIMAL,SOLUTION,
00056   TIGHTEN,FAKEBOUND,HELP,PLUSMINUS,NETWORK,ALLSLACK,REVERSE,BARRIER,NETLIB_BARRIER,
00057     REALLY_SCALE,BASISIN,BASISOUT,SOLVECONTINUOUS,BAB,MIPLIB,CLEARCUTS,PRINTVERSION,
00058 
00059   OSLSTUFF = 401,CBCSTUFF,
00060 
00061   INVALID = 1000 }; 
00062 
00063 
00065 
00066 class CbcParam {
00067 
00068 public:
00069 
00072 
00073   CbcParam (  );
00074   CbcParam (std::string name, std::string help,
00075            double lower, double upper, CbcParameterType type,bool display=true);
00076   CbcParam (std::string name, std::string help,
00077            int lower, int upper, CbcParameterType type,bool display=true);
00078   // Other strings will be added by insert
00079   CbcParam (std::string name, std::string help, std::string firstValue,
00080            CbcParameterType type,int defaultIndex=0,bool display=true);
00081   // Action
00082   CbcParam (std::string name, std::string help,
00083            CbcParameterType type,int indexNumber=-1,bool display=true);
00085   CbcParam(const CbcParam &);
00087     CbcParam & operator=(const CbcParam & rhs);
00089   ~CbcParam (  );
00091 
00094 
00095   void append(std::string keyWord);
00097   void addHelp(std::string keyWord);
00099   inline std::string  name(  ) const {
00100     return name_;
00101   };
00103   inline std::string  shortHelp(  ) const {
00104     return shortHelp_;
00105   };
00107   int setDoubleParameter(CbcModel & model, double value) const;
00109   double doubleParameter(CbcModel & model) const;
00111   int setIntParameter(CbcModel & model, int value) const;
00113   int intParameter(CbcModel & model) const;
00115   int setDoubleParameter(ClpSimplex * model, double value) const;
00117   double doubleParameter(ClpSimplex * model) const;
00119   int setIntParameter(ClpSimplex * model, int value) const;
00121   int intParameter(ClpSimplex * model) const;
00123   int setDoubleParameter(OsiSolverInterface * model, double value) const;
00125   double doubleParameter(OsiSolverInterface * model) const;
00127   int setIntParameter(OsiSolverInterface * model, int value) const;
00129   int intParameter(OsiSolverInterface * model) const;
00131   int checkDoubleParameter(double value) const;
00133   std::string matchName (  ) const;
00135   int parameterOption ( std::string check ) const;
00137   void printOptions (  ) const;
00139   inline std::string currentOption (  ) const
00140   { return definedKeyWords_[currentKeyWord_]; }
00142   inline void setCurrentOption ( int value )
00143   { currentKeyWord_=value; }
00145   inline void setIntValue ( int value )
00146   { intValue_=value; }
00147   inline int intValue () const
00148   { return intValue_; }
00150   inline void setDoubleValue ( double value )
00151   { doubleValue_=value; }
00152   inline double doubleValue () const
00153   { return doubleValue_; }
00155   inline void setStringValue ( std::string value )
00156   { stringValue_=value; }
00157   inline std::string stringValue () const
00158   { return stringValue_; }
00160   int matches (std::string input) const;
00162   inline CbcParameterType type() const
00163   { return type_;}
00165   inline bool displayThis() const
00166   { return display_;}
00168   inline void setLonghelp(const std::string help) 
00169   {longHelp_=help;}
00171   void printLongHelp() const;
00173   void printString() const;
00175   inline int indexNumber() const
00176   { return indexNumber_;}
00177 private:
00179   void gutsOfConstructor();
00181 
00182 private:
00183 
00188   // Type see CbcParameterType
00189   CbcParameterType type_;
00191   double lowerDoubleValue_;
00192   double upperDoubleValue_;
00194   int lowerIntValue_;
00195   int upperIntValue_;
00196   // Length of name
00197   unsigned int lengthName_;
00198   // Minimum match
00199   unsigned int lengthMatch_;
00201   std::vector<std::string> definedKeyWords_;
00203   std::string name_;
00205   std::string shortHelp_;
00207   std::string longHelp_;
00209   CbcParameterType action_;
00211   int currentKeyWord_;
00213   bool display_;
00215   int intValue_;
00217   double doubleValue_;
00219   std::string stringValue_;
00221   int indexNumber_;
00223 };
00224 #endif  /* CbcParam_H */

Generated on Tue Jan 19 03:02:15 2010 by  doxygen 1.4.7