Dip  0.92.4
CbcBranchCut.hpp
Go to the documentation of this file.
1 /* $Id: CbcBranchCut.hpp 2465 2019-01-03 19:26:52Z unxusr $ */
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  // Default Constructor
21  CbcBranchCut();
22 
26  // Copy constructor
27  CbcBranchCut(const CbcBranchCut &);
28 
30  virtual CbcObject *clone() const;
31 
32  // Assignment operator
33  CbcBranchCut &operator=(const CbcBranchCut &rhs);
34 
35  // Destructor
36  ~CbcBranchCut();
37 
39  virtual double infeasibility(const OsiBranchingInformation *info,
40  int &preferredWay) const;
41 
52  virtual void feasibleRegion();
53 
56  virtual bool boundBranch() const;
57 
59  virtual CbcBranchingObject *createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way);
60 
77 
88 
95  virtual void resetBounds();
96 
97 protected:
99 };
106 
107 public:
110 
116  CbcCutBranchingObject(CbcModel *model, OsiRowCut &down, OsiRowCut &up, bool canFix);
117 
120 
123 
125  virtual CbcBranchingObject *clone() const;
126 
128  virtual ~CbcCutBranchingObject();
129 
135  virtual double branch();
136 
140  virtual void print();
141 
144  virtual bool boundBranch() const;
145 
147  virtual CbcBranchObjType type() const
148  {
149  return CutBranchingObj;
150  }
151 
159  virtual int compareOriginalObject(const CbcBranchingObject *brObj) const;
160 
169  virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap = false);
170 
171 protected:
177  bool canFix_;
178 };
179 #endif
180 
181 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
182 */
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...
Row Cut Class.
Definition: OsiRowCut.hpp:29
virtual void print() const
Print something about branch - only if log level high.
virtual double branch()
Sets the bounds for variables or adds a cut depending on the current arm of the branch and advances t...
double infeasibility() const
Return infeasibility.
CbcCutBranchingObject()
Default constructor.
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:195
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:258
virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
Creates a branching object.
Abstract Base Class for describing an interface to a solver.
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:252
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.
CbcBranchObjType
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:100
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object...