source: branches/sandbox/Cbc/src/CbcDummyBranchingObject.hpp @ 1389

Last change on this file since 1389 was 1389, checked in by caphillSNL, 10 years ago

Start at adding documentation, removing magic numbers, removing dead code, etc.
Added an enum for type in classes derived from CbCBranchingObject. It's safer,
handier for debugging (inspection in a debugger), and clearly shows the relationship
between the dozen or so special numbers. Numbers are the same as they were before to
ensure no changes in correctness.

File size: 2.4 KB
Line 
1// Edwin 11/10/2009-- carved out of CbcBranchActual
2#ifndef CbcDummyBranchingObject_H
3#define CbcDummyBranchingObject_H
4
5#include "CbcBranchBase.hpp"
6/** Dummy branching object
7
8  This object specifies a one-way dummy branch.
9  This is so one can carry on branching even when it looks feasible
10*/
11
12class CbcDummyBranchingObject : public CbcBranchingObject {
13
14public:
15
16    /// Default constructor
17    CbcDummyBranchingObject (CbcModel * model = NULL);
18
19    /// Copy constructor
20    CbcDummyBranchingObject ( const CbcDummyBranchingObject &);
21
22    /// Assignment operator
23    CbcDummyBranchingObject & operator= (const CbcDummyBranchingObject& rhs);
24
25    /// Clone
26    virtual CbcBranchingObject * clone() const;
27
28    /// Destructor
29    virtual ~CbcDummyBranchingObject ();
30
31    using CbcBranchingObject::branch ;
32    /** \brief Dummy branch
33    */
34    virtual double branch();
35
36#if 0
37    // No need to override. Default works fine.
38    /** Reset every information so that the branching object appears to point to
39        the previous child. This method does not need to modify anything in any
40        solver. */
41    virtual void previousBranch();
42#endif
43
44    using CbcBranchingObject::print ;
45    /** \brief Print something about branch - only if log level high
46    */
47    virtual void print();
48
49    /** Return the type (an integer identifier) of \c this */
50    virtual CbcBranchObjType type() const {
51        return DummyBranchObj;
52    }
53
54    /** Compare the original object of \c this with the original object of \c
55        brObj. Assumes that there is an ordering of the original objects.
56        This method should be invoked only if \c this and brObj are of the same
57        type.
58        Return negative/0/positive depending on whether \c this is
59        smaller/same/larger than the argument.
60    */
61    virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
62
63    /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
64        same type and must have the same original object, but they may have
65        different feasible regions.
66        Return the appropriate CbcRangeCompare value (first argument being the
67        sub/superset if that's the case). In case of overlap (and if \c
68        replaceIfOverlap is true) replace the current branching object with one
69        whose feasible region is the overlap.
70     */
71    virtual CbcRangeCompare compareBranchingObject
72    (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
73
74};
75
76#endif
Note: See TracBrowser for help on using the repository browser.