Cbc 2.10.11
Loading...
Searching...
No Matches
CbcNWay.hpp
Go to the documentation of this file.
1// $Id$
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
15class CbcNWay : public CbcObject {
16
17public:
18 // Default Constructor
20
24 const int *which, int identifier);
25
26 // Copy constructor
27 CbcNWay(const CbcNWay &);
28
30 virtual CbcObject *clone() const;
31
34
36 virtual ~CbcNWay();
37
39 void setConsequence(int iColumn, const CbcConsequence &consequence);
40
42 void applyConsequence(int iSequence, int state) const;
43
45 virtual double infeasibility(const OsiBranchingInformation *info,
46 int &preferredWay) const;
47
50 virtual void feasibleRegion();
51
53 virtual CbcBranchingObject *createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way);
54
56 inline int numberMembers() const
57 {
58 return numberMembers_;
59 }
60
62 inline const int *members() const
63 {
64 return members_;
65 }
67 virtual void redoSequenceEtc(CbcModel *model, int numberColumns, const int *originalColumns);
68
69protected:
73
78};
83
84public:
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
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 {
127 return numberInSet_;
128 }
130 virtual bool twoWay() const
131 {
132 return false;
133 }
134
136 virtual CbcBranchObjType type() const
137 {
138 return NWayBranchObj;
139 }
140
148 virtual int compareOriginalObject(const CbcBranchingObject *brObj) const;
149
158 virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap = false);
159
160private:
162 int *order_;
167};
168#endif
169
170/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
171*/
CbcRangeCompare
@ NWayBranchObj
Abstract branching object base class Now just difference with OsiBranchingObject.
virtual void previousBranch()
Reset every information so that the branching object appears to point to the previous child.
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object,...
CbcModel * model() const
Return model.
virtual void print() const
Print something about branch - only if log level high.
Abstract base class for consequent bounds.
Simple Branch and bound class.
Definition CbcModel.hpp:100
N way branching Object class.
Definition CbcNWay.hpp:82
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition CbcNWay.hpp:136
int numberInSet_
Number in set.
Definition CbcNWay.hpp:166
CbcNWayBranchingObject & operator=(const CbcNWayBranchingObject &rhs)
int * order_
order of branching - points back to CbcNWay
Definition CbcNWay.hpp:162
virtual ~CbcNWayBranchingObject()
virtual bool twoWay() const
Is this a two way object (-1 down, +1 up)
Definition CbcNWay.hpp:130
virtual double branch()
Does next branch and updates state.
virtual int numberBranches() const
The number of branch arms created for this branching object.
Definition CbcNWay.hpp:125
const CbcNWay * object_
Points back to object.
Definition CbcNWay.hpp:164
CbcNWayBranchingObject(CbcModel *model, const CbcNWay *nway, int numberBranches, const int *order)
Useful constructor - order had matrix indices way_ -1 corresponds to setting first,...
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.
CbcNWayBranchingObject(const CbcNWayBranchingObject &)
virtual CbcBranchingObject * clone() const
Clone.
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
Define an n-way class for variables.
Definition CbcNWay.hpp:15
int * members_
Members (indices in range 0 ... numberColumns-1)
Definition CbcNWay.hpp:75
CbcConsequence ** consequence_
Consequences (normally NULL)
Definition CbcNWay.hpp:77
const int * members() const
Members (indices in range 0 ... numberColumns-1)
Definition CbcNWay.hpp:62
int numberMembers_
data Number of members
Definition CbcNWay.hpp:72
virtual void feasibleRegion()
This looks at solution and sets bounds to contain solution.
CbcNWay & operator=(const CbcNWay &rhs)
Assignment operator.
void applyConsequence(int iSequence, int state) const
Applies a consequence for a single member.
virtual void redoSequenceEtc(CbcModel *model, int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
CbcNWay(const CbcNWay &)
virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
Creates a branching object.
virtual CbcObject * clone() const
Clone.
int numberMembers() const
Number of members.
Definition CbcNWay.hpp:56
void setConsequence(int iColumn, const CbcConsequence &consequence)
Set up a consequence for a single member.
virtual ~CbcNWay()
Destructor.
virtual double infeasibility(const OsiBranchingInformation *info, int &preferredWay) const
Infeasibility - large is 0.5 (and 0.5 will give this)
CbcNWay(CbcModel *model, int numberMembers, const int *which, int identifier)
Useful constructor (which are matrix indices)
virtual void feasibleRegion()=0
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
CbcModel * model() const
Return model.
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.