/home/coin/SVN-release/CoinAll-1.1.0/Cbc/src/CbcBranchActual.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2002, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef CbcBranchActual_H
00004 #define CbcBranchActual_H
00005 
00006 #include "CbcBranchBase.hpp"
00007 #include "CoinPackedMatrix.hpp"
00008 class CbcIntegerBranchingObject;
00010 
00011 
00012 class CbcClique : public CbcObject {
00013 
00014 public:
00015 
00016   // Default Constructor 
00017   CbcClique ();
00018 
00023   CbcClique (CbcModel * model, int cliqueType, int numberMembers,
00024              const int * which, const char * type,
00025              int identifier,int slack=-1);
00026   
00027   // Copy constructor 
00028   CbcClique ( const CbcClique &);
00029    
00031   virtual CbcObject * clone() const;
00032 
00033   // Assignment operator 
00034   CbcClique & operator=( const CbcClique& rhs);
00035 
00036   // Destructor 
00037   ~CbcClique ();
00038   
00039   using CbcObject::infeasibility ;
00041   virtual double infeasibility(int & preferredWay) const;
00042 
00043   using CbcObject::feasibleRegion ;
00045   virtual void feasibleRegion();
00046 
00047   using CbcObject::createBranch ;
00049   virtual CbcBranchingObject * createBranch(int way) ;
00051   inline int numberMembers() const
00052   {return numberMembers_;}
00053 
00055   inline int numberNonSOSMembers() const
00056   {return numberNonSOSMembers_;}
00057 
00059   inline const int * members() const
00060   {return members_;}
00061 
00064   inline char type(int index) const
00065   {if (type_) return type_[index]; else return 1;}
00066 
00068   inline int cliqueType() const
00069   {return cliqueType_;}
00071   virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
00072 
00073 protected:
00076   int numberMembers_;
00077 
00079   int numberNonSOSMembers_;
00080 
00082   int * members_;
00083 
00085   char * type_;
00086 
00088    int cliqueType_;
00089 
00091   int slack_;
00092 };
00093 
00101 class CbcSOS : public CbcObject {
00102 
00103 public:
00104 
00105   // Default Constructor 
00106   CbcSOS ();
00107 
00112   CbcSOS (CbcModel * model, int numberMembers,
00113            const int * which, const double * weights, int identifier,
00114           int type=1);
00115   
00116   // Copy constructor 
00117   CbcSOS ( const CbcSOS &);
00118    
00120   virtual CbcObject * clone() const;
00121 
00122   // Assignment operator 
00123   CbcSOS & operator=( const CbcSOS& rhs);
00124 
00125   // Destructor 
00126   ~CbcSOS ();
00127   
00128   using CbcObject::infeasibility ;
00130   virtual double infeasibility(int & preferredWay) const;
00131 
00132   using CbcObject::feasibleRegion ;
00134   virtual void feasibleRegion();
00135 
00136   using CbcObject::createBranch ;
00138   virtual CbcBranchingObject * createBranch(int way) ;
00139 
00140   using CbcObject::solverBranch ;
00145   virtual OsiSolverBranch * solverBranch() const;
00147   virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
00148   
00150   OsiSOS * osiObject(const OsiSolverInterface * solver) const;
00152   inline int numberMembers() const
00153   {return numberMembers_;}
00154 
00156   inline const int * members() const
00157   {return members_;}
00158 
00160   inline int sosType() const
00161   {return sosType_;}
00162 
00164   inline const double * weights() const
00165   { return weights_;}
00166 
00168   inline void setNumberMembers(int n)
00169   {numberMembers_ = n;}
00170 
00172   inline int * mutableMembers() const
00173   {return members_;}
00174 
00176   inline double * mutableWeights() const
00177   { return weights_;}
00178 
00181   virtual bool canDoHeuristics() const 
00182   {return (sosType_==1&&integerValued_);}
00184   inline void setIntegerValued(bool yesNo)
00185   { integerValued_=yesNo;}
00186 private:
00188 
00190   int * members_;
00192   double * weights_;
00193 
00195   int numberMembers_;
00197    int sosType_;
00199   bool integerValued_;
00200 };
00201 
00203 
00204 
00205 class CbcSimpleInteger : public CbcObject {
00206 
00207 public:
00208 
00209   // Default Constructor 
00210   CbcSimpleInteger ();
00211 
00212   // Useful constructor - passed model and index
00213   CbcSimpleInteger (CbcModel * model,  int iColumn, double breakEven=0.5);
00214   
00215   // Useful constructor - passed model and Osi object
00216   CbcSimpleInteger (CbcModel * model,  const OsiSimpleInteger * object);
00217   
00218   // Copy constructor 
00219   CbcSimpleInteger ( const CbcSimpleInteger &);
00220    
00222   virtual CbcObject * clone() const;
00223 
00224   // Assignment operator 
00225   CbcSimpleInteger & operator=( const CbcSimpleInteger& rhs);
00226 
00227   // Destructor 
00228   ~CbcSimpleInteger ();
00230   OsiSimpleInteger * osiObject() const;
00231   using CbcObject::infeasibility ;
00233   virtual double infeasibility(const OsiSolverInterface * solver, 
00234                                const OsiBranchingInformation * info, int & preferredWay) const;
00235 
00236   using CbcObject::feasibleRegion ;
00242   virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
00243 
00244   using CbcObject::createBranch ;
00250   virtual CbcBranchingObject * createBranch(OsiSolverInterface * solver,
00251                                             const OsiBranchingInformation * info, int way) ;
00253   void fillCreateBranch(CbcIntegerBranchingObject * branching, const OsiBranchingInformation * info, int way) ;
00254 
00255   using CbcObject::solverBranch ;
00260   virtual OsiSolverBranch * solverBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
00262   virtual double infeasibility(int & preferredWay) const;
00263 
00270   virtual void feasibleRegion();
00271 
00276   virtual CbcBranchingObject * createBranch(int way) ;
00281   virtual int columnNumber() const;
00283   inline void setColumnNumber(int value)
00284   { columnNumber_ = value;}
00285 
00290   virtual void resetBounds(const OsiSolverInterface * solver) ;
00293   virtual void resetSequenceEtc(int numberColumns, const int * originalColumns) ;
00295   inline double originalLowerBound() const
00296   { return originalLower_;}
00297   inline void setOriginalLowerBound(double value)
00298   { originalLower_=value;}
00299   inline double originalUpperBound() const
00300   { return originalUpper_;}
00301   inline void setOriginalUpperBound(double value)
00302   { originalUpper_=value;}
00304   inline double breakEven() const
00305   { return breakEven_;}
00307   inline void setBreakEven(double value)
00308   { breakEven_=value;}
00309 
00310 
00311 protected:
00313 
00315   double originalLower_;
00317   double originalUpper_;
00319   double breakEven_;
00321   int columnNumber_;
00323   int preferredWay_;
00324 };
00331 class CbcNWay : public CbcObject {
00332 
00333 public:
00334 
00335   // Default Constructor 
00336   CbcNWay ();
00337 
00340   CbcNWay (CbcModel * model, int numberMembers,
00341              const int * which, int identifier);
00342   
00343   // Copy constructor 
00344   CbcNWay ( const CbcNWay &);
00345    
00347   virtual CbcObject * clone() const;
00348 
00350   CbcNWay & operator=( const CbcNWay& rhs);
00351 
00353   ~CbcNWay ();
00354 
00356   void setConsequence(int iColumn, const CbcConsequence & consequence);
00357   
00359   void applyConsequence(int iSequence, int state) const;
00360   
00361   using CbcObject::infeasibility ;
00363   virtual double infeasibility(int & preferredWay) const;
00364 
00365   using CbcObject::feasibleRegion ;
00367   virtual void feasibleRegion();
00368 
00369   using CbcObject::createBranch ;
00371   virtual CbcBranchingObject * createBranch(int way) ;
00372 
00374   inline int numberMembers() const
00375   {return numberMembers_;}
00376 
00378   inline const int * members() const
00379   {return members_;}
00381   virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
00382 
00383 protected:
00386   int numberMembers_;
00387 
00389   int * members_;
00391   CbcConsequence ** consequence_;
00392 };
00393 
00404 class CbcIntegerBranchingObject : public CbcBranchingObject {
00405 
00406 public:
00407 
00409   CbcIntegerBranchingObject ();
00410 
00418   CbcIntegerBranchingObject (CbcModel *model, int variable,
00419                              int way , double value) ;
00420   
00428   CbcIntegerBranchingObject (CbcModel *model, int variable, int way,
00429                              double lowerValue, double upperValue) ;
00430   
00432   CbcIntegerBranchingObject ( const CbcIntegerBranchingObject &);
00433    
00435   CbcIntegerBranchingObject & operator= (const CbcIntegerBranchingObject& rhs);
00436 
00438   virtual CbcBranchingObject * clone() const;
00439 
00441   virtual ~CbcIntegerBranchingObject ();
00442 
00444   void fillPart ( int variable, int way , double value) ;
00445   using CbcBranchingObject::branch ;
00450   virtual double branch();
00451 
00452 #if 0
00453   // No need to override. Default works fine.
00457   virtual void previousBranch();
00458 #endif
00459 
00460   using CbcBranchingObject::print ;
00463   virtual void print();
00464 
00466   inline const double * downBounds() const
00467   { return down_;}
00469   inline const double * upBounds() const
00470   { return up_;}
00472   inline void setDownBounds(const double bounds[2])
00473   { memcpy(down_,bounds,2*sizeof(double));}
00475   inline void setUpBounds(const double bounds[2])
00476   { memcpy(up_,bounds,2*sizeof(double));}
00477 #ifdef FUNNY_BRANCHING
00478 
00480   inline const int * variables() const
00481   { return variables_;}
00482   // New bound
00483   inline const double * newBounds() const
00484   { return newBounds_;}
00486   inline int numberExtraChangedBounds() const
00487   { return numberExtraChangedBounds_;}
00489   int applyExtraBounds(int iColumn, double lower, double upper, int way) ;
00491   void deactivate();
00493   inline bool active() const
00494   { return (down_[1]!=-COIN_DBL_MAX);}
00495 #endif
00496 
00498   virtual int type() const { return 100; }
00499 
00508   virtual CbcRangeCompare compareBranchingObject
00509   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00510 
00511 protected:
00513   double down_[2];
00515   double up_[2];
00516 #ifdef FUNNY_BRANCHING
00517 
00519   int * variables_;
00520   // New bound
00521   double * newBounds_;
00523   int numberExtraChangedBounds_;
00524 #endif
00525 };
00526 
00527 
00529 
00530 
00531 class CbcSimpleIntegerPseudoCost : public CbcSimpleInteger {
00532 
00533 public:
00534 
00535   // Default Constructor 
00536   CbcSimpleIntegerPseudoCost ();
00537 
00538   // Useful constructor - passed model index
00539   CbcSimpleIntegerPseudoCost (CbcModel * model, int iColumn, double breakEven=0.5);
00540   
00541   // Useful constructor - passed and model index and pseudo costs
00542   CbcSimpleIntegerPseudoCost (CbcModel * model, int iColumn, 
00543                               double downPseudoCost, double upPseudoCost);
00544   // Useful constructor - passed and model index and pseudo costs
00545   CbcSimpleIntegerPseudoCost (CbcModel * model, int dummy,int iColumn, 
00546                               double downPseudoCost, double upPseudoCost);
00547   
00548   // Copy constructor 
00549   CbcSimpleIntegerPseudoCost ( const CbcSimpleIntegerPseudoCost &);
00550    
00552   virtual CbcObject * clone() const;
00553 
00554   // Assignment operator 
00555   CbcSimpleIntegerPseudoCost & operator=( const CbcSimpleIntegerPseudoCost& rhs);
00556 
00557   // Destructor 
00558   ~CbcSimpleIntegerPseudoCost ();
00559   
00560   using CbcObject::infeasibility ;
00562   virtual double infeasibility(int & preferredWay) const;
00563 
00564   using CbcObject::createBranch ;
00566   virtual CbcBranchingObject * createBranch(int way) ;
00567 
00569   inline double downPseudoCost() const
00570   { return downPseudoCost_;}
00572   inline void setDownPseudoCost(double value)
00573   { downPseudoCost_=value;}
00574 
00576   inline double upPseudoCost() const
00577   { return upPseudoCost_;}
00579   inline void setUpPseudoCost(double value)
00580   { upPseudoCost_=value;}
00581 
00583   inline double upDownSeparator() const
00584   { return upDownSeparator_;}
00586   inline void setUpDownSeparator(double value)
00587   { upDownSeparator_=value;}
00588 
00590   virtual double upEstimate() const;
00592   virtual double downEstimate() const;
00593   
00595   inline int method() const
00596   { return method_;}
00598   inline void setMethod(int value)
00599   { method_=value;}
00600 
00601 protected:
00603 
00605   double downPseudoCost_;
00607   double upPseudoCost_;
00612   double upDownSeparator_;
00619   int method_;
00620 };
00621 
00622 
00633 class CbcIntegerPseudoCostBranchingObject : public CbcIntegerBranchingObject {
00634 
00635 public:
00636 
00638   CbcIntegerPseudoCostBranchingObject ();
00639 
00647   CbcIntegerPseudoCostBranchingObject (CbcModel *model, int variable,
00648                              int way , double value) ;
00649   
00657   CbcIntegerPseudoCostBranchingObject (CbcModel *model, int variable, int way,
00658                              double lowerValue, double upperValue) ;
00659   
00661   CbcIntegerPseudoCostBranchingObject ( const CbcIntegerPseudoCostBranchingObject &);
00662    
00664   CbcIntegerPseudoCostBranchingObject & operator= (const CbcIntegerPseudoCostBranchingObject& rhs);
00665 
00667   virtual CbcBranchingObject * clone() const;
00668 
00670   virtual ~CbcIntegerPseudoCostBranchingObject ();
00671   
00672   using CbcBranchingObject::branch ;
00677   virtual double branch();
00678 
00680   inline double changeInGuessed() const
00681   { return changeInGuessed_;}
00683   inline void setChangeInGuessed(double value)
00684   { changeInGuessed_=value;}
00685 
00687   virtual int type() const { return 101; }
00688 
00697   virtual CbcRangeCompare compareBranchingObject
00698   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00699 
00700 protected:
00702   double changeInGuessed_;
00703 };
00704 
00705 
00714 class CbcCliqueBranchingObject : public CbcBranchingObject {
00715 
00716 public:
00717 
00718   // Default Constructor 
00719   CbcCliqueBranchingObject ();
00720 
00721   // Useful constructor
00722   CbcCliqueBranchingObject (CbcModel * model,  const CbcClique * clique,
00723                             int way,
00724                             int numberOnDownSide, const int * down,
00725                             int numberOnUpSide, const int * up);
00726   
00727   // Copy constructor 
00728   CbcCliqueBranchingObject ( const CbcCliqueBranchingObject &);
00729    
00730   // Assignment operator 
00731   CbcCliqueBranchingObject & operator=( const CbcCliqueBranchingObject& rhs);
00732 
00734   virtual CbcBranchingObject * clone() const;
00735 
00736   // Destructor 
00737   virtual ~CbcCliqueBranchingObject ();
00738   
00739   using CbcBranchingObject::branch ;
00741   virtual double branch();
00742 
00743 #if 0
00744   // No need to override. Default works fine.
00748   virtual void previousBranch();
00749 #endif
00750 
00751   using CbcBranchingObject::print ;
00754   virtual void print();
00755 
00757   virtual int type() const { return 102; }
00758 
00766   virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
00767 
00776   virtual CbcRangeCompare compareBranchingObject
00777   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00778 
00779 private:
00781   const CbcClique * clique_;
00783   unsigned int downMask_[2];
00785   unsigned int upMask_[2];
00786 };
00787 
00788 
00793 class CbcLongCliqueBranchingObject : public CbcBranchingObject {
00794 
00795 public:
00796 
00797   // Default Constructor 
00798   CbcLongCliqueBranchingObject ();
00799 
00800   // Useful constructor
00801   CbcLongCliqueBranchingObject (CbcModel * model,  const CbcClique * clique,
00802                                  int way,
00803                             int numberOnDownSide, const int * down,
00804                             int numberOnUpSide, const int * up);
00805   
00806   // Copy constructor 
00807   CbcLongCliqueBranchingObject ( const CbcLongCliqueBranchingObject &);
00808    
00809   // Assignment operator 
00810   CbcLongCliqueBranchingObject & operator=( const CbcLongCliqueBranchingObject& rhs);
00811 
00813   virtual CbcBranchingObject * clone() const;
00814 
00815   // Destructor 
00816   virtual ~CbcLongCliqueBranchingObject ();
00817   
00818   using CbcBranchingObject::branch ;
00820   virtual double branch();
00821 
00822 #if 0
00823   // No need to override. Default works fine.
00827   virtual void previousBranch();
00828 #endif
00829 
00830   using CbcBranchingObject::print ;
00833   virtual void print();
00834 
00836   virtual int type() const { return 103; }
00837 
00845   virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
00846 
00855   virtual CbcRangeCompare compareBranchingObject
00856   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00857 
00858 private:
00860   const CbcClique * clique_;
00862   unsigned int * downMask_;
00864   unsigned int * upMask_;
00865 };
00866 
00872 class CbcSOSBranchingObject : public CbcBranchingObject {
00873 
00874 public:
00875 
00876   // Default Constructor 
00877   CbcSOSBranchingObject ();
00878 
00879   // Useful constructor
00880   CbcSOSBranchingObject (CbcModel * model,  const CbcSOS * clique,
00881                             int way,
00882                          double separator);
00883   
00884   // Copy constructor 
00885   CbcSOSBranchingObject ( const CbcSOSBranchingObject &);
00886    
00887   // Assignment operator 
00888   CbcSOSBranchingObject & operator=( const CbcSOSBranchingObject& rhs);
00889 
00891   virtual CbcBranchingObject * clone() const;
00892 
00893   // Destructor 
00894   virtual ~CbcSOSBranchingObject ();
00895   
00896   using CbcBranchingObject::branch ;
00898   virtual double branch();
00899 
00903   virtual void previousBranch() {
00904     CbcBranchingObject::previousBranch();
00905     computeNonzeroRange();
00906   }
00907 
00908   using CbcBranchingObject::print ;
00911   virtual void print();
00912 
00914   virtual int type() const { return 104; }
00915 
00923   virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
00924 
00933   virtual CbcRangeCompare compareBranchingObject
00934   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00935 
00937   void computeNonzeroRange();
00938 
00939 private:
00941   const CbcSOS * set_;
00943   double separator_;
00949   int firstNonzero_;
00950   int lastNonzero_;
00951 };
00952 
00956 class CbcNWayBranchingObject : public CbcBranchingObject {
00957 
00958 public:
00959 
00960   // Default Constructor 
00961   CbcNWayBranchingObject ();
00962 
00967   CbcNWayBranchingObject (CbcModel * model,  const CbcNWay * nway,
00968                           int numberBranches, const int * order);
00969   
00970   // Copy constructor 
00971   CbcNWayBranchingObject ( const CbcNWayBranchingObject &);
00972    
00973   // Assignment operator 
00974   CbcNWayBranchingObject & operator=( const CbcNWayBranchingObject& rhs);
00975 
00977   virtual CbcBranchingObject * clone() const;
00978 
00979   // Destructor 
00980   virtual ~CbcNWayBranchingObject ();
00981   
00982   using CbcBranchingObject::branch ;
00984   virtual double branch();
00985 
00986 #if 0
00987   // FIXME: what do we need to do here?
00991   virtual void previousBranch();
00992 #endif
00993 
00994   using CbcBranchingObject::print ;
00997   virtual void print();
01000   virtual int numberBranches() const
01001   {return numberInSet_;}
01003   virtual bool twoWay() const
01004   { return false;}
01005 
01007   virtual int type() const { return 105; }
01008 
01016   virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
01017 
01026   virtual CbcRangeCompare compareBranchingObject
01027   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
01028 
01029 private:
01031   int * order_;
01033   const CbcNWay * object_;
01035   int numberInSet_;
01036 };
01037 
01044 class CbcBranchDefaultDecision : public CbcBranchDecision {
01045 public:
01046   // Default Constructor 
01047   CbcBranchDefaultDecision ();
01048 
01049   // Copy constructor 
01050   CbcBranchDefaultDecision ( const CbcBranchDefaultDecision &);
01051 
01052   virtual ~CbcBranchDefaultDecision();
01053 
01055   virtual CbcBranchDecision * clone() const;
01056 
01058   virtual void initialize(CbcModel * model);
01059 
01079   virtual int betterBranch(CbcBranchingObject * thisOne,
01080                             CbcBranchingObject * bestSoFar,
01081                             double changeUp, int numInfUp,
01082                             double changeDn, int numInfDn);
01084   virtual void setBestCriterion(double value);
01085   virtual double getBestCriterion() const;
01086 
01093   virtual int
01094   bestBranch (CbcBranchingObject ** objects, int numberObjects, int numberUnsatisfied,
01095               double * changeUp, int * numberInfeasibilitiesUp,
01096               double * changeDown, int * numberInfeasibilitiesDown,
01097               double objectiveValue) ;
01098 private:
01099   
01101   CbcBranchDefaultDecision & operator=(const CbcBranchDefaultDecision& rhs);
01102 
01104 
01106   double bestCriterion_;
01107 
01109   double bestChangeUp_;
01110 
01112   int bestNumberUp_;
01113 
01115   double bestChangeDown_;
01116 
01118   CbcBranchingObject * bestObject_;
01119 
01121   int bestNumberDown_;
01122 
01123 };
01124 
01136 class CbcFollowOn : public CbcObject {
01137 
01138 public:
01139 
01140   // Default Constructor 
01141   CbcFollowOn ();
01142 
01145   CbcFollowOn (CbcModel * model);
01146   
01147   // Copy constructor 
01148   CbcFollowOn ( const CbcFollowOn &);
01149    
01151   virtual CbcObject * clone() const;
01152 
01153   // Assignment operator 
01154   CbcFollowOn & operator=( const CbcFollowOn& rhs);
01155 
01156   // Destructor 
01157   ~CbcFollowOn ();
01158   
01159   using CbcObject::infeasibility ;
01161   virtual double infeasibility(int & preferredWay) const;
01162 
01163   using CbcObject::feasibleRegion ;
01165   virtual void feasibleRegion();
01166 
01167   using CbcObject::createBranch ;
01169   virtual CbcBranchingObject * createBranch(int way) ;
01171   virtual int gutsOfFollowOn(int & otherRow, int & preferredWay) const;
01172 
01173 protected:
01176   CoinPackedMatrix matrix_;
01178   CoinPackedMatrix matrixByRow_; 
01180   int * rhs_;
01181 };
01185 class CbcFixingBranchingObject : public CbcBranchingObject {
01186 
01187 public:
01188 
01189   // Default Constructor 
01190   CbcFixingBranchingObject ();
01191 
01192   // Useful constructor
01193   CbcFixingBranchingObject (CbcModel * model, 
01194                             int way,
01195                             int numberOnDownSide, const int * down,
01196                             int numberOnUpSide, const int * up);
01197   
01198   // Copy constructor 
01199   CbcFixingBranchingObject ( const CbcFixingBranchingObject &);
01200    
01201   // Assignment operator 
01202   CbcFixingBranchingObject & operator=( const CbcFixingBranchingObject& rhs);
01203 
01205   virtual CbcBranchingObject * clone() const;
01206 
01207   // Destructor 
01208   virtual ~CbcFixingBranchingObject ();
01209   
01210   using CbcBranchingObject::branch ;
01212   virtual double branch();
01213 
01214 #if 0
01215   // No need to override. Default works fine.
01219   virtual void previousBranch();
01220 #endif
01221 
01222   using CbcBranchingObject::print ;
01225   virtual void print();
01226 
01228   virtual int type() const { return 106; }
01229 
01237   virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
01238 
01247   virtual CbcRangeCompare compareBranchingObject
01248   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
01249 
01250 private:
01253   int numberDown_;
01255   int numberUp_;
01257   int * downList_;
01259   int * upList_;
01260 };
01271 class CbcFixVariable : public CbcConsequence {
01272 
01273 public:
01274 
01275   // Default Constructor 
01276   CbcFixVariable ();
01277 
01278   // One useful Constructor 
01279   CbcFixVariable (int numberStates,const int * states, const int * numberNewLower, const int ** newLowerValue,
01280                   const int ** lowerColumn,
01281                   const int * numberNewUpper, const int ** newUpperValue,
01282                   const int ** upperColumn);
01283 
01284   // Copy constructor 
01285   CbcFixVariable ( const CbcFixVariable & rhs);
01286    
01287   // Assignment operator 
01288   CbcFixVariable & operator=( const CbcFixVariable & rhs);
01289 
01291   virtual CbcConsequence * clone() const;
01292 
01294   virtual ~CbcFixVariable ();
01295 
01298   virtual void applyToSolver(OsiSolverInterface * solver, int state) const;
01299   
01300 protected:
01302   int numberStates_;
01304   int * states_;
01306   int * startLower_;
01308   int * startUpper_;
01310   double * newBound_;
01312   int * variable_;
01313 };
01320 class CbcDummyBranchingObject : public CbcBranchingObject {
01321 
01322 public:
01323 
01325   CbcDummyBranchingObject (CbcModel * model=NULL);
01326 
01328   CbcDummyBranchingObject ( const CbcDummyBranchingObject &);
01329    
01331   CbcDummyBranchingObject & operator= (const CbcDummyBranchingObject& rhs);
01332 
01334   virtual CbcBranchingObject * clone() const;
01335 
01337   virtual ~CbcDummyBranchingObject ();
01338   
01339   using CbcBranchingObject::branch ;
01342   virtual double branch();
01343 
01344 #if 0
01345   // No need to override. Default works fine.
01349   virtual void previousBranch();
01350 #endif
01351 
01352   using CbcBranchingObject::print ;
01355   virtual void print();
01356 
01358   virtual int type() const { return 107; }
01359 
01367   virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
01368 
01377   virtual CbcRangeCompare compareBranchingObject
01378   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
01379 
01380 };
01381 
01382 
01383 #endif

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