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