Go to the documentation of this file.00001
00002
00003
00004 #ifndef CbcBranchLotsize_H
00005 #define CbcBranchLotsize_H
00006
00007 #include "CbcBranchBase.hpp"
00011 class CbcLotsize : public CbcObject {
00012
00013 public:
00014
00015
00016 CbcLotsize ();
00017
00018
00019
00020
00021 CbcLotsize (CbcModel * model, int iColumn,
00022 int numberPoints, const double * points, bool range = false);
00023
00024
00025 CbcLotsize ( const CbcLotsize &);
00026
00028 virtual CbcObject * clone() const;
00029
00030
00031 CbcLotsize & operator=( const CbcLotsize& rhs);
00032
00033
00034 ~CbcLotsize ();
00035
00037 virtual double infeasibility(const OsiBranchingInformation * info,
00038 int &preferredWay) const;
00039
00040 using CbcObject::feasibleRegion ;
00048 virtual void feasibleRegion();
00049
00051 virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
00052
00066 virtual CbcBranchingObject * preferredNewFeasible() const;
00067
00075 virtual CbcBranchingObject * notPreferredNewFeasible() const ;
00076
00082 virtual void resetBounds(const OsiSolverInterface * solver);
00083
00087 bool findRange(double value) const;
00088
00091 virtual void floorCeiling(double & floorLotsize, double & ceilingLotsize, double value,
00092 double tolerance) const;
00093
00095 inline int modelSequence() const {
00096 return columnNumber_;
00097 }
00099 inline void setModelSequence(int value) {
00100 columnNumber_ = value;
00101 }
00102
00107 virtual int columnNumber() const;
00109 inline double originalLowerBound() const {
00110 return bound_[0];
00111 }
00112 inline double originalUpperBound() const {
00113 return bound_[rangeType_*numberRanges_-1];
00114 }
00116 inline int rangeType() const {
00117 return rangeType_;
00118 }
00120 inline int numberRanges() const {
00121 return numberRanges_;
00122 }
00124 inline double * bound() const {
00125 return bound_;
00126 }
00129 virtual bool canDoHeuristics() const {
00130 return false;
00131 }
00132
00133 private:
00135 void printLotsize(double value, bool condition, int type) const;
00136
00137 private:
00139
00141 int columnNumber_;
00143 int rangeType_;
00145 int numberRanges_;
00146
00147 double largestGap_;
00149 double * bound_;
00151 mutable int range_;
00152 };
00153
00164 class CbcLotsizeBranchingObject : public CbcBranchingObject {
00165
00166 public:
00167
00169 CbcLotsizeBranchingObject ();
00170
00178 CbcLotsizeBranchingObject (CbcModel *model, int variable,
00179 int way , double value, const CbcLotsize * lotsize) ;
00180
00187 CbcLotsizeBranchingObject (CbcModel *model, int variable, int way,
00188 double lowerValue, double upperValue) ;
00189
00191 CbcLotsizeBranchingObject ( const CbcLotsizeBranchingObject &);
00192
00194 CbcLotsizeBranchingObject & operator= (const CbcLotsizeBranchingObject& rhs);
00195
00197 virtual CbcBranchingObject * clone() const;
00198
00200 virtual ~CbcLotsizeBranchingObject ();
00201
00202 using CbcBranchingObject::branch ;
00206 virtual double branch();
00207
00208 using CbcBranchingObject::print ;
00211 virtual void print();
00212
00214 virtual CbcBranchObjType type() const {
00215 return LotsizeBranchObj;
00216 }
00217
00218
00219
00220
00229 virtual CbcRangeCompare compareBranchingObject
00230 (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00231
00232 protected:
00234 double down_[2];
00236 double up_[2];
00237 };
00238
00239 #endif
00240