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

Last change on this file since 1293 was 1293, checked in by EdwinStraver, 10 years ago
File size: 2.6 KB
Line 
1// Edwin 11/10/2009-- carved out of CbcBranchActual
2
3#ifndef CbcOneGeneralBranchingObject_H
4#define CbcOneGeneralBranchingObject_H
5
6#include "CbcBranchBase.hpp"
7/** Branching object for general objects - just one
8
9 */
10class CbcOneGeneralBranchingObject : public CbcBranchingObject {
11
12public:
13
14    // Default Constructor
15    CbcOneGeneralBranchingObject ();
16
17    // Useful constructor
18    CbcOneGeneralBranchingObject (CbcModel * model,
19                                  CbcGeneralBranchingObject * object,
20                                  int whichOne);
21
22    // Copy constructor
23    CbcOneGeneralBranchingObject ( const CbcOneGeneralBranchingObject &);
24
25    // Assignment operator
26    CbcOneGeneralBranchingObject & operator=( const CbcOneGeneralBranchingObject& rhs);
27
28    /// Clone
29    virtual CbcBranchingObject * clone() const;
30
31    // Destructor
32    virtual ~CbcOneGeneralBranchingObject ();
33
34    using CbcBranchingObject::branch ;
35    /// Does next branch and updates state
36    virtual double branch();
37    /** Double checks in case node can change its mind!
38        Can change objective etc */
39    virtual void checkIsCutoff(double cutoff);
40
41    using CbcBranchingObject::print ;
42    /** \brief Print something about branch - only if log level high
43    */
44    virtual void print();
45    /** Return the type (an integer identifier) of \c this */
46    virtual int type() const {
47        return 110;
48    }
49
50    /** Compare the original object of \c this with the original object of \c
51        brObj. Assumes that there is an ordering of the original objects.
52        This method should be invoked only if \c this and brObj are of the same
53        type.
54        Return negative/0/positive depending on whether \c this is
55        smaller/same/larger than the argument.
56    */
57    virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
58
59    /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
60        same type and must have the same original object, but they may have
61        different feasible regions.
62        Return the appropriate CbcRangeCompare value (first argument being the
63        sub/superset if that's the case). In case of overlap (and if \c
64        replaceIfOverlap is true) replace the current branching object with one
65        whose feasible region is the overlap.
66     */
67    virtual CbcRangeCompare compareBranchingObject
68    (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
69
70public:
71    /// data
72    /// Object
73    CbcGeneralBranchingObject * object_;
74    /// Which one
75    int whichOne_;
76};
77
78#endif
Note: See TracBrowser for help on using the repository browser.