Cbc  2.9.9
CbcBranchCut.hpp
Go to the documentation of this file.
1 /* $Id: CbcBranchCut.hpp 1573 2011-01-05 01:12:36Z lou $ */
2 // Copyright (C) 2004, 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 CbcBranchCut_H
7 #define CbcBranchCut_H
8 
9 #include "CbcBranchBase.hpp"
10 #include "OsiRowCut.hpp"
11 #include "CoinPackedMatrix.hpp"
12 
17 class CbcBranchCut : public CbcObject {
18 
19 public:
20 
21  // Default Constructor
23 
27  // Copy constructor
29 
31  virtual CbcObject * clone() const;
32 
33  // Assignment operator
35 
36  // Destructor
38 
40  virtual double infeasibility(const OsiBranchingInformation * info,
41  int &preferredWay) const;
42 
53  virtual void feasibleRegion();
54 
57  virtual bool boundBranch() const ;
58 
60  virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
61 
78 
89 
96  virtual void resetBounds();
97 
98 
99 protected:
101 
102 };
109 
110 public:
111 
114 
120  CbcCutBranchingObject (CbcModel * model, OsiRowCut & down, OsiRowCut &up, bool canFix);
121 
124 
127 
129  virtual CbcBranchingObject * clone() const;
130 
133 
139  virtual double branch();
140 
144  virtual void print();
145 
148  virtual bool boundBranch() const;
149 
151  virtual CbcBranchObjType type() const {
152  return CutBranchingObj;
153  }
154 
162  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
163 
173  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
174 
175 protected:
177  OsiRowCut down_;
179  OsiRowCut up_;
181  bool canFix_;
182 };
183 #endif
CbcCutBranchingObject::~CbcCutBranchingObject
virtual ~CbcCutBranchingObject()
Destructor.
CbcCutBranchingObject::CbcCutBranchingObject
CbcCutBranchingObject(CbcModel *model, OsiRowCut &down, OsiRowCut &up, bool canFix)
Create a cut branching object.
CbcObject::preferredWay
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
Definition: CbcObject.hpp:245
CbcObject::feasibleRegion
virtual void feasibleRegion()=0
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
CbcCutBranchingObject::up_
OsiRowCut up_
Cut for the up arm (way_ = 1)
Definition: CbcBranchCut.hpp:179
CbcBranchingObject::branch
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object,...
CbcCutBranchingObject::CbcCutBranchingObject
CbcCutBranchingObject(const CbcCutBranchingObject &)
Copy constructor.
CbcBranchCut::~CbcBranchCut
~CbcBranchCut()
CbcCutBranchingObject::CbcCutBranchingObject
CbcCutBranchingObject()
Default constructor.
CbcCutBranchingObject::canFix_
bool canFix_
True if one way can fix variables.
Definition: CbcBranchCut.hpp:181
CbcCutBranchingObject::branch
virtual double branch()
Sets the bounds for variables or adds a cut depending on the current arm of the branch and advances t...
CbcCutBranchingObject::operator=
CbcCutBranchingObject & operator=(const CbcCutBranchingObject &rhs)
Assignment operator.
CbcBranchCut
Define a cut branching class.
Definition: CbcBranchCut.hpp:17
CbcBranchCut::CbcBranchCut
CbcBranchCut()
CbcCutBranchingObject::type
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcBranchCut.hpp:151
CbcCutBranchingObject::compareBranchingObject
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
CbcModel
Simple Branch and bound class.
Definition: CbcModel.hpp:101
CbcBranchCut::CbcBranchCut
CbcBranchCut(CbcModel *model)
In to maintain normal methods.
CbcCutBranchingObject
Cut branching object.
Definition: CbcBranchCut.hpp:108
CbcBranchingObject::print
virtual void print() const
Print something about branch - only if log level high.
Definition: CbcBranchingObject.hpp:130
CbcBranchCut::createCbcBranch
virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
Creates a branching object.
CbcBranchCut::infeasibility
virtual double infeasibility(const OsiBranchingInformation *info, int &preferredWay) const
Infeasibility.
CbcBranchingObject
Abstract branching object base class Now just difference with OsiBranchingObject.
Definition: CbcBranchingObject.hpp:53
CbcObject
Definition: CbcObject.hpp:67
CbcBranchBase.hpp
CbcCutBranchingObject::compareOriginalObject
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
CbcObject::model
CbcModel * model() const
Return model.
Definition: CbcObject.hpp:240
CbcBranchCut::CbcBranchCut
CbcBranchCut(const CbcBranchCut &)
CbcObject::resetBounds
virtual void resetBounds(const OsiSolverInterface *)
Reset variable bounds to their original values.
Definition: CbcObject.hpp:189
CbcBranchCut::resetBounds
virtual void resetBounds()
Reset original upper and lower bound values from the solver.
CbcRangeCompare
CbcRangeCompare
Definition: CbcBranchBase.hpp:13
CbcCutBranchingObject::down_
OsiRowCut down_
Cut for the down arm (way_ = -1)
Definition: CbcBranchCut.hpp:177
CbcCutBranchingObject::boundBranch
virtual bool boundBranch() const
Return true if branch should fix variables.
CbcCutBranchingObject::clone
virtual CbcBranchingObject * clone() const
Clone.
CbcBranchCut::operator=
CbcBranchCut & operator=(const CbcBranchCut &rhs)
CbcBranchCut::feasibleRegion
virtual void feasibleRegion()
Set bounds to contain the current solution.
CbcBranchCut::preferredNewFeasible
virtual CbcBranchingObject * preferredNewFeasible() const
Given a valid solution (with reduced costs, etc.), return a branching object which would give a new f...
CbcBranchObjType
CbcBranchObjType
Definition: CbcBranchingObject.hpp:19
CbcBranchingObject::model
CbcModel * model() const
Return model.
Definition: CbcBranchingObject.hpp:171
CbcCutBranchingObject::print
virtual void print()
Print something about branch - only if log level high.
CutBranchingObj
@ CutBranchingObj
Definition: CbcBranchingObject.hpp:30
CbcBranchCut::clone
virtual CbcObject * clone() const
Clone.
CbcBranchCut::boundBranch
virtual bool boundBranch() const
Return true if branch created by object should fix variables.
CbcBranchCut::notPreferredNewFeasible
virtual CbcBranchingObject * notPreferredNewFeasible() const
Given a valid solution (with reduced costs, etc.), return a branching object which would give a new f...