CbcBranchCut.hpp
Go to the documentation of this file.
1 /* $Id: CbcBranchCut.hpp 1389 2009-12-10 15:17:35Z caphillSNL $ */
2 // Copyright (C) 2004, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef CbcBranchCut_H
5 #define CbcBranchCut_H
6 
7 #include "CbcBranchBase.hpp"
8 #include "OsiRowCut.hpp"
9 #include "CoinPackedMatrix.hpp"
10 
15 class CbcBranchCut : public CbcObject {
16 
17 public:
18 
19  // Default Constructor
20  CbcBranchCut ();
21 
25  // Copy constructor
26  CbcBranchCut ( const CbcBranchCut &);
27 
29  virtual CbcObject * clone() const;
30 
31  // Assignment operator
32  CbcBranchCut & operator=( const CbcBranchCut& rhs);
33 
34  // Destructor
35  ~CbcBranchCut ();
36 
38  virtual double infeasibility(const OsiBranchingInformation * info,
39  int &preferredWay) const;
40 
51  virtual void feasibleRegion();
52 
55  virtual bool boundBranch() const ;
56 
58  virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
59 
75  virtual CbcBranchingObject * preferredNewFeasible() const;
76 
87 
94  virtual void resetBounds();
95 
96 
97 protected:
99 
100 };
107 
108 public:
109 
112 
118  CbcCutBranchingObject (CbcModel * model, OsiRowCut & down, OsiRowCut &up, bool canFix);
119 
122 
125 
127  virtual CbcBranchingObject * clone() const;
128 
130  virtual ~CbcCutBranchingObject ();
131 
137  virtual double branch();
138 
142  virtual void print();
143 
146  virtual bool boundBranch() const;
147 
149  virtual CbcBranchObjType type() const {
150  return CutBranchingObj;
151  }
152 
160  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
161 
171  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
172 
173 protected:
175  OsiRowCut down_;
177  OsiRowCut up_;
179  bool canFix_;
180 };
181 #endif
bool canFix_
True if one way can fix variables.
virtual void feasibleRegion()
Set bounds to contain the current solution.
Abstract branching object base class Now just difference with OsiBranchingObject. ...
virtual bool boundBranch() const
Return true if branch should fix variables.
CbcRangeCompare
virtual CbcBranchingObject * notPreferredNewFeasible() const
Given a valid solution (with reduced costs, etc.), return a branching object which would give a new f...
virtual void print() const
Print something about branch - only if log level high.
virtual double infeasibility(const OsiBranchingInformation *info, int &preferredWay) const
Infeasibility.
virtual double branch()
Sets the bounds for variables or adds a cut depending on the current arm of the branch and advances t...
CbcCutBranchingObject()
Default constructor.
CbcBranchObjType
virtual CbcBranchingObject * clone() const
Clone.
OsiRowCut down_
Cut for the down arm (way_ = -1)
virtual void resetBounds(const OsiSolverInterface *)
Reset variable bounds to their original values.
Definition: CbcObject.hpp:179
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
CbcBranchCut & operator=(const CbcBranchCut &rhs)
virtual bool boundBranch() const
Return true if branch created by object should fix variables.
virtual void feasibleRegion()=0
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
Definition: CbcObject.hpp:235
virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
Creates a branching object.
virtual void print()
Print something about branch - only if log level high.
Define a cut branching class.
Cut branching object.
CbcModel * model() const
Return model.
Definition: CbcObject.hpp:230
virtual CbcBranchingObject * preferredNewFeasible() const
Given a valid solution (with reduced costs, etc.), return a branching object which would give a new f...
virtual void resetBounds()
Reset original upper and lower bound values from the solver.
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
OsiRowCut up_
Cut for the up arm (way_ = 1)
virtual ~CbcCutBranchingObject()
Destructor.
virtual CbcObject * clone() const
Clone.
CbcCutBranchingObject & operator=(const CbcCutBranchingObject &rhs)
Assignment operator.
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 double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object...