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/CbcNWay.hpp

    r1293 r1350  
    7070    CbcConsequence ** consequence_;
    7171};
     72/** N way branching Object class.
     73    Variable is number of set.
     74 */
     75class CbcNWayBranchingObject : public CbcBranchingObject {
     76
     77public:
     78
     79    // Default Constructor
     80    CbcNWayBranchingObject ();
     81
     82    /** Useful constructor - order had matrix indices
     83        way_ -1 corresponds to setting first, +1 to second, +3 etc.
     84        this is so -1 and +1 have similarity to normal
     85    */
     86    CbcNWayBranchingObject (CbcModel * model,  const CbcNWay * nway,
     87                            int numberBranches, const int * order);
     88
     89    // Copy constructor
     90    CbcNWayBranchingObject ( const CbcNWayBranchingObject &);
     91
     92    // Assignment operator
     93    CbcNWayBranchingObject & operator=( const CbcNWayBranchingObject& rhs);
     94
     95    /// Clone
     96    virtual CbcBranchingObject * clone() const;
     97
     98    // Destructor
     99    virtual ~CbcNWayBranchingObject ();
     100
     101    using CbcBranchingObject::branch ;
     102    /// Does next branch and updates state
     103    virtual double branch();
     104
     105#if 0
     106    // FIXME: what do we need to do here?
     107    /** Reset every information so that the branching object appears to point to
     108        the previous child. This method does not need to modify anything in any
     109        solver. */
     110    virtual void previousBranch();
    72111#endif
     112
     113    using CbcBranchingObject::print ;
     114    /** \brief Print something about branch - only if log level high
     115    */
     116    virtual void print();
     117    /** The number of branch arms created for this branching object
     118    */
     119    virtual int numberBranches() const {
     120        return numberInSet_;
     121    }
     122    /// Is this a two way object (-1 down, +1 up)
     123    virtual bool twoWay() const {
     124        return false;
     125    }
     126
     127    /** Return the type (an integer identifier) of \c this */
     128    virtual int type() const {
     129        return 105;
     130    }
     131
     132    /** Compare the original object of \c this with the original object of \c
     133        brObj. Assumes that there is an ordering of the original objects.
     134        This method should be invoked only if \c this and brObj are of the same
     135        type.
     136        Return negative/0/positive depending on whether \c this is
     137        smaller/same/larger than the argument.
     138    */
     139    virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
     140
     141    /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     142        same type and must have the same original object, but they may have
     143        different feasible regions.
     144        Return the appropriate CbcRangeCompare value (first argument being the
     145        sub/superset if that's the case). In case of overlap (and if \c
     146        replaceIfOverlap is true) replace the current branching object with one
     147        whose feasible region is the overlap.
     148     */
     149    virtual CbcRangeCompare compareBranchingObject
     150    (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     151
     152private:
     153    /// order of branching - points back to CbcNWay
     154    int * order_;
     155    /// Points back to object
     156    const CbcNWay * object_;
     157    /// Number in set
     158    int numberInSet_;
     159};
     160#endif
Note: See TracChangeset for help on using the changeset viewer.