source: branches/sandbox/Cbc/src/CbcCliqueBranchingObject.hpp @ 1293

Last change on this file since 1293 was 1293, checked in by EdwinStraver, 10 years ago
File size: 3.2 KB
Line 
1// Edwin 11/10/2009-- carved out of CbcBranchActual
2#ifndef CbcCbcCliqueBranchingObject_H
3#define CbcCbcCliqueBranchingObject_H
4
5#include "CbcBranchBase.hpp"
6#include "CbcClique.hpp"
7
8/** Branching object for unordered cliques
9
10    Intended for cliques which are long enough to make it worthwhile
11    but <= 64 members.  There will also be ones for long cliques.
12
13    Variable_ is the clique id number (redundant, as the object also holds a
14    pointer to the clique.
15 */
16class CbcCliqueBranchingObject : public CbcBranchingObject {
17
18public:
19
20    // Default Constructor
21    CbcCliqueBranchingObject ();
22
23    // Useful constructor
24    CbcCliqueBranchingObject (CbcModel * model,  const CbcClique * clique,
25                              int way,
26                              int numberOnDownSide, const int * down,
27                              int numberOnUpSide, const int * up);
28
29    // Copy constructor
30    CbcCliqueBranchingObject ( const CbcCliqueBranchingObject &);
31
32    // Assignment operator
33    CbcCliqueBranchingObject & operator=( const CbcCliqueBranchingObject& rhs);
34
35    /// Clone
36    virtual CbcBranchingObject * clone() const;
37
38    // Destructor
39    virtual ~CbcCliqueBranchingObject ();
40
41    using CbcBranchingObject::branch ;
42    /// Does next branch and updates state
43    virtual double branch();
44
45#if 0
46    // No need to override. Default works fine.
47    /** Reset every information so that the branching object appears to point to
48        the previous child. This method does not need to modify anything in any
49        solver. */
50    virtual void previousBranch();
51#endif
52
53    using CbcBranchingObject::print ;
54    /** \brief Print something about branch - only if log level high
55    */
56    virtual void print();
57
58    /** Return the type (an integer identifier) of \c this */
59    virtual int type() const {
60        return 102;
61    }
62
63    /** Compare the original object of \c this with the original object of \c
64        brObj. Assumes that there is an ordering of the original objects.
65        This method should be invoked only if \c this and brObj are of the same
66        type.
67        Return negative/0/positive depending on whether \c this is
68        smaller/same/larger than the argument.
69    */
70    virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
71
72    /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
73        same type and must have the same original object, but they may have
74        different feasible regions.
75        Return the appropriate CbcRangeCompare value (first argument being the
76        sub/superset if that's the case). In case of overlap (and if \c
77        replaceIfOverlap is true) replace the current branching object with one
78        whose feasible region is the overlap.
79     */
80    virtual CbcRangeCompare compareBranchingObject
81    (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
82
83private:
84    /// data
85    const CbcClique * clique_;
86    /// downMask - bit set to fix to weak bounds, not set to leave unfixed
87    unsigned int downMask_[2];
88    /// upMask - bit set to fix to weak bounds, not set to leave unfixed
89    unsigned int upMask_[2];
90};
91
92#endif
Note: See TracBrowser for help on using the repository browser.