1 | // Edwin 11/9/2009-- carved out of CbcBranchActual |
---|
2 | #ifndef CbcClique_H |
---|
3 | #define CbcClique_H |
---|
4 | |
---|
5 | /// Define a clique class |
---|
6 | |
---|
7 | class CbcClique : public CbcObject { |
---|
8 | |
---|
9 | public: |
---|
10 | |
---|
11 | // Default Constructor |
---|
12 | CbcClique (); |
---|
13 | |
---|
14 | /** Useful constructor (which are integer indices) |
---|
15 | slack can denote a slack in set. |
---|
16 | If type == NULL then as if 1 |
---|
17 | */ |
---|
18 | CbcClique (CbcModel * model, int cliqueType, int numberMembers, |
---|
19 | const int * which, const char * type, |
---|
20 | int identifier, int slack = -1); |
---|
21 | |
---|
22 | // Copy constructor |
---|
23 | CbcClique ( const CbcClique &); |
---|
24 | |
---|
25 | /// Clone |
---|
26 | virtual CbcObject * clone() const; |
---|
27 | |
---|
28 | // Assignment operator |
---|
29 | CbcClique & operator=( const CbcClique& rhs); |
---|
30 | |
---|
31 | // Destructor |
---|
32 | virtual ~CbcClique (); |
---|
33 | |
---|
34 | /// Infeasibility - large is 0.5 |
---|
35 | virtual double infeasibility(const OsiBranchingInformation * info, |
---|
36 | int &preferredWay) const; |
---|
37 | |
---|
38 | using CbcObject::feasibleRegion ; |
---|
39 | /// This looks at solution and sets bounds to contain solution |
---|
40 | virtual void feasibleRegion(); |
---|
41 | |
---|
42 | /// Creates a branching object |
---|
43 | virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ; |
---|
44 | /// Number of members |
---|
45 | inline int numberMembers() const { |
---|
46 | return numberMembers_; |
---|
47 | } |
---|
48 | |
---|
49 | /// Number of Non SOS members i.e. fixing to zero is strong |
---|
50 | inline int numberNonSOSMembers() const { |
---|
51 | return numberNonSOSMembers_; |
---|
52 | } |
---|
53 | |
---|
54 | /// Members (indices in range 0 ... numberIntegers_-1) |
---|
55 | inline const int * members() const { |
---|
56 | return members_; |
---|
57 | } |
---|
58 | |
---|
59 | /** Type of each member i.e. which way is strong 0=non SOS, 1 =SOS, |
---|
60 | index is 0 ... numberMembers_-1 */ |
---|
61 | inline char type(int index) const { |
---|
62 | if (type_) return type_[index]; |
---|
63 | else return 1; |
---|
64 | } |
---|
65 | |
---|
66 | /// Clique type - 0 <=, 1 == |
---|
67 | inline int cliqueType() const { |
---|
68 | return cliqueType_; |
---|
69 | } |
---|
70 | /// Redoes data when sequence numbers change |
---|
71 | virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns); |
---|
72 | |
---|
73 | protected: |
---|
74 | /// data |
---|
75 | /// Number of members |
---|
76 | int numberMembers_; |
---|
77 | |
---|
78 | /// Number of Non SOS members i.e. fixing to zero is strong |
---|
79 | int numberNonSOSMembers_; |
---|
80 | |
---|
81 | /// Members (indices in range 0 ... numberIntegers_-1) |
---|
82 | int * members_; |
---|
83 | |
---|
84 | /// Type of each member 0=SOS, 1 =clique |
---|
85 | char * type_; |
---|
86 | |
---|
87 | /// Clique type - 0 <=, 1 == |
---|
88 | int cliqueType_; |
---|
89 | |
---|
90 | /// Which one is slack (if any) sequence within this set |
---|
91 | int slack_; |
---|
92 | }; |
---|
93 | #endif |
---|