source: branches/sandbox/Cbc/src/CbcCutBranchingObject.hpp @ 1305

Last change on this file since 1305 was 1305, checked in by EdwinStraver, 10 years ago

Moved the objects CbcCutBranchingObject?, CbcBranchToFixLots?, and CbcBranchAllDifferent? to new files, out of CbcBranchCut?.

File size: 3.2 KB
Line 
1// Edwin 11/13/2009-- carved out of CbcBranchCut
2#ifndef CbcCutBranchingObject_H
3#define CbcCutBranchingObject_H
4
5#include "CbcBranchBase.hpp"
6#include "OsiRowCut.hpp"
7#include "CoinPackedMatrix.hpp"
8
9/** Cut branching object
10
11  This object can specify a two-way branch in terms of two cuts
12*/
13
14class CbcCutBranchingObject : public CbcBranchingObject {
15
16public:
17
18    /// Default constructor
19    CbcCutBranchingObject ();
20
21    /** Create a cut branching object
22
23        Cut down will applied on way=-1, up on way==1
24        Assumed down will be first so way_ set to -1
25    */
26    CbcCutBranchingObject (CbcModel * model, OsiRowCut & down, OsiRowCut &up, bool canFix);
27
28    /// Copy constructor
29    CbcCutBranchingObject ( const CbcCutBranchingObject &);
30
31    /// Assignment operator
32    CbcCutBranchingObject & operator= (const CbcCutBranchingObject& rhs);
33
34    /// Clone
35    virtual CbcBranchingObject * clone() const;
36
37    /// Destructor
38    virtual ~CbcCutBranchingObject ();
39
40    using CbcBranchingObject::branch ;
41    /** \brief Sets the bounds for variables or adds a cut depending on the
42               current arm of the branch and advances the object state to the next arm.
43           Returns change in guessed objective on next branch
44    */
45    virtual double branch();
46
47#if 0
48    // No need to override. Default works fine.
49    /** Reset every information so that the branching object appears to point to
50        the previous child. This method does not need to modify anything in any
51        solver. */
52    virtual void previousBranch();
53#endif
54
55    using CbcBranchingObject::print ;
56    /** \brief Print something about branch - only if log level high
57    */
58    virtual void print();
59
60    /** \brief Return true if branch should fix variables
61    */
62    virtual bool boundBranch() const;
63
64    /** Return the type (an integer identifier) of \c this */
65    virtual int type() const {
66        return 200;
67    }
68
69    /** Compare the original object of \c this with the original object of \c
70        brObj. Assumes that there is an ordering of the original objects.
71        This method should be invoked only if \c this and brObj are of the same
72        type.
73        Return negative/0/positive depending on whether \c this is
74        smaller/same/larger than the argument.
75    */
76    virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
77
78    /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
79        same type and must have the same original object, but they may have
80        different feasible regions.
81        Return the appropriate CbcRangeCompare value (first argument being the
82        sub/superset if that's the case). In case of overlap (and if \c
83        replaceIfOverlap is true) replace the current branching object with one
84        whose feasible region is the overlap.
85     */
86    virtual CbcRangeCompare compareBranchingObject
87    (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
88
89protected:
90    /// Cut for the down arm (way_ = -1)
91    OsiRowCut down_;
92    /// Cut for the up arm (way_ = 1)
93    OsiRowCut up_;
94    /// True if one way can fix variables
95    bool canFix_;
96};
97#endif
Note: See TracBrowser for help on using the repository browser.