CbcNWay.hpp
Go to the documentation of this file.
1 // Edwin 11/9/2009-- carved out of CbcBranchActual
6 #ifndef CbcNWay_H
7 #define CbcNWay_H
8 
9 class CbcNWay : public CbcObject {
10 
11 public:
12 
13  // Default Constructor
14  CbcNWay ();
15 
19  const int * which, int identifier);
20 
21  // Copy constructor
22  CbcNWay ( const CbcNWay &);
23 
25  virtual CbcObject * clone() const;
26 
28  CbcNWay & operator=( const CbcNWay& rhs);
29 
31  virtual ~CbcNWay ();
32 
34  void setConsequence(int iColumn, const CbcConsequence & consequence);
35 
37  void applyConsequence(int iSequence, int state) const;
38 
40  virtual double infeasibility(const OsiBranchingInformation * info,
41  int &preferredWay) const;
42 
45  virtual void feasibleRegion();
46 
48  virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
49 
51  inline int numberMembers() const {
52  return numberMembers_;
53  }
54 
56  inline const int * members() const {
57  return members_;
58  }
60  virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
61 
62 protected:
65  int numberMembers_;
66 
68  int * members_;
71 };
76 
77 public:
78 
79  // Default Constructor
81 
87  int numberBranches, const int * order);
88 
89  // Copy constructor
91 
92  // Assignment operator
94 
96  virtual CbcBranchingObject * clone() const;
97 
98  // Destructor
99  virtual ~CbcNWayBranchingObject ();
100 
103  virtual double branch();
104 
105 #ifdef JJF_ZERO
106  // FIXME: what do we need to do here?
110  virtual void previousBranch();
111 #endif
112 
116  virtual void print();
119  virtual int numberBranches() const {
120  return numberInSet_;
121  }
123  virtual bool twoWay() const {
124  return false;
125  }
126 
128  virtual CbcBranchObjType type() const {
129  return NWayBranchObj;
130  }
131 
139  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
140 
150  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
151 
152 private:
154  int * order_;
156  const CbcNWay * object_;
158  int numberInSet_;
159 };
160 #endif