Ignore:
Timestamp:
Dec 4, 2009 10:01:00 AM (10 years ago)
Author:
EdwinStraver
Message:

Combined CbcSOS with CbcSOSBranchingObject
Combined CbcNWay with CbcNWayBranchingObject
Combined CbcFollowOn? with CbcFixingBranchingObject?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/Cbc/src/CbcFollowOn.hpp

    r1293 r1350  
    6161};
    6262
     63/** General Branching Object class.
     64    Each way fixes some variables to lower bound
     65 */
     66class CbcFixingBranchingObject : public CbcBranchingObject {
     67
     68public:
     69
     70    // Default Constructor
     71    CbcFixingBranchingObject ();
     72
     73    // Useful constructor
     74    CbcFixingBranchingObject (CbcModel * model,
     75                              int way,
     76                              int numberOnDownSide, const int * down,
     77                              int numberOnUpSide, const int * up);
     78
     79    // Copy constructor
     80    CbcFixingBranchingObject ( const CbcFixingBranchingObject &);
     81
     82    // Assignment operator
     83    CbcFixingBranchingObject & operator=( const CbcFixingBranchingObject& rhs);
     84
     85    /// Clone
     86    virtual CbcBranchingObject * clone() const;
     87
     88    // Destructor
     89    virtual ~CbcFixingBranchingObject ();
     90
     91    using CbcBranchingObject::branch ;
     92    /// Does next branch and updates state
     93    virtual double branch();
     94
     95#if 0
     96    // No need to override. Default works fine.
     97    /** Reset every information so that the branching object appears to point to
     98        the previous child. This method does not need to modify anything in any
     99        solver. */
     100    virtual void previousBranch();
    63101#endif
     102
     103    using CbcBranchingObject::print ;
     104    /** \brief Print something about branch - only if log level high
     105    */
     106    virtual void print();
     107
     108    /** Return the type (an integer identifier) of \c this */
     109    virtual int type() const {
     110        return 106;
     111    }
     112
     113    /** Compare the original object of \c this with the original object of \c
     114        brObj. Assumes that there is an ordering of the original objects.
     115        This method should be invoked only if \c this and brObj are of the same
     116        type.
     117        Return negative/0/positive depending on whether \c this is
     118        smaller/same/larger than the argument.
     119    */
     120    virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
     121
     122    /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     123        same type and must have the same original object, but they may have
     124        different feasible regions.
     125        Return the appropriate CbcRangeCompare value (first argument being the
     126        sub/superset if that's the case). In case of overlap (and if \c
     127        replaceIfOverlap is true) replace the current branching object with one
     128        whose feasible region is the overlap.
     129     */
     130    virtual CbcRangeCompare compareBranchingObject
     131    (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     132
     133private:
     134    /// data
     135    /// Number on down list
     136    int numberDown_;
     137    /// Number on up list
     138    int numberUp_;
     139    /// downList - variables to fix to lb on down branch
     140    int * downList_;
     141    /// upList - variables to fix to lb on up branch
     142    int * upList_;
     143};
     144
     145#endif
Note: See TracChangeset for help on using the changeset viewer.