Ignore:
Timestamp:
Nov 24, 2005 6:55:32 AM (14 years ago)
Author:
forrest
Message:

add branching stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/CbcBranchCut.hpp

    r149 r216  
    113113      Assumed down will be first so way_ set to -1
    114114  */
    115   CbcCutBranchingObject (CbcModel * model, OsiRowCut & down, OsiRowCut &up);
     115  CbcCutBranchingObject (CbcModel * model, OsiRowCut & down, OsiRowCut &up, bool canFix);
    116116 
    117117  /// Copy constructor
     
    146146  /// Cut for the up arm (way_ = 1)
    147147  OsiRowCut up_;
     148  /// True if one way can fix variables
     149  bool canFix_;
    148150};
    149151
     
    216218  bool alwaysCreate_;
    217219};
     220
     221/** Define a branch class that branches so that it is only satsified if all
     222    members have different values
     223    So cut is x <= y-1 or x >= y+1
     224*/
     225
     226
     227class CbcBranchAllDifferent : public CbcBranchCut {
     228
     229public:
     230
     231  // Default Constructor
     232  CbcBranchAllDifferent ();
     233
     234  /** Useful constructor - passed set of integer variables which must all be different
     235  */
     236  CbcBranchAllDifferent (CbcModel * model, int number,const int * which);
     237 
     238  // Copy constructor
     239  CbcBranchAllDifferent ( const CbcBranchAllDifferent &);
     240   
     241  /// Clone
     242  virtual CbcObject * clone() const;
     243
     244  // Assignment operator
     245  CbcBranchAllDifferent & operator=( const CbcBranchAllDifferent& rhs);
     246
     247  // Destructor
     248  ~CbcBranchAllDifferent ();
     249
     250  /// Infeasibility - large is 0.5
     251  virtual double infeasibility(int & preferredWay) const;
     252
     253  /// Creates a branching object
     254  virtual CbcBranchingObject * createBranch(int way);
     255
     256
     257protected:
     258  /// data
     259
     260  /// Number of entries
     261  int numberInSet_;
     262  /// Which variables
     263  int * which_;
     264};
    218265#endif
Note: See TracChangeset for help on using the changeset viewer.