Ignore:
Timestamp:
Nov 5, 2009 10:57:25 AM (10 years ago)
Author:
forrest
Message:

Creating new stable branch 2.4 from trunk (rev 1270)

Location:
stable/2.4
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable/2.4

    • Property svn:externals
      •  

        old new  
        77CoinUtils         https://projects.coin-or.org/svn/CoinUtils/stable/2.5/CoinUtils
        88Cgl               https://projects.coin-or.org/svn/Cgl/stable/0.54/Cgl
        9 Clp               https://projects.coin-or.org/svn/Clp/stable/1.10/Clp
         9Clp               https://projects.coin-or.org/svn/Clp/stable/1.11/Clp
        1010Osi               https://projects.coin-or.org/svn/Osi/stable/0.100/Osi
        1111Vol               https://projects.coin-or.org/svn/Vol/stable/1.1/Vol
  • stable/2.4/Cbc/src/CbcTreeLocal.hpp

    r706 r1271  
     1/* $Id$ */
    12// Copyright (C) 2004, International Business Machines
    23// Corporation and others.  All Rights Reserved.
     
    188189
    189190};
     191
     192class CbcTreeVariable : public CbcTree {
     193
     194public:
     195
     196  // Default Constructor
     197  CbcTreeVariable ();
     198
     199  /* Constructor with solution.
     200     If solution NULL no solution, otherwise must be integer
     201     range is initial upper bound (k) on difference from given solution.
     202     typeCuts -
     203              0 means just 0-1 cuts and will need to refine 0-1 solution
     204              1 uses weaker cuts on all integer variables
     205     maxDiversification is maximum number of range widenings to try
     206     timeLimit is seconds in subTree
     207     nodeLimit is nodes in subTree
     208     refine is whether to see if we can prove current solution is optimal
     209     when we fix all 0-1 (in case typeCuts==0 and there are general integer variables)
     210     if false then no refinement but reverse cuts weaker
     211  */
     212  CbcTreeVariable (CbcModel * model,const double * solution ,int range=10,
     213                   int typeCuts=0,int maxDiversification=0,
     214                   int timeLimit=1000000, int nodeLimit=1000000,bool refine=true);
     215  // Copy constructor
     216  CbcTreeVariable ( const CbcTreeVariable & rhs);
     217
     218  // = operator
     219  CbcTreeVariable & operator=(const CbcTreeVariable & rhs);
     220   
     221  virtual ~CbcTreeVariable();
     222
     223  /// Clone
     224  virtual CbcTree * clone() const;
     225  /// Create C++ lines to get to current state
     226  virtual void generateCpp( FILE * fp) ;
     227
     228/*! \name Heap access and maintenance methods */
     229//@{
     230
     231  /// Return the top node of the heap
     232  virtual CbcNode * top() const;
     233
     234  /// Add a node to the heap
     235  virtual void push(CbcNode * x);
     236
     237  /// Remove the top node from the heap
     238  virtual void pop() ;
     239
     240//@}
     241/*! \name Other stuff */
     242//@{
     243
     244  /// Create cut - return -1 if bad, 0 if okay and 1 if cut is everything
     245  int createCut(const double * solution, OsiRowCut & cut);
     246
     247  /// Test if empty *** note may be overridden
     248  virtual bool empty() ;
     249
     250  /// We may have got an intelligent tree so give it one more chance
     251  virtual void endSearch() ;
     252  /// Other side of last cut branch (if bias==rhs_ will be weakest possible)
     253  void reverseCut(int state, double bias=0.0);
     254  /// Delete last cut branch
     255  void deleteCut(OsiRowCut & cut);
     256  /// Pass in solution (so can be used after heuristic)
     257  void passInSolution(const double * solution, double solutionValue);
     258  // range i.e. k
     259  inline int range() const
     260  { return range_;}
     261  // setrange i.e. k
     262  inline void setRange(int value)
     263  { range_ = value;}
     264  // Type of cuts - 0=just 0-1, 1=all
     265  inline int typeCuts() const
     266  { return typeCuts_;}
     267  // Type of cuts - 0=just 0-1, 1=all
     268  inline void setTypeCuts(int value)
     269  { typeCuts_ = value;}
     270  // maximum number of diversifications
     271  inline int maxDiversification() const
     272  { return maxDiversification_;}
     273  // maximum number of diversifications
     274  inline void setMaxDiversification(int value)
     275  { maxDiversification_ = value;}
     276  // time limit per subtree
     277  inline int timeLimit() const
     278  { return timeLimit_;}
     279  // time limit per subtree
     280  inline void setTimeLimit(int value)
     281  { timeLimit_ = value;}
     282  // node limit for subtree
     283  inline int nodeLimit() const
     284  { return nodeLimit_;}
     285  // node limit for subtree
     286  inline void setNodeLimit(int value)
     287  { nodeLimit_ = value;}
     288  // Whether to do refinement step
     289  inline bool refine() const
     290  { return refine_;}
     291  // Whether to do refinement step
     292  inline void setRefine(bool yesNo)
     293    { refine_ = yesNo;}
     294
     295//@}
     296private:
     297  // Node for local cuts
     298  CbcNode * localNode_;
     299  // best solution
     300  double * bestSolution_;
     301  // saved solution
     302  double * savedSolution_;
     303  // solution number at start of pass
     304  int saveNumberSolutions_;
     305  /* Cut.  If zero size then no solution yet.  Otherwise is left hand branch */
     306  OsiRowCut cut_;
     307  // This cut fixes all 0-1 variables
     308  OsiRowCut fixedCut_;
     309  // Model
     310  CbcModel * model_;
     311  // Original lower bounds
     312  double * originalLower_;
     313  // Original upper bounds
     314  double * originalUpper_;
     315  // range i.e. k
     316  int range_;
     317  // Type of cuts - 0=just 0-1, 1=all
     318  int typeCuts_;
     319  // maximum number of diversifications
     320  int maxDiversification_;
     321  // current diversification
     322  int diversification_;
     323  // Whether next will be strong diversification
     324  bool nextStrong_;
     325  // Current rhs
     326  double rhs_;
     327  // Save allowable gap
     328  double savedGap_;
     329  // Best solution
     330  double bestCutoff_;
     331  // time limit per subtree
     332  int timeLimit_;
     333  // time when subtree started
     334  int startTime_;
     335  // node limit for subtree
     336  int nodeLimit_;
     337  // node count when subtree started
     338  int startNode_;
     339  // -1 not started, 0 == stop on first solution, 1 don't stop on first, 2 refinement step
     340  int searchType_;
     341  // Whether to do refinement step
     342  bool refine_;
     343
     344};
    190345#endif
    191346
Note: See TracChangeset for help on using the changeset viewer.