Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbcNWay.hpp
Go to the documentation of this file.
1 // $Id: CbcNWay.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 
12 #ifndef CbcNWay_H
13 #define CbcNWay_H
14 
15 class CbcNWay : public CbcObject {
16 
17 public:
18 
19  // Default Constructor
20  CbcNWay ();
21 
25  const int * which, int identifier);
26 
27  // Copy constructor
28  CbcNWay ( const CbcNWay &);
29 
31  virtual CbcObject * clone() const;
32 
34  CbcNWay & operator=( const CbcNWay& rhs);
35 
37  virtual ~CbcNWay ();
38 
40  void setConsequence(int iColumn, const CbcConsequence & consequence);
41 
43  void applyConsequence(int iSequence, int state) const;
44 
46  virtual double infeasibility(const OsiBranchingInformation * info,
47  int &preferredWay) const;
48 
51  virtual void feasibleRegion();
52 
54  virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
55 
57  inline int numberMembers() const {
58  return numberMembers_;
59  }
60 
62  inline const int * members() const {
63  return members_;
64  }
66  virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
67 
68 protected:
72 
74  int * members_;
77 };
82 
83 public:
84 
85  // Default Constructor
87 
93  int numberBranches, const int * order);
94 
95  // Copy constructor
97 
98  // Assignment operator
100 
102  virtual CbcBranchingObject * clone() const;
103 
104  // Destructor
105  virtual ~CbcNWayBranchingObject ();
106 
109  virtual double branch();
110 
111 #ifdef JJF_ZERO
112  // FIXME: what do we need to do here?
116  virtual void previousBranch();
117 #endif
118 
122  virtual void print();
125  virtual int numberBranches() const {
126  return numberInSet_;
127  }
129  virtual bool twoWay() const {
130  return false;
131  }
132 
134  virtual CbcBranchObjType type() const {
135  return NWayBranchObj;
136  }
137 
145  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
146 
156  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
157 
158 private:
160  int * order_;
162  const CbcNWay * object_;
165 };
166 #endif
virtual void feasibleRegion()=0
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
const int * members() const
Members (indices in range 0 ... numberColumns-1)
Definition: CbcNWay.hpp:62
virtual CbcObject * clone() const
Clone.
virtual void redoSequenceEtc(CbcModel *model, int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
CbcRangeCompare
virtual double branch()
Does next branch and updates state.
virtual void feasibleRegion()
This looks at solution and sets bounds to contain solution.
void setConsequence(int iColumn, const CbcConsequence &consequence)
Set up a consequence for a single member.
void applyConsequence(int iSequence, int state) const
Applies a consequence for a single member.
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
Definition: CbcObject.hpp:245
Abstract Base Class for describing an interface to a solver.
Define an n-way class for variables.
Definition: CbcNWay.hpp:15
virtual bool twoWay() const
Is this a two way object (-1 down, +1 up)
Definition: CbcNWay.hpp:129
double infeasibility() const
Return infeasibility.
virtual ~CbcNWayBranchingObject()
CbcNWayBranchingObject & operator=(const CbcNWayBranchingObject &rhs)
const CbcNWay * object_
Points back to object.
Definition: CbcNWay.hpp:162
virtual int numberBranches() const
The number of branch arms created for this branching object.
Definition: CbcNWay.hpp:125
CbcModel * model() const
Return model.
Definition: CbcObject.hpp:240
virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
Creates a branching object.
int * members_
Members (indices in range 0 ... numberColumns-1)
Definition: CbcNWay.hpp:74
virtual ~CbcNWay()
Destructor.
Abstract branching object base class Now just difference with OsiBranchingObject. ...
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcNWay.hpp:134
int numberMembers() const
Number of members.
Definition: CbcNWay.hpp:57
virtual void previousBranch()
Reset every information so that the branching object appears to point to the previous child...
Abstract base class for consequent bounds.
CbcBranchObjType
N way branching Object class.
Definition: CbcNWay.hpp:81
CbcConsequence ** consequence_
Consequences (normally NULL)
Definition: CbcNWay.hpp:76
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
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...
virtual void print() const
Print something about branch - only if log level high.
CbcNWay & operator=(const CbcNWay &rhs)
Assignment operator.
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
int numberInSet_
Number in set.
Definition: CbcNWay.hpp:164
int numberMembers_
data Number of members
Definition: CbcNWay.hpp:71
virtual CbcBranchingObject * clone() const
Clone.
Simple Branch and bound class.
Definition: CbcModel.hpp:101
int * order_
order of branching - points back to CbcNWay
Definition: CbcNWay.hpp:160
virtual void print()
Print something about branch - only if log level high.