Cbc  2.10.7
CbcBranchDynamic.hpp
Go to the documentation of this file.
1 /* $Id$ */
2 // Copyright (C) 2005, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef CbcBranchDynamic_H
7 #define CbcBranchDynamic_H
8 
9 #include "CoinPackedMatrix.hpp"
11 #include "CbcBranchActual.hpp"
12 
20 public:
21  // Default Constructor
23 
24  // Copy constructor
26 
28 
30  virtual CbcBranchDecision *clone() const;
31 
33  virtual void initialize(CbcModel *model);
34 
54  virtual int betterBranch(CbcBranchingObject *thisOne,
55  CbcBranchingObject *bestSoFar,
56  double changeUp, int numInfUp,
57  double changeDn, int numInfDn);
59  virtual void setBestCriterion(double value);
60  virtual double getBestCriterion() const;
63  virtual int whichMethod()
64  {
65  return 3;
66  }
67 
70  virtual void saveBranchingObject(OsiBranchingObject *object);
73  virtual void updateInformation(OsiSolverInterface *solver,
74  const CbcNode *node);
75 
76 private:
79 
81 
84 
86  double bestChangeUp_;
87 
90 
93 
96 
99 };
111 
112 public:
115 
124  int way, double value,
126 
135  double lowerValue, double upperValue);
136 
139 
142 
144  virtual CbcBranchingObject *clone() const;
145 
148 
150  void fillPart(int variable,
151  int way, double value,
153 
159  virtual double branch();
160 
165  virtual int fillStrongInfo(CbcStrongInfo &info);
166 
168  inline double changeInGuessed() const
169  {
170  return changeInGuessed_;
171  }
173  inline void setChangeInGuessed(double value)
174  {
175  changeInGuessed_ = value;
176  }
179  {
180  return object_;
181  }
184  {
185  object_ = object;
186  }
187 
189  virtual CbcBranchObjType type() const
190  {
192  }
193 
194  // LL: compareOriginalObject and compareBranchingObject are inherited from
195  // CbcIntegerBranchingObject thus need not be declared/defined here. After
196  // all, this kind of branching object is simply using pseudocosts to make
197  // decisions, but once the decisions are made they are the same kind as in
198  // the underlying class.
199 
200 protected:
205 };
206 
207 #endif
208 
209 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
210 */
CbcBranchObjType
@ DynamicPseudoCostBranchObj
Branching decision dynamic class.
CbcBranchDynamicDecision & operator=(const CbcBranchDynamicDecision &rhs)
Illegal Assignment operator.
int bestNumberUp_
Number of infeasibilities for up.
CbcBranchingObject * bestObject_
Pointer to best branching object.
virtual double getBestCriterion() const
virtual void setBestCriterion(double value)
Sets or gets best criterion so far.
virtual ~CbcBranchDynamicDecision()
CbcBranchDynamicDecision(const CbcBranchDynamicDecision &)
virtual CbcBranchDecision * clone() const
Clone.
double bestChangeUp_
Change up for best.
virtual void updateInformation(OsiSolverInterface *solver, const CbcNode *node)
Pass in information on branch just done.
virtual void initialize(CbcModel *model)
Initialize, e.g. before the start of branch selection at a node.
int bestNumberDown_
Number of infeasibilities for down.
virtual int betterBranch(CbcBranchingObject *thisOne, CbcBranchingObject *bestSoFar, double changeUp, int numInfUp, double changeDn, int numInfDn)
Compare two branching objects.
double bestChangeDown_
Change down for best.
virtual void saveBranchingObject(OsiBranchingObject *object)
Saves a clone of current branching object.
virtual int whichMethod()
Says whether this method can handle both methods - 1 better, 2 best, 3 both.
Abstract branching object base class Now just difference with OsiBranchingObject.
CbcModel * model() const
Return model.
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object,...
int variable() const
Index identifying the associated CbcObject within its class.
int way() const
Get the state of the branching object.
Simple branching object for an integer variable with pseudo costs.
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
virtual ~CbcDynamicPseudoCostBranchingObject()
Destructor.
virtual double branch()
Sets the bounds for the variable according to the current arm of the branch and advances the object s...
virtual CbcBranchingObject * clone() const
Clone.
double changeInGuessed() const
Change in guessed.
CbcDynamicPseudoCostBranchingObject()
Default constructor.
CbcSimpleIntegerDynamicPseudoCost * object() const
Return object.
void setChangeInGuessed(double value)
Set change in guessed.
virtual int fillStrongInfo(CbcStrongInfo &info)
Some branchingObjects may claim to be able to skip strong branching.
CbcSimpleIntegerDynamicPseudoCost * object_
Pointer back to object.
double changeInGuessed_
Change in guessed objective value for next branch.
CbcDynamicPseudoCostBranchingObject(const CbcDynamicPseudoCostBranchingObject &)
Copy constructor.
void setObject(CbcSimpleIntegerDynamicPseudoCost *object)
Set object.
CbcDynamicPseudoCostBranchingObject(CbcModel *model, int variable, int way, double lowerValue, double upperValue)
Create a degenerate branch object.
CbcDynamicPseudoCostBranchingObject(CbcModel *model, int variable, int way, double value, CbcSimpleIntegerDynamicPseudoCost *object)
Create a standard floor/ceiling branch object.
CbcDynamicPseudoCostBranchingObject & operator=(const CbcDynamicPseudoCostBranchingObject &rhs)
Assignment operator.
void fillPart(int variable, int way, double value, CbcSimpleIntegerDynamicPseudoCost *object)
Does part of constructor.
Simple branching object for an integer variable.
Simple Branch and bound class.
Definition: CbcModel.hpp:100
Information required while the node is live.
Definition: CbcNode.hpp:49
Define a single integer class but with dynamic pseudo costs.
Abstract base class for ‘objects’.
Definition: CbcObject.hpp:51