Dip-All  0.91.0
CbcClique.hpp
Go to the documentation of this file.
1 // $Id: CbcClique.hpp 1899 2013-04-09 18:12:08Z stefan $
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:
44 
46  CbcClique ();
47 
52  const int * which, const char * type,
53  int identifier, int slack = -1);
54 
56  CbcClique ( const CbcClique &);
57 
59  virtual CbcObject * clone() const;
60 
62  CbcClique & operator=( const CbcClique& rhs);
63 
65  virtual ~CbcClique ();
66 
68  virtual double infeasibility(const OsiBranchingInformation * info,
69  int &preferredWay) const;
70 
73  virtual void feasibleRegion();
74 
76  virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
78  inline int numberMembers() const {
79  return numberMembers_;
80  }
86  inline int numberNonSOSMembers() const {
87  return numberNonSOSMembers_;
88  }
89 
91  inline const int * members() const {
92  return members_;
93  }
94 
104  inline char type(int index) const {
105  if (type_) return type_[index];
106  else return 1;
107  }
108 
110  inline int cliqueType() const {
111  return cliqueType_;
112  }
114  virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
115 
116 protected:
120 
123 
125  int * members_;
126 
136  char * type_;
137 
144 
151  int slack_;
152 };
153 
163 
164 public:
165 
166  // Default Constructor
168 
169  // Useful constructor
171  int way,
172  int numberOnDownSide, const int * down,
173  int numberOnUpSide, const int * up);
174 
175  // Copy constructor
177 
178  // Assignment operator
180 
182  virtual CbcBranchingObject * clone() const;
183 
184  // Destructor
185  virtual ~CbcCliqueBranchingObject ();
186 
189  virtual double branch();
190 
194  virtual void print();
195 
197  virtual CbcBranchObjType type() const {
198  return CliqueBranchObj;
199  }
200 
208  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
209 
219  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
220 
221 private:
225  unsigned int downMask_[2];
227  unsigned int upMask_[2];
228 };
229 
235 
236 public:
237 
238  // Default Constructor
240 
241  // Useful constructor
243  int way,
244  int numberOnDownSide, const int * down,
245  int numberOnUpSide, const int * up);
246 
247  // Copy constructor
249 
250  // Assignment operator
252 
254  virtual CbcBranchingObject * clone() const;
255 
256  // Destructor
258 
261  virtual double branch();
262 
266  virtual void print();
267 
269  virtual CbcBranchObjType type() const {
270  return LongCliqueBranchObj;
271  }
272 
280  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
281 
291  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
292 
293 private:
297  unsigned int * downMask_;
299  unsigned int * upMask_;
300 };
301 
302 #endif
303 
Abstract branching object base class Now just difference with OsiBranchingObject. ...
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 is <=, 1 is ==.
Definition: CbcClique.hpp:110
virtual void print() const
Print something about branch - only if log level high.
virtual ~CbcClique()
Destructor.
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
const CbcClique * clique_
data
Definition: CbcClique.hpp:223
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:86
virtual double branch()
Does next branch and updates state.
const int * members() const
Members (indices in range 0 ... numberIntegers_-1)
Definition: CbcClique.hpp:91
double infeasibility() const
Return infeasibility.
virtual ~CbcCliqueBranchingObject()
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcClique.hpp:269
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:151
char * type_
Strong value for each member.
Definition: CbcClique.hpp:136
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
int * members_
Members (indices in range 0 ... numberIntegers_-1)
Definition: CbcClique.hpp:125
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
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., which way is strong.
Definition: CbcClique.hpp:104
int numberMembers_
data Number of members
Definition: CbcClique.hpp:119
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
Definition: CbcObject.hpp:245
unsigned int * downMask_
downMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:297
unsigned int upMask_[2]
upMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:227
CbcClique()
Default Constructor.
CbcClique & operator=(const CbcClique &rhs)
Assignment operator.
Abstract Base Class for describing an interface to a solver.
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcClique.hpp:197
unsigned int * upMask_
upMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:299
CbcLongCliqueBranchingObject & operator=(const CbcLongCliqueBranchingObject &rhs)
int cliqueType_
Clique type.
Definition: CbcClique.hpp:143
const CbcClique * clique_
data
Definition: CbcClique.hpp:295
int way() const
Get the state of the branching object.
CbcModel * model() const
Return model.
Definition: CbcObject.hpp:240
virtual CbcBranchingObject * clone() const
Clone.
Unordered Clique Branching Object class.
Definition: CbcClique.hpp:234
CbcCliqueBranchingObject & operator=(const CbcCliqueBranchingObject &rhs)
virtual void feasibleRegion()
This looks at solution and sets bounds to contain solution.
Branching object for unordered cliques.
Definition: CbcClique.hpp:162
virtual void print()
Print something about branch - only if log level high.
CbcBranchObjType
int numberMembers() const
Number of members.
Definition: CbcClique.hpp:78
unsigned int downMask_[2]
downMask - bit set to fix to weak bounds, not set to leave unfixed
Definition: CbcClique.hpp:225
int numberNonSOSMembers_
Number of Non SOS members i.e. fixing to zero is strong.
Definition: CbcClique.hpp:122
CbcModel * model() const
Return model.
virtual double branch()
Does next branch and updates state.
Branching object for cliques.
Definition: CbcClique.hpp:41
Simple Branch and bound class.
Definition: CbcModel.hpp:101
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...