CbcClique.hpp
Go to the documentation of this file.
1 // Edwin 11/9/2009-- carved out of CbcBranchActual
2 #ifndef CbcClique_H
3 #define CbcClique_H
4 
34 
36 class CbcClique : public CbcObject {
37 
38 public:
39 
40  // Default Constructor
41  CbcClique ();
42 
48  const int * which, const char * type,
49  int identifier, int slack = -1);
50 
51  // Copy constructor
52  CbcClique ( const CbcClique &);
53 
55  virtual CbcObject * clone() const;
56 
57  // Assignment operator
58  CbcClique & operator=( const CbcClique& rhs);
59 
60  // Destructor
61  virtual ~CbcClique ();
62 
64  virtual double infeasibility(const OsiBranchingInformation * info,
65  int &preferredWay) const;
66 
69  virtual void feasibleRegion();
70 
72  virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
74  inline int numberMembers() const {
75  return numberMembers_;
76  }
83  inline int numberNonSOSMembers() const {
84  return numberNonSOSMembers_;
85  }
86 
88  inline const int * members() const {
89  return members_;
90  }
91 
101  inline char type(int index) const {
102  if (type_) return type_[index];
103  else return 1;
104  }
105 
107  inline int cliqueType() const {
108  return cliqueType_;
109  }
111  virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
112 
113 protected:
116  int numberMembers_;
117 
120 
122  int * members_;
123 
133  char * type_;
134 
140  int cliqueType_;
141 
148  int slack_;
149 };
150 
160 
161 public:
162 
163  // Default Constructor
165 
166  // Useful constructor
168  int way,
169  int numberOnDownSide, const int * down,
170  int numberOnUpSide, const int * up);
171 
172  // Copy constructor
174 
175  // Assignment operator
177 
179  virtual CbcBranchingObject * clone() const;
180 
181  // Destructor
182  virtual ~CbcCliqueBranchingObject ();
183 
186  virtual double branch();
187 
191  virtual void print();
192 
194  virtual CbcBranchObjType type() const {
195  return CliqueBranchObj;
196  }
197 
205  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
206 
216  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
217 
218 private:
220  const CbcClique * clique_;
222  unsigned int downMask_[2];
224  unsigned int upMask_[2];
225 };
226 
232 
233 public:
234 
235  // Default Constructor
237 
238  // Useful constructor
240  int way,
241  int numberOnDownSide, const int * down,
242  int numberOnUpSide, const int * up);
243 
244  // Copy constructor
246 
247  // Assignment operator
249 
251  virtual CbcBranchingObject * clone() const;
252 
253  // Destructor
255 
258  virtual double branch();
259 
263  virtual void print();
264 
266  virtual CbcBranchObjType type() const {
267  return LongCliqueBranchObj;
268  }
269 
277  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
278 
288  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
289 
290 private:
292  const CbcClique * clique_;
294  unsigned int * downMask_;
296  unsigned int * upMask_;
297 };
298 
299 #endif
300 
Abstract branching object base class Now just difference with OsiBranchingObject. ...
unsigned int upMask_[2]
upMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:224
unsigned int * upMask_
upMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:296
CbcRangeCompare
virtual CbcBranchingObject * clone() const
Clone.
virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
Creates a branching object.
int cliqueType() const
Clique type - 0 <=, 1 ==.
Definition: CbcClique.hpp:107
virtual void print() const
Print something about branch - only if log level high.
virtual ~CbcClique()
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
virtual CbcObject * clone() const
Clone.
int numberNonSOSMembers() const
Number of variables with -1 coefficient.
Definition: CbcClique.hpp:83
virtual double branch()
Does next branch and updates state.
const int * members() const
Members (indices in range 0 ... numberIntegers_-1)
Definition: CbcClique.hpp:88
virtual ~CbcCliqueBranchingObject()
CbcBranchObjType
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcClique.hpp:266
virtual void redoSequenceEtc(CbcModel *model, int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
int slack_
Slack variable for the clique.
Definition: CbcClique.hpp:148
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
const CbcClique * clique_
data
Definition: CbcClique.hpp:292
virtual void feasibleRegion()=0
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
char type(int index) const
Type of each member, i.e.
Definition: CbcClique.hpp:101
int numberMembers_
data Number of members
Definition: CbcClique.hpp:116
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
Definition: CbcObject.hpp:235
CbcClique & operator=(const CbcClique &rhs)
char * type_
Strong value for each member.
Definition: CbcClique.hpp:133
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcClique.hpp:194
CbcLongCliqueBranchingObject & operator=(const CbcLongCliqueBranchingObject &rhs)
int cliqueType_
Clique type.
Definition: CbcClique.hpp:140
int way() const
Get the state of the branching object.
virtual double infeasibility(const OsiBranchingInformation *info, int &preferredWay) const
Infeasibility - large is 0.5.
const CbcClique * clique_
data
Definition: CbcClique.hpp:220
CbcModel * model() const
Return model.
Definition: CbcObject.hpp:230
virtual CbcBranchingObject * clone() const
Clone.
Unordered Clique Branching Object class.
Definition: CbcClique.hpp:231
CbcCliqueBranchingObject & operator=(const CbcCliqueBranchingObject &rhs)
virtual void feasibleRegion()
This looks at solution and sets bounds to contain solution.
int * members_
Members (indices in range 0 ... numberIntegers_-1)
Definition: CbcClique.hpp:122
Branching object for unordered cliques.
Definition: CbcClique.hpp:159
virtual void print()
Print something about branch - only if log level high.
unsigned int * downMask_
downMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:294
int numberMembers() const
Number of members.
Definition: CbcClique.hpp:74
int numberNonSOSMembers_
Number of Non SOS members i.e. fixing to zero is strong.
Definition: CbcClique.hpp:119
unsigned int downMask_[2]
downMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:222
CbcModel * model() const
Return model.
virtual double branch()
Does next branch and updates state.
Branching object for cliques.
Definition: CbcClique.hpp:36
Simple Branch and bound class.
Definition: CbcModel.hpp:98
virtual void print()
Print something about branch - only if log level high.
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object...