/home/coin/SVN-release/CoinAll-1.1.0/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   
00036   using CbcObject::infeasibility ;
00038   virtual double infeasibility(int & preferredWay) const;
00039 
00040   using CbcObject::feasibleRegion ;
00048   virtual void feasibleRegion();
00049 
00050   using CbcObject::createBranch ;
00052   virtual CbcBranchingObject * createBranch(int way) ;
00053 
00067   virtual CbcBranchingObject * preferredNewFeasible() const;
00068   
00076   virtual CbcBranchingObject * notPreferredNewFeasible() const ;
00077   
00083   virtual void resetBounds(const OsiSolverInterface * solver);
00084 
00088   bool findRange(double value) const;
00089   
00092   virtual void floorCeiling(double & floorLotsize, double & ceilingLotsize, double value,
00093                             double tolerance) const;
00094   
00096   inline int modelSequence() const
00097   {return columnNumber_;}
00098 
00103   virtual int columnNumber() const;
00105   inline double originalLowerBound() const
00106   { return bound_[0];}
00107   inline double originalUpperBound() const
00108   { return bound_[rangeType_*numberRanges_-1];}
00110   inline int rangeType() const
00111   { return rangeType_;}
00113   inline int numberRanges() const
00114   { return numberRanges_;}
00116   inline double * bound() const
00117   { return bound_;}
00120   virtual bool canDoHeuristics() const 
00121   {return false;}
00122 
00123 private:
00125   void printLotsize(double value,bool condition,int type) const;
00126 
00127 private:
00129 
00131   int columnNumber_;
00133   int rangeType_;
00135   int numberRanges_;
00136   // largest gap
00137   double largestGap_;
00139   double * bound_;
00141   mutable int range_;
00142 };
00143 
00144 
00155 class CbcLotsizeBranchingObject : public CbcBranchingObject {
00156 
00157 public:
00158 
00160   CbcLotsizeBranchingObject ();
00161 
00169   CbcLotsizeBranchingObject (CbcModel *model, int variable,
00170                              int way , double value,const CbcLotsize * lotsize) ;
00171   
00178   CbcLotsizeBranchingObject (CbcModel *model, int variable, int way,
00179                              double lowerValue, double upperValue) ;
00180   
00182   CbcLotsizeBranchingObject ( const CbcLotsizeBranchingObject &);
00183    
00185   CbcLotsizeBranchingObject & operator= (const CbcLotsizeBranchingObject& rhs);
00186 
00188   virtual CbcBranchingObject * clone() const;
00189 
00191   virtual ~CbcLotsizeBranchingObject ();
00192   
00193   using CbcBranchingObject::branch ;
00197   virtual double branch();
00198 
00199 #if 0
00200   // No need to override. Default works fine.
00204   virtual void previousBranch();
00205 #endif
00206 
00207   using CbcBranchingObject::print ;
00210   virtual void print();
00211 
00213   virtual int type() const { return 300; }
00214 
00215   // LL: compareOriginalObject can be inherited from the CbcBranchingObject
00216   // since variable_ uniquely defines the lot sizing object.
00217 
00226   virtual CbcRangeCompare compareBranchingObject
00227   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00228 
00229 protected:
00231   double down_[2];
00233   double up_[2];
00234 };
00235 
00236 
00237 #endif

Generated on Sun Nov 14 14:06:30 2010 for Coin-All by  doxygen 1.4.7