Cbc  2.10.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbcClique.hpp
Go to the documentation of this file.
1 // $Id: CbcClique.hpp 2465 2019-01-03 19:26:52Z unxusr $
2 // Copyright (C) 2002, 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 // Edwin 11/9/2009-- carved out of CbcBranchActual
7 
8 #ifndef CbcClique_H
9 #define CbcClique_H
10 
41 class CbcClique : public CbcObject {
42 
43 public:
45  CbcClique();
46 
51  const int *which, const char *type,
52  int identifier, int slack = -1);
53 
55  CbcClique(const CbcClique &);
56 
58  virtual CbcObject *clone() const;
59 
61  CbcClique &operator=(const CbcClique &rhs);
62 
64  virtual ~CbcClique();
65 
67  virtual double infeasibility(const OsiBranchingInformation *info,
68  int &preferredWay) const;
69 
72  virtual void feasibleRegion();
73 
75  virtual CbcBranchingObject *createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way);
77  inline int numberMembers() const
78  {
79  return numberMembers_;
80  }
86  inline int numberNonSOSMembers() const
87  {
88  return numberNonSOSMembers_;
89  }
90 
92  inline const int *members() const
93  {
94  return members_;
95  }
96 
106  inline char type(int index) const
107  {
108  if (type_)
109  return type_[index];
110  else
111  return 1;
112  }
113 
115  inline int cliqueType() const
116  {
117  return cliqueType_;
118  }
120  virtual void redoSequenceEtc(CbcModel *model, int numberColumns, const int *originalColumns);
121 
122 protected:
126 
129 
131  int *members_;
132 
142  char *type_;
143 
150 
157  int slack_;
158 };
159 
169 
170 public:
171  // Default Constructor
173 
174  // Useful constructor
176  int way,
177  int numberOnDownSide, const int *down,
178  int numberOnUpSide, const int *up);
179 
180  // Copy constructor
182 
183  // Assignment operator
185 
187  virtual CbcBranchingObject *clone() const;
188 
189  // Destructor
190  virtual ~CbcCliqueBranchingObject();
191 
194  virtual double branch();
195 
199  virtual void print();
200 
202  virtual CbcBranchObjType type() const
203  {
204  return CliqueBranchObj;
205  }
206 
214  virtual int compareOriginalObject(const CbcBranchingObject *brObj) const;
215 
224  virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap = false);
225 
226 private:
230  unsigned int downMask_[2];
232  unsigned int upMask_[2];
233 };
234 
240 
241 public:
242  // Default Constructor
244 
245  // Useful constructor
247  int way,
248  int numberOnDownSide, const int *down,
249  int numberOnUpSide, const int *up);
250 
251  // Copy constructor
253 
254  // Assignment operator
256 
258  virtual CbcBranchingObject *clone() const;
259 
260  // Destructor
262 
265  virtual double branch();
266 
270  virtual void print();
271 
273  virtual CbcBranchObjType type() const
274  {
275  return LongCliqueBranchObj;
276  }
277 
285  virtual int compareOriginalObject(const CbcBranchingObject *brObj) const;
286 
295  virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap = false);
296 
297 private:
301  unsigned int *downMask_;
303  unsigned int *upMask_;
304 };
305 
306 #endif
307 
308 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
309 */
const CbcClique * clique_
data
Definition: CbcClique.hpp:299
Unordered Clique Branching Object class.
Definition: CbcClique.hpp:239
virtual void redoSequenceEtc(CbcModel *model, int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
Branching object for cliques.
Definition: CbcClique.hpp:41
virtual ~CbcClique()
Destructor.
virtual void feasibleRegion()=0
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
int * members_
Members (indices in range 0 ... numberIntegers_-1)
Definition: CbcClique.hpp:131
virtual double branch()
Does next branch and updates state.
virtual void feasibleRegion()
This looks at solution and sets bounds to contain solution.
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
CbcRangeCompare
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
virtual CbcObject * clone() const
Clone.
int numberMembers() const
Number of members.
Definition: CbcClique.hpp:77
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
virtual void print()
Print something about branch - only if log level high.
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
Definition: CbcObject.hpp:258
Abstract Base Class for describing an interface to a solver.
virtual CbcBranchingObject * clone() const
Clone.
CbcCliqueBranchingObject & operator=(const CbcCliqueBranchingObject &rhs)
virtual CbcBranchingObject * clone() const
Clone.
double infeasibility() const
Return infeasibility.
int slack_
Slack variable for the clique.
Definition: CbcClique.hpp:157
virtual void print()
Print something about branch - only if log level high.
CbcModel * model() const
Return model.
Definition: CbcObject.hpp:252
const int * members() const
Members (indices in range 0 ... numberIntegers_-1)
Definition: CbcClique.hpp:92
int way() const
Get the state of the branching object.
Abstract branching object base class Now just difference with OsiBranchingObject. ...
int cliqueType_
Clique type.
Definition: CbcClique.hpp:149
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcClique.hpp:273
int numberMembers_
data Number of members
Definition: CbcClique.hpp:125
unsigned int * upMask_
upMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:303
CbcBranchObjType
int numberNonSOSMembers() const
Number of variables with -1 coefficient.
Definition: CbcClique.hpp:86
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...
char type(int index) const
Type of each member, i.e., which way is strong.
Definition: CbcClique.hpp:106
char * type_
Strong value for each member.
Definition: CbcClique.hpp:142
virtual void print() const
Print something about branch - only if log level high.
virtual ~CbcCliqueBranchingObject()
CbcClique()
Default Constructor.
int numberNonSOSMembers_
Number of Non SOS members i.e. fixing to zero is strong.
Definition: CbcClique.hpp:128
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcClique.hpp:202
CbcLongCliqueBranchingObject & operator=(const CbcLongCliqueBranchingObject &rhs)
CbcClique & operator=(const CbcClique &rhs)
Assignment operator.
virtual double branch()
Does next branch and updates state.
int cliqueType() const
Clique type: 0 is <=, 1 is ==.
Definition: CbcClique.hpp:115
Branching object for unordered cliques.
Definition: CbcClique.hpp:168
Simple Branch and bound class.
Definition: CbcModel.hpp:100
unsigned int upMask_[2]
upMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:232
virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
Creates a branching object.
unsigned int * downMask_
downMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:301
const CbcClique * clique_
data
Definition: CbcClique.hpp:228
unsigned int downMask_[2]
downMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:230