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

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