/home/coin/SVN-release/Cbc-1.1.1/Cbc/src/CbcBranchLotsize.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2004, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef CbcBranchLotsize_H
00004 #define CbcBranchLotsize_H
00005 
00006 #include "CbcBranchBase.hpp"
00007 
00011 class CbcLotsize : public CbcObject {
00012 
00013 public:
00014 
00015   // Default Constructor 
00016   CbcLotsize ();
00017 
00018   /* Useful constructor - passed model index.
00019      Also passed valid values - if range then pairs
00020   */
00021   CbcLotsize (CbcModel * model, int iColumn,
00022               int numberPoints, const double * points, bool range=false);
00023   
00024   // Copy constructor 
00025   CbcLotsize ( const CbcLotsize &);
00026    
00028   virtual CbcObject * clone() const;
00029 
00030   // Assignment operator 
00031   CbcLotsize & operator=( const CbcLotsize& rhs);
00032 
00033   // Destructor 
00034   ~CbcLotsize ();
00035   
00037   virtual double infeasibility(int & preferredWay) const;
00038 
00046   virtual void feasibleRegion();
00047 
00049   virtual CbcBranchingObject * createBranch(int way) ;
00050 
00064   virtual CbcBranchingObject * preferredNewFeasible() const;
00065   
00073   virtual CbcBranchingObject * notPreferredNewFeasible() const ;
00074   
00080   virtual void resetBounds();
00081 
00085   bool findRange(double value) const;
00086   
00089   virtual void floorCeiling(double & floorLotsize, double & ceilingLotsize, double value,
00090                             double tolerance) const;
00091   
00093   inline int modelSequence() const
00094   {return columnNumber_;};
00095 
00100   virtual int columnNumber() const;
00102   inline double originalLowerBound() const
00103   { return bound_[0];};
00104   inline double originalUpperBound() const
00105   { return bound_[rangeType_*numberRanges_-1];};
00107   inline int rangeType() const
00108   { return rangeType_;};
00110   inline int numberRanges() const
00111   { return numberRanges_;};
00113   inline double * bound() const
00114   { return bound_;};
00115 
00116 private:
00118   void printLotsize(double value,bool condition,int type) const;
00119 
00120 private:
00122 
00124   int columnNumber_;
00126   int rangeType_;
00128   int numberRanges_;
00129   // largest gap
00130   double largestGap_;
00132   double * bound_;
00134   mutable int range_;
00135 };
00136 
00137 
00148 class CbcLotsizeBranchingObject : public CbcBranchingObject {
00149 
00150 public:
00151 
00153   CbcLotsizeBranchingObject ();
00154 
00162   CbcLotsizeBranchingObject (CbcModel *model, int variable,
00163                              int way , double value,const CbcLotsize * lotsize) ;
00164   
00171   CbcLotsizeBranchingObject (CbcModel *model, int variable, int way,
00172                              double lowerValue, double upperValue) ;
00173   
00175   CbcLotsizeBranchingObject ( const CbcLotsizeBranchingObject &);
00176    
00178   CbcLotsizeBranchingObject & operator= (const CbcLotsizeBranchingObject& rhs);
00179 
00181   virtual CbcBranchingObject * clone() const;
00182 
00184   virtual ~CbcLotsizeBranchingObject ();
00185   
00189   virtual double branch(bool normalBranch=false);
00190 
00193   virtual void print(bool normalBranch);
00194 
00195 protected:
00197   double down_[2];
00199   double up_[2];
00200 };
00201 
00202 
00203 #endif

Generated on Thu May 15 21:59:04 2008 by  doxygen 1.4.7