Cbc  trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CbcBranchDynamic.hpp
Go to the documentation of this file.
00001 /* $Id$ */
00002 // Copyright (C) 2005, International Business Machines
00003 // Corporation and others.  All Rights Reserved.
00004 // This code is licensed under the terms of the Eclipse Public License (EPL).
00005 
00006 #ifndef CbcBranchDynamic_H
00007 #define CbcBranchDynamic_H
00008 
00009 #include "CoinPackedMatrix.hpp"
00010 #include "CbcSimpleIntegerDynamicPseudoCost.hpp"
00011 #include "CbcBranchActual.hpp"
00012 
00019 class CbcBranchDynamicDecision : public CbcBranchDecision {
00020 public:
00021     // Default Constructor
00022     CbcBranchDynamicDecision ();
00023 
00024     // Copy constructor
00025     CbcBranchDynamicDecision ( const CbcBranchDynamicDecision &);
00026 
00027     virtual ~CbcBranchDynamicDecision();
00028 
00030     virtual CbcBranchDecision * clone() const;
00031 
00033     virtual void initialize(CbcModel * model);
00034 
00054     virtual int betterBranch(CbcBranchingObject * thisOne,
00055                              CbcBranchingObject * bestSoFar,
00056                              double changeUp, int numInfUp,
00057                              double changeDn, int numInfDn);
00059     virtual void setBestCriterion(double value);
00060     virtual double getBestCriterion() const;
00063     virtual int whichMethod() {
00064         return 3;
00065     }
00066 
00069     virtual void saveBranchingObject(OsiBranchingObject * object) ;
00072     virtual void updateInformation(OsiSolverInterface * solver,
00073                                    const CbcNode * node);
00074 
00075 
00076 private:
00077 
00079     CbcBranchDynamicDecision & operator=(const CbcBranchDynamicDecision& rhs);
00080 
00082 
00084     double bestCriterion_;
00085 
00087     double bestChangeUp_;
00088 
00090     int bestNumberUp_;
00091 
00093     double bestChangeDown_;
00094 
00096     int bestNumberDown_;
00097 
00099     CbcBranchingObject * bestObject_;
00100 };
00111 class CbcDynamicPseudoCostBranchingObject : public CbcIntegerBranchingObject {
00112 
00113 public:
00114 
00116     CbcDynamicPseudoCostBranchingObject ();
00117 
00125     CbcDynamicPseudoCostBranchingObject (CbcModel *model, int variable,
00126                                          int way , double value,
00127                                          CbcSimpleIntegerDynamicPseudoCost * object) ;
00128 
00136     CbcDynamicPseudoCostBranchingObject (CbcModel *model, int variable, int way,
00137                                          double lowerValue, double upperValue) ;
00138 
00140     CbcDynamicPseudoCostBranchingObject ( const CbcDynamicPseudoCostBranchingObject &);
00141 
00143     CbcDynamicPseudoCostBranchingObject & operator= (const CbcDynamicPseudoCostBranchingObject& rhs);
00144 
00146     virtual CbcBranchingObject * clone() const;
00147 
00149     virtual ~CbcDynamicPseudoCostBranchingObject ();
00150 
00152     void fillPart (int variable,
00153                    int way , double value,
00154                    CbcSimpleIntegerDynamicPseudoCost * object) ;
00155 
00156     using CbcBranchingObject::branch ;
00161     virtual double branch();
00162 
00167     virtual int fillStrongInfo( CbcStrongInfo & info);
00168 
00170     inline double changeInGuessed() const {
00171         return changeInGuessed_;
00172     }
00174     inline void setChangeInGuessed(double value) {
00175         changeInGuessed_ = value;
00176     }
00178     inline CbcSimpleIntegerDynamicPseudoCost * object() const {
00179         return object_;
00180     }
00182     inline void setObject(CbcSimpleIntegerDynamicPseudoCost * object) {
00183         object_ = object;
00184     }
00185 
00187     virtual CbcBranchObjType type() const {
00188         return DynamicPseudoCostBranchObj;
00189     }
00190 
00191     // LL: compareOriginalObject and compareBranchingObject are inherited from
00192     // CbcIntegerBranchingObject thus need not be declared/defined here. After
00193     // all, this kind of branching object is simply using pseudocosts to make
00194     // decisions, but once the decisions are made they are the same kind as in
00195     // the underlying class.
00196 
00197 protected:
00199     double changeInGuessed_;
00201     CbcSimpleIntegerDynamicPseudoCost * object_;
00202 
00203 };
00204 
00205 #endif
00206 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines