CbcFollowOn.hpp
Go to the documentation of this file.
1 // Edwin 11/10/2009-- carved out of CbcBranchActual
2 #ifndef CbcFollowOn_H
3 #define CbcFollowOn_H
4 
5 #include "CbcBranchBase.hpp"
6 #include "CoinPackedMatrix.hpp"
7 
17 class CbcFollowOn : public CbcObject {
18 
19 public:
20 
21  // Default Constructor
22  CbcFollowOn ();
23 
27 
28  // Copy constructor
29  CbcFollowOn ( const CbcFollowOn &);
30 
32  virtual CbcObject * clone() const;
33 
34  // Assignment operator
35  CbcFollowOn & operator=( const CbcFollowOn& rhs);
36 
37  // Destructor
38  ~CbcFollowOn ();
39 
41  virtual double infeasibility(const OsiBranchingInformation * info,
42  int &preferredWay) const;
43 
46  virtual void feasibleRegion();
47 
49  virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
51  virtual int gutsOfFollowOn(int & otherRow, int & preferredWay) const;
52 
53 protected:
56  CoinPackedMatrix matrix_;
58  CoinPackedMatrix matrixByRow_;
60  int * rhs_;
61 };
62 
67 
68 public:
69 
70  // Default Constructor
72 
73  // Useful constructor
75  int way,
76  int numberOnDownSide, const int * down,
77  int numberOnUpSide, const int * up);
78 
79  // Copy constructor
81 
82  // Assignment operator
84 
86  virtual CbcBranchingObject * clone() const;
87 
88  // Destructor
89  virtual ~CbcFixingBranchingObject ();
90 
93  virtual double branch();
94 
95 #ifdef JJF_ZERO
96  // No need to override. Default works fine.
100  virtual void previousBranch();
101 #endif
102 
106  virtual void print();
107 
109  virtual CbcBranchObjType type() const {
110  return FollowOnBranchObj;
111  }
112 
120  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
121 
131  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
132 
133 private:
140  int * downList_;
142  int * upList_;
143 };
144 
145 #endif
146 
Abstract branching object base class Now just difference with OsiBranchingObject. ...
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
CbcRangeCompare
virtual CbcBranchingObject * clone() const
Clone.
General Branching Object class.
Definition: CbcFollowOn.hpp:66
int * rhs_
Possible rhs (if 0 then not possible)
Definition: CbcFollowOn.hpp:60
virtual void print() const
Print something about branch - only if log level high.
int * upList_
upList - variables to fix to lb on up branch
int numberUp_
Number on up list.
CbcFollowOn & operator=(const CbcFollowOn &rhs)
CbcBranchObjType
virtual double infeasibility(const OsiBranchingInformation *info, int &preferredWay) const
Infeasibility - large is 0.5.
virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
Creates a branching object.
virtual double branch()
Does next branch and updates state.
CbcFixingBranchingObject & operator=(const CbcFixingBranchingObject &rhs)
Define a follow on class.
Definition: CbcFollowOn.hpp:17
int * downList_
downList - variables to fix to lb on down branch
virtual void feasibleRegion()=0
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
virtual void print()
Print something about branch - only if log level high.
virtual void feasibleRegion()
This looks at solution and sets bounds to contain solution.
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
Definition: CbcObject.hpp:235
CoinPackedMatrix matrix_
data Matrix
Definition: CbcFollowOn.hpp:56
CoinPackedMatrix matrixByRow_
Matrix by row.
Definition: CbcFollowOn.hpp:58
virtual ~CbcFixingBranchingObject()
virtual int gutsOfFollowOn(int &otherRow, int &preferredWay) const
As some computation is needed in more than one place - returns row.
virtual void previousBranch()
Reset every information so that the branching object appears to point to the previous child...
int way() const
Get the state of the branching object.
CbcModel * model() const
Return model.
Definition: CbcObject.hpp:230
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
int numberDown_
data Number on down list
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
CbcModel * model() const
Return model.
Simple Branch and bound class.
Definition: CbcModel.hpp:98
virtual CbcObject * clone() const
Clone.
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object...