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

Last change on this file since 1293 was 1293, checked in by EdwinStraver, 10 years ago
File size: 3.3 KB
Line 
1// Edwin 11/10/2009-- carved out of CbcBranchActual
2#ifndef CbcCbcIntegerPseudoCostBranchingObject_H
3#define CbcCbcIntegerPseudoCostBranchingObject_H
4
5#include "CbcIntegerBranchingObject.hpp"
6/** Simple branching object for an integer variable with pseudo costs
7
8  This object can specify a two-way branch on an integer variable. For each
9  arm of the branch, the upper and lower bounds on the variable can be
10  independently specified.
11
12  Variable_ holds the index of the integer variable in the integerVariable_
13  array of the model.
14*/
15
16class CbcIntegerPseudoCostBranchingObject : public CbcIntegerBranchingObject {
17
18public:
19
20    /// Default constructor
21    CbcIntegerPseudoCostBranchingObject ();
22
23    /** Create a standard floor/ceiling branch object
24
25      Specifies a simple two-way branch. Let \p value = x*. One arm of the
26      branch will be is lb <= x <= floor(x*), the other ceil(x*) <= x <= ub.
27      Specify way = -1 to set the object state to perform the down arm first,
28      way = 1 for the up arm.
29    */
30    CbcIntegerPseudoCostBranchingObject (CbcModel *model, int variable,
31                                         int way , double value) ;
32
33    /** Create a degenerate branch object
34
35      Specifies a `one-way branch'. Calling branch() for this object will
36      always result in lowerValue <= x <= upperValue. Used to fix a variable
37      when lowerValue = upperValue.
38    */
39
40    CbcIntegerPseudoCostBranchingObject (CbcModel *model, int variable, int way,
41                                         double lowerValue, double upperValue) ;
42
43    /// Copy constructor
44    CbcIntegerPseudoCostBranchingObject ( const CbcIntegerPseudoCostBranchingObject &);
45
46    /// Assignment operator
47    CbcIntegerPseudoCostBranchingObject & operator= (const CbcIntegerPseudoCostBranchingObject& rhs);
48
49    /// Clone
50    virtual CbcBranchingObject * clone() const;
51
52    /// Destructor
53    virtual ~CbcIntegerPseudoCostBranchingObject ();
54
55    using CbcBranchingObject::branch ;
56    /** \brief Sets the bounds for the variable according to the current arm
57           of the branch and advances the object state to the next arm.
58           This version also changes guessed objective value
59    */
60    virtual double branch();
61
62    /// Change in guessed
63    inline double changeInGuessed() const {
64        return changeInGuessed_;
65    }
66    /// Set change in guessed
67    inline void setChangeInGuessed(double value) {
68        changeInGuessed_ = value;
69    }
70
71    /** Return the type (an integer identifier) of \c this */
72    virtual int type() const {
73        return 101;
74    }
75
76    /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
77        same type and must have the same original object, but they may have
78        different feasible regions.
79        Return the appropriate CbcRangeCompare value (first argument being the
80        sub/superset if that's the case). In case of overlap (and if \c
81        replaceIfOverlap is true) replace the current branching object with one
82        whose feasible region is the overlap.
83     */
84    virtual CbcRangeCompare compareBranchingObject
85    (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
86
87protected:
88    /// Change in guessed objective value for next branch
89    double changeInGuessed_;
90};
91
92#endif
Note: See TracBrowser for help on using the repository browser.